POST
/
tokens
/
embed
/
referrals
from dub import Dub


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

    res = d_client.embed_tokens.referrals(request={
        "program_id": "<id>",
        "partner": {
            "name": "<value>",
            "email": "Florencio98@hotmail.com",
            "link_props": {
                "external_id": "123456",
                "tag_ids": [
                    "clux0rgak00011...",
                ],
                "test_variants": [
                    {
                        "url": "https://example.com/variant-1",
                        "percentage": 50,
                    },
                    {
                        "url": "https://example.com/variant-2",
                        "percentage": 50,
                    },
                ],
            },
        },
    })

    assert res is not None

    # Handle response
    print(res)
{
  "publicToken": "<string>",
  "expires": "<string>"
}

Referrals embed token endpoint require an Advanced plan subscription or higher.

Authorizations

Authorization
string
header
required

Default authentication mechanism

Body

application/json
programId
string
required
partnerId
string
tenantId
string
partner
object

Response

201
application/json
The created public embed token.
publicToken
string
required
expires
string
required

Was this page helpful?