Criar link no Dub, por uma API

Encurta uma URL e devolve o link curto em shortLink, com seu id. Sem domain usa o domínio principal do workspace, ou dub.sh se não houver.

Identificador
dub_create_link

A chamada

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>"
  }
}

Seu sistema envia o id da conexão do cliente e os argumentos da tool. Os headers são os mesmos de toda a API do Connect: o token do seu produto e o token do cliente.

Parâmetros

As descrições dos parâmetros seguem a documentação oficial do app, em inglês.

ParâmetroTipoObrigatórioDescrição
urlstringSimDestination URL.
domainstringNãoDomain of the short link, without protocol, from List domains.
keystringNãoSlug of the short link, the part after the domain.
tagIdsarrayNãoIds of the tags of the link, from List tags or Create tag.
folderIdstringNãoId of the folder of the link, from List folders.
commentsstringNãoInternal notes about the link.
utm_sourcestringNãoUTM source added to the destination URL, replacing the one in it.
utm_mediumstringNãoUTM medium added to the destination URL, replacing the one in it.
utm_campaignstringNãoUTM campaign added to the destination URL, replacing the one in it.
utm_termstringNãoUTM term added to the destination URL, replacing the one in it.
utm_contentstringNãoUTM content added to the destination URL, replacing the one in it.
trackConversionbooleanNãotrue tracks leads and sales of the link. The workspace needs conversion tracking set up.
expiresAtstringNãoWhen the link expires.
expiredUrlstringNãoWhere the link sends visitors after it expires.
proxybooleanNãotrue shows the custom preview of title, description and image when the link is shared.
titlestringNãoTitle of the custom preview. Used when proxy is true.
descriptionstringNãoDescription of the custom preview. Used when proxy is true.
imagestringNãoURL of the image of the custom preview. Used when proxy is true.

Conexões possíveis

O seu cliente conecta a conta do Dub uma vez, por um dos modos abaixo. A mesma conexão serve para todas as tools do toolkit.

OAuth com o app do seu produto

Você cadastra o app OAuth do seu produto uma vez, em POST /api/merchants/credentials/dub, e o cliente autoriza a conta numa tela de consentimento. O Connect renova o token quando ele está para vencer.

A resposta

Em caso de sucesso, o Connect preserva o status e o corpo da resposta do app. Erros HTTP retornados pelo app usam o envelope {error, api_error}; falhas de autenticação ou validação podem ocorrer antes da execução. O header X-Toolkit-Execution-Id identifica a execução registrada, consultável em GET /api/tools/executions/{uuid}.

Pronta para agentes de IA

O input desta tool é um JSON Schema, disponível em GET /api/tools/dub_create_link. Ele vira a definição de tool do seu agente sem conversão.

Veja o Connect aplicado ao seu produto.

Teste por 15 dias sem cartão, ou mostre seu cenário ao nosso time.