POST
/
tokens
/
embed
/
referrals
require 'dub'

s = ::OpenApiSDK::Dub.new(
      security: ::OpenApiSDK::Shared::Security.new(
        token: "DUB_API_KEY",
      ),
    )

req = ::OpenApiSDK::Operations::CreateReferralsEmbedTokenRequestBody.new(
  program_id: "<id>",
  partner: ::OpenApiSDK::Operations::Partner.new(
    name: "<value>",
    email: "Florencio98@hotmail.com",
    link_props: ::OpenApiSDK::Operations::CreateReferralsEmbedTokenLinkProps.new(
      external_id: "123456",
      tag_ids: [
        "clux0rgak00011...",
      ],
      test_variants: [
        ::OpenApiSDK::Operations::CreateReferralsEmbedTokenTestVariants.new(
          url: "https://example.com/variant-1",
          percentage: 50.0,
        ),
        ::OpenApiSDK::Operations::CreateReferralsEmbedTokenTestVariants.new(
          url: "https://example.com/variant-2",
          percentage: 50.0,
        ),
      ],
    ),
  ),
)

res = s.embed_tokens.referrals(req)

if ! res.object.nil?
  # handle response
end
{
  "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

Response

201
application/json

The created public embed token.

The response is of type object.