Créer un lien avec l'API Dub

Raccourcit une URL et renvoie le lien court dans shortLink, avec son id. Sans domain il utilise le domaine principal du workspace, ou dub.sh s'il n'y en a pas.

Identifiant
dub_create_link

L'appel

POST https://connect.reportei.com/api/tools/dub_create_link/execute
Authorization: Bearer <merchant token>
x-customer-token: <customer token>
Content-Type: application/json
Accept: application/json

{
  "customer_toolkit": "<connection UUID>",
  "arguments": {
    "url": "<url>"
  }
}

Votre système envoie l'id de la connexion de votre client et les arguments de la tool. Les headers sont les mêmes que pour toute l'API Connect : le token de votre produit et celui de votre client.

Paramètres

Les descriptions des paramètres suivent la documentation officielle de l'app, en anglais.

ParamètreTypeObligatoireDescription
urlstringOuiDestination URL.
domainstringNonDomain of the short link, without protocol, from List domains.
keystringNonSlug of the short link, the part after the domain.
tagIdsarrayNonIds of the tags of the link, from List tags or Create tag.
folderIdstringNonId of the folder of the link, from List folders.
commentsstringNonInternal notes about the link.
utm_sourcestringNonUTM source added to the destination URL, replacing the one in it.
utm_mediumstringNonUTM medium added to the destination URL, replacing the one in it.
utm_campaignstringNonUTM campaign added to the destination URL, replacing the one in it.
utm_termstringNonUTM term added to the destination URL, replacing the one in it.
utm_contentstringNonUTM content added to the destination URL, replacing the one in it.
trackConversionbooleanNontrue tracks leads and sales of the link. The workspace needs conversion tracking set up.
expiresAtstringNonWhen the link expires.
expiredUrlstringNonWhere the link sends visitors after it expires.
proxybooleanNontrue shows the custom preview of title, description and image when the link is shared.
titlestringNonTitle of the custom preview. Used when proxy is true.
descriptionstringNonDescription of the custom preview. Used when proxy is true.
imagestringNonURL of the image of the custom preview. Used when proxy is true.

Connexions possibles

Votre client connecte son compte Dub une seule fois, avec l'un des modes ci-dessous. La même connexion sert à toutes les tools du toolkit.

OAuth avec l'app de votre produit

Vous enregistrez une fois l'app OAuth de votre produit, avec POST /api/merchants/credentials/dub, et votre client autorise le compte sur un écran de consentement. Connect renouvelle le token avant son expiration.

La réponse

En cas de succès, Connect conserve le statut et le corps de la réponse de l'app. Les erreurs HTTP renvoyées par l'app utilisent l'objet {error, api_error} ; l'authentification ou la validation peuvent échouer avant l'exécution. Le header X-Toolkit-Execution-Id identifie l'exécution enregistrée, consultable avec GET /api/tools/executions/{uuid}.

Prête pour les agents IA

L'input de cette tool est un JSON Schema, disponible via GET /api/tools/dub_create_link. Il devient la définition de tool de votre agent sans conversion.

Autres tools Dub

Voir les 10 tools

Toolkits de la même catégorie

Voir les 100 toolkits

Voyez Connect appliqué à votre produit.

Essayez-le pendant 15 jours sans carte, ou présentez votre cas à notre équipe.