shortUrl
Requires at least one of the permissions marketing:link:read, marketing:link:write or settings:integration:read.
Returns one short link of your organization, by its ID or its code. Fails if it does not exist. Needs the marketing links read or write permission, or the integration settings read permission.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query ShortUrl($idOrCode: String!) {
shortUrl(idOrCode: $idOrCode) {
id
shortCode
title
createdAt
clickCount
createdBy
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query ShortUrl($idOrCode: String!) {\n shortUrl(idOrCode: $idOrCode) {\n id\n shortCode\n title\n createdAt\n clickCount\n createdBy\n }\n}",
"variables": {
"idOrCode": "string"
}
}
EOF
Variables:
{
"idOrCode": "string"
}
Response:
{
"data": {
"shortUrl": {
"id": "string",
"shortCode": "string",
"title": "string",
"createdAt": "2025-01-15T00:00:00Z",
"clickCount": 0,
"createdBy": "string"
}
}
}
shortUrl(
idOrCode: String!
): ShortUrlEntity!
Arguments
shortUrl.idOrCode ● String! non-null scalar
The ID, the short code or the custom alias of the short link.
Type
ShortUrlEntity object
A short link.