GET
/
partners
/
links
from dub import Dub


with Dub(
    token="DUB_API_KEY",
) as d_client:

    res = d_client.partners.retrieve_links(request={
        "program_id": "<id>",
    })

    assert res is not None

    # Handle response
    print(res)
[
  {
    "id": "<string>",
    "domain": "<string>",
    "key": "<string>",
    "shortLink": "<string>",
    "url": "<string>",
    "clicks": 0,
    "leads": 0,
    "sales": 0,
    "saleAmount": 0
  }
]

Partners endpoints require an Advanced plan subscription or higher.

Authorizations

Authorization
string
header
required

Default authentication mechanism

Query Parameters

programId
string
required
partnerId
string
tenantId
string

Response

200
application/json
The retrieved partner links.
id
string
required

The unique ID of the short link.

domain
string
required

The domain of the short link. If not provided, the primary domain for the workspace will be used (or dub.sh if the workspace has no domains).

key
string
required

The short link slug. If not provided, a random 7-character slug will be generated.

The full URL of the short link, including the https protocol (e.g. https://dub.sh/try).

url
string
required

The destination URL of the short link.

clicks
number
default:0
required

The number of clicks on the short link.

leads
number
default:0
required

The number of leads the short links has generated.

sales
number
default:0
required

The number of sales the short links has generated.

saleAmount
number
default:0
required

The total dollar amount of sales the short links has generated (in cents).