Singular Links (Tracking Links) API

This feature is available to Enterprise customers.

Use the new Singular Links API to create new Singular Links as well as view your existing Singular Links.

Main Flows

Using the API to Create a Partner Link

Screen_Shot_2023-01-31_at_13.23.43.png

To create a partner link using the API:

1

Call Get Apps to retrieve the app_id and app_site_id of the app you want to make a Singular Link for.

2

Call Get Configured Partners to get the partner_id of the ad network partner you want to make a Singular Link for.

Tip: Unfiltered, this query returns all the partners your organization has configured for each app_site_id. You can use the app_site_id you retrieved in the previous step to filter the query.

3 Call Get Link Domains to retrieve the subdomains and dns_zones you can use for your links.
4 Optionally, call Get All Partners to get more information about the partner you are creating a link for, such as whether it supports using the same link for multiple OSs, whether it supports reengagement links, and whether it supports CTV. You can filter the query by partner_id.
5

Call Create Link using the app_id, app_site_id, partner_id, subdomain, and dns_zone you retrieved in the previous steps.

Note: If the partner supports using the same link for multiple OSs, you can enter link destinations for Android and for iOS in the same Singular Link. Otherwise, you need to create a separate link for each OS.

If the partner supports reengagement and/or CTV, you can set these options to true for the Singular Link.

Using the API to Create a Custom Link

custom_links_flow.png

To create a custom link using the API:

1

Call Get Apps to retrieve the app_id and app_site_id of the app you want to make a Singular Link for.

2 Call Get Link Domains to retrieve the subdomains and dns_zones you can use for your links.
3

Call Create Link using the app_id, app_site_id, subdomain, and dns_zone you retrieved in the previous steps.

Note: The response also includes a shortened version of the link.

Singular Links API Overview

Endpoints

The following API endpoints are available:

MAIN ENDPOINT
Create Link POST https://api.singular.net/api/v1/singular_links/links  
View Links GET
HELPER ENDPOINTS
Get Apps GET https://api.singular.net/api/v1/singular_links/apps Use to get necessary information before you call Create Link or View Links.
Get Configured Partners GET https://api.singular.net/api/v1/singular_links/configured_partners
Get Link Domains GET https://api.singular.net/api/v1/singular_links/domains Use to get necessary information before you call Create Link.
Get All Partners GET https://api.singular.net/api/v1/singular_links/all_partners Use to learn which options are supported by each partner.

Authentication

All Singular API calls require your Singular API key. To retrieve your key, log into the Singular platform and go to Developer Tools > Reporting API Keys.

Put the API key in the authorization HTTP header (see the code examples).

Limits

The URL for get requests for these API endpoints can be up to 8000 characters long. Longer URLs will result in an error message.

Create Link Endpoint

POST https://api.singular.net/api/v1/singular_links/links

Usage

Use this endpoint to create a new Singular Link for one of your partner networks or for a custom source. Once you create the link, you can use it as a tracking link in your campaign with that network or custom source.

For more information, see Creating Singular Links and the rest of the Singular Links FAQ.

Notes:

  • When viewing your Singular Links in the Singular platform, API-created links aren't shown by default. To display them, toggle the Show API links option.
  • This is the same endpoint URL that to use for viewing your existing links, but here you use a POST request instead of a GET request, and there are more required parameters.

Sample Query (Creating a Partner Link)

Pythoncurl
import requests
import json

url = "https://api.singular.net/api/v1/singular_links/links"

api_key = <...> # Retrieve API Key from Singular platform at Developer Tools > Reporting API Keys

params = json.dumps({
  "app_id": <APP_ID>, # From Get Apps call
  "partner_id": <PARTNER_ID>, # From Get Configured Partners call
  "link_type": "partner",
  "tracking_link_name": "my tracking link",
  "link_subdomain": "<SUBDOMAIN>", # From Get Link Domains call
  "link_dns_zone": "sng.link",
  "destination_fallback_url": "https://www.example.com/",
  "android_redirection": {
    "app_site_id": <APP_SITE_ID>, # From Get Apps call
    "destination_url": "https://play.google.com/store/apps/details?id=com.my.app",
    "destination_deeplink_url": "https://www.example.com/",
    "destination_deferred_deeplink_url": "https://www.example.com/"
  }
})

response = requests.post(url, data=params, headers={'Authorization':api_key})

Sample Query (Creating a Custom Link)

Pythoncurl
import requests
import json

url = "https://api.singular.net/api/v1/singular_links/links"

payload = json.dumps({
  "app_id": <...>,
  "partner_id": <...>,
  "link_type": "custom",
  "source_name": "social",
  "enable_reengagement": "false",
  "tracking_link_name": "test-link-custom",
  "link_subdomain": "mydomain",
  "link_dns_zone": "sng.link",
  "destination_fallback_url": "https://fallback.com",
  "click_deterministic_window": 8,
  "click_probabilistic_window": 9,
  "enable_ctv": "false",
  "link_parameter": {
    "this": "is",
    "a": "test"
  },
  "android_redirection": {
    "app_site_id": 609747,
    "destination_url": "https://play.google.com/store/apps/details?id=com.my.app",
    "destination_deeplink_url": "https://example.com",
    "destination_deferred_deeplink_url": "https://example.com"
  }
})
headers = {
  'Authorization': '<...>',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Query Parameters

Parameter Description Notes for Partner Links Notes for Custom Links
app_id The ID of the app you are creating the link for. To see a list of your apps, use the Get Apps endpoint. Required Required
link_type "partner" or "custom" (learn more about partner vs. custom links). Required Required
partner_id The ID of the partner network you are creating the link for. To see a list of the partners configured for this particular app, use the Get Configured Partners endpoint. Required
 
source_name Specify "crosspromo", "email", "sms", "social", "affiliates", or "influencers".
  Required
tracking_link_name A name you give your Singular Link to identify it later in your Singular reports. Most organizations use the campaign name or a variation on the campaign name. The tracking_link_name will appear in your Singular reports as "Tracker Name". Required Required
link_dns_zone Singular tracking links have the following structure: https://[SUBDOMAIN].[DNS_ZONE]/[PARAMETERS] The DNS zone is "sng.link". Required Required
link_subdomain Singular tracking links have the following structure, where [SUBDOMAIN] is chosen by the organization: https://[SUBDOMAIN].[DNS_ZONE]/[PARAMETERS] For a list of the subdomains that have been configured for your organization, call Get Link Domains. Required Required
destination_fallback_url This is the destination that you want to take the user to if the deep link fails. Typically, if a user clicks an ad for your app, you want the deep link to send them into a specific screen inside the app. But if the user doesn't already have the app installed, you want to redirect the user to the app store instead to download your app. Required Required
android_redirection

An object containing parameters that specify where the link should lead to on Android devices:

  • app_site_id
  • destination_url
  • destination_deeplink_url (optional, null by default)
  • destination_deferred_deeplink_url (optional, null by default)

Note: Either android_redirection or ios_redirection must be specified. You can specify both only if the network partner allows multiple OSs in one Singular Link.

Required

Required

ios_redirection

An object containing parameters that specify where the link should lead to on iOS devices:

  • app_site_id
  • destination_url
  • destination_deeplink_url (optional, null by default)
  • destination_deferred_deeplink_url (optional, null by default)

Note: Either android_redirection or ios_redirection must be specified. You can specify both only if the network partner allows multiple OSs in one Singular Link.

Required

Required

enable_reengagement

Set to true to mark this link as belonging to a reengagement campaign (see the Reengagement FAQ)

Optional. Note that not all partners support this option. You can see what the specific partner supports using a Get All Partners query and specifying the partner ID.

Optional. Re-engangement is supported for clicks and requires configuring deep-linking redirect.

click_deterministic_window

The attribution window for click-through using deterministic attribution. You can specify 0-30 days.

 

 

Optional. For partner links, the default is set up for each app site and partner in the Partner Configuration page.

Optional. For custom links, the default is 7 days.

click_probabilistic_window

The attribution window for click-through using probabilistic attribution. You can specify 0-24 hours.

 

 

Optional. For partner links, the default is set up for each app site and partner in the Partner Configuration page.

Optional. For custom links, the default is 24 hours.

View_deterministic_window

The attribution window for view-through (impressions) using deterministic attribution. You can specify 0-24 hours.

Optional. For partner links, the default is set up for each app site and partner in the Partner Configuration page.

Optional. For custom links, the default is 24 hours.

view_probabilistic_window

The attribution window for view-through (impressions) using probabilistic attribution. The default is 8 hours. You can specify 0-24 hours. Optional Optional
click_reengagement_window

The attribution window for click-through in reengagement campaigns. This is only relevant if enable_reengagement is set to true. You can specify 0-30 days.

Optional. For partner links, there is a default value set per partner, but you can specify a different value.

Optional. For custom links, the default is 7 days.

enable_ctv

Set to true to support CTV campaigns. This is only relevant if the network partner supports CTV campaigns. Depending on the partner, the value of enable_ctv may be true by default. Optional Optional

Sample Output

JSON
{
  "tracking_link_id": "<...>",
  "tracking_link_name": "jr us and ca spring 2022",
  "click_tracking_link": "https://mysubdomain.sng.link/<...>/<...>?idfa=$IDA&and5=$UDID&aifa=$GPID&s=$SITE_APP_ID&psid=$SITE_APP_ID&psn=$SITE_NAME&cl=impId&pcrn=$CREATIVE_NAME&pcrid=$CREATIVE_ID&pcid=$CAMPAIGN_ID&pc=$CAMPAIGN_ID&pcn=$CAMPAIGN_NAME&pscid=$ADGROUP_ID&cr=$CREATIVE_ID&andi1=$O1&pscn=$ADGROUP_NAME&impid=$IMP_ID&pshid=$BLINDED_SITE_ID",
  "impression_tracking_link": "https://i.sng.link/<...>/<...>?idfa=$IDA&and5=$UDID&aifa=$GPID&s=$SITE_APP_ID&psid=$SITE_APP_ID&psn=$SITE_NAME&cl=impId&pcrn=$CREATIVE_NAME&pcrid=$CREATIVE_ID&pcid=$CAMPAIGN_ID&pc=$CAMPAIGN_ID&pcn=$CAMPAIGN_NAME&pscid=$ADGROUP_ID&cr=$CREATIVE_ID&andi1=$O1&pscn=$ADGROUP_NAME&impid=$IMP_ID&pshid=$BLINDED_SITE_ID",
"short_link": "https://prod_test.sng.link/D75p1/mbm7/961w" "extra_info": [ "partner's default value was used, instead of given argument enable_ctv", "partner's default value was used, instead of given argument enable_reengagement" ] }

Output Parameters

If the Singular Link was created successfully, the response includes the following parameters:

Parameter Description
tracking_link_id The internal ID of the tracking link. It's also included in the tracking link URL.
tracking_link_name The name you gave to the tracking link.
click_tracking_link The tracking link URL for click-through campaigns. The URL includes macros that will be replaced with actual values by the partner network when the link is served.
impression_tracking_link The tracking link URL for view-through campaigns, if supported.
short_link

A shortened URL version of the link (for Custom links only).

Note: This link is created using our short link service, not our Referral Tracking service. These short links don't expire.

In the example above, the short link is "https://prod_test.sng.link/D75p1/mbm7/961w" where "961w" is the short link ID.

extra_info Even though the link was created successfully, Singular may have warnings and clarifications for you. These are collected under extra_info.

Error Messages

If the link was NOT created successfully due to a configuration problem, you will receive a message explaining the problem. Fix it and try calling Create Link again.

Error Message Notes
app_site_id does not exist  
Partner x is not configured for app y  
Link_domain not defined  
<attribution_window> value not supported You have set a value that is not supported for one of the attribution windows.
Partner does not support multiple OSs per link You tried to set both Android redirection values and iOS redirection values for a network partner that does not support using a single tracking link for multiple OSs.
Partner X does not allow tracking links Self-attributing networks (SANs) such as Facebook and Google do not support tracking links and therefore Singular does not let you create Singular Links for these partners.

View Links Endpoint

GET https://api.singular.net/api/v1/singular_links/links

Usage

Use this endpoint to view the details of your existing Singular Links.

You can filter the request by one or more of the following fields: app_id, app_site_id, partner_id, source_name, and tracking_link_id. To get these IDs, call the Get Apps and Get Configured Partners endpoints.

Note: This is the same endpoint (URL) that you use for creating a new link, but you use a GET request instead of a POST request.

Sample Query

Pythoncurl
import requests

url = "https://api.singular.net/api/v1/singular_links/links"
api_key = <...> # Retrieve API Key from Singular platform at Developer Tools > Reporting API Keys
        
# All the parameters are optional. They are used to filter the list of links
params = {
    "link_type": "partner",
    "partner_id": "<...>",
    "app_id": "<...>",
    "app_site_id": "<...>",
    "tracking_link_id": "abcde"
}

response = requests.get(url=url, params=params, headers={'Authorization':api_key})

Query Parameters

Parameter Description
link_type [Optional] If you want to see only one link type, enter "custom", "partner", or "mobile_web_to_app".
partner_id [Optional] If you want to see only partner links configured for a specific partner, enter the Singular internal ID for the partner.
source_name
[Optional] If you only want to see custom links configured for a specific source.
app_id [Optional] If you want to see only links configured for a specific app, enter the Singular internal ID for the app.
app_site_id [Optional] If you want to see only links configured for a specific app site, enter the Singular internal ID for the app site.
tracking_link_id [Optional] If you only want to see details for one specific Singular Link, enter the link's ID. You can find the ID in the tracking link URL:
https://myapp.sng.link/sdfsdf/abcde?...

Sample Output

The output contains an array of all the Singular Links that match your filtering parameters (if you didn't enter any filtering parameters, this will show all your existing Singular Links).

JSON
[
  {
    'tracking_link_id': '<...>',
    'tracking_link_name': 'My App Android Summer 22',
    'click_tracking_link': 'https://myapp.sng.link/<...>/<...>?idfa={IDFA}&aifa={IDFA}&did={DID}&ip={IP}&pcrn={AD_NAME}&pcid={CAMPAIGN_ID}&pcn={CAMPAIGN_NAME}&pcrid={AD_ID}&pshid={APP_ID}',
    'impression_tracking_link':'https://myapp.sng.link/<...>/<...>?idfa={IDFA}&aifa={IDFA}&did={DID}&ip={IP}&pcrn={AD_NAME}&pcid={CAMPAIGN_ID}&pcn={CAMPAIGN_NAME}&pcrid={AD_ID}&pshid={APP_ID}',
    'created_utc': 'Tue, 23 Aug 2022 12:22:58 GMT',
    'modified_utc': 'Thu, 24 Nov 2022 11:13:41 GMT',
    'link_type': 'partner',
    'partner_id': <...>,
    'app_id': <...>,,
    'android_redirection': {
      'app_site_id': <...>,
      'destination_url': 'https://play.google.com/store/apps/details?id=...',
      'destination_deeplink_url': None,
      'destination_deferred_deeplink': None
    },
    'destination_fallback_url': 'https://www.mywebsite.com',
    'click_deterministic_window': '7 Days',
    'view_deterministic_window': '24 Hours',
    'enable_reengagement': False,
    'enabled_ctv': False,
  },
  ...
]

Output Parameters

An array of the following parameters per link:

Parameter Description
General Parameters
tracking_link_id A unique identifier for the tracking link.
tracking_link_name The name given to the link when it was created.
click_tracking_link The tracking link's URL for click-through.
impression_tracking_link The tracking link's URL for view-through.
created_utc UTC timestamp of when the link was created.
modified_utc UTC timestamp of when the link was last modified.
link_type "partner" or "custom"
partner_id The unique Singular internal ID of the partner.
app_id The internal Singular ID for the app.
Link Destinations
android_redirection

An object containing the following parameters:

  • app_site_id
  • Destination_url
  • Destination_deeplink_url (optional, null by default)
  • Destination_deferred_deeplink_url (optional, null by default)
ios_redirection

An object containing the following parameters:

  • app_site_id
  • Destination_url
  • Destination_deeplink_url (optional, null by default)
  • Destination_deferred_deeplink_url (optional, null by default)
destination_fallback_url This is the destination that you want to take the user to if the deep link fails. Typically, if a user clicks an ad for your app, you want the deep link to send them into a specific screen inside the app. But if the user doesn't already have the app installed, you want to redirect the user to the app store instead to download your app.
Optional Functionality
enable_reengagement True if the link was marked as a link used for reengagement/retargeting campaigns.
enabled_ctv True if the link is supported for CTV campaigns.
Attribution Window Settings
click_deterministic_window The attribution window for this link in click-through campaigns when attributed through deterministic methods (e.g., matching the device ID used for the click with the device ID used to install the app)
click_probabilistic_window The attribution window for this link in click-through campaigns when attributed through probabilistic methods (such as the device location, operating system, etc.)
View_deterministic_window The attribution window for this link in view-through campaigns when attributed through deterministic methods (e.g., matching the device ID used for the click with the device ID used to install the app)
view_probabilistic_window The attribution window for this link in view-through campaigns when attributed through probabilistic methods (such as the device location, operating system, etc.)
click_reengagement_window The attribution window for this link in click-through reengagement campaigns. This parameter is included only if reengagement is enabled for this Singular Link.

Get Apps Endpoint

GET https://api.singular.net/api/v1/singular_links/apps

Usage

Use this endpoint to get a list of all your app sites configured in Singular (see What is the difference between an app and an app site?).

Sample Query

Pythoncurl
import requests

url = "https://api.singular.net/api/v1/singular_links/apps"
api_key = <...> # Retrieve API Key from Singular platform at Developer Tools > Reporting API Keys

response = requests.get(url=url, headers={'Authorization': api_key})

Sample Output

JSON
{
  'available_apps': [
    {
      'app_site_id': <...>,
      'app_platform': 'ios',
      'app_store_url': 'https://itunes.apple.com/us/app/…',
      'site_public_id': '<...>',
      'app_id': <...>,
      'app': 'My App'
    },
    {
      'app_site_id': <...>,
      'app_platform': 'android',
      'app_store_url': 'https://play.google.com/store/apps/details?id=...',
      'site_public_id': 'com.rovio.baba',
      'app_id': <...>,
      'app': 'My App'
    }
  ]
}

Output Parameters

The response is an array of app site with the following parameters for each app site:

Parameter Description
app_site_id Singular's internal ID for the app site (app + OS + bundle ID) (see What is the difference between an app and an app site?).
app_platform The platform defined for the app site, e.g. iOS.
app_store_url The URL of the app in Google Play or the Apple App Store.
site_public_id This is the app's ID in the Apple App Store or Google Play (see What is the difference between an app and an app site?). For websites, this is the website URL.
app_bundle_id The app's internal identifier, e.g., "com.myapp".
app_id Singular's internal ID for the app in Singular.
app The app name as configured in the Apps page.

Get Configured Partners Endpoint

GET https://api.singular.net/api/v1/singular_links/configured_partners

Usage

Retrieve a list of the partners (ad networks) you have configured for each app site. You can filter the request to specific app sites and partners.

Note: The list will not include partners such as Facebook, Google Ads, or other self-attributing networks (SANs) that do not support Singular Links.

Sample Query

Pythoncurl
import requests        
        
url = "https://api.singular.net/api/v1/singular_links/configured_partners"
api_key = <...> # Retrieve API Key from Singular platform at Developer Tools > Reporting API Keys
        
params = {
  # The app sites for which you want to see which partners are configured
  "app_site_id": "<APP_SITE_ID1>,<APP_SITE_ID2>",

  # Optional filtering parameter
  "partner_id": "<PARTNER_ID1>,<PARTNER_ID2>" 
}

response = requests.get(url=url, params=params, headers={'Authorization': api_key})

Query Parameters

Parameter Description
app_site_id [Optional] An App Site ID or a list of App Site IDs separated by commas, to filter the list by.
partner_id [Optional] A Partner ID or a list of Partner IDs separated by commas, to filter the list by.

Sample Output

The following is a sample output of a request filtered by app_site_id = "22334". There are two partners configured for this app site.

JSON
{
  'available_partners': [
    {
      'app_site_id': <...>,
      'app_id': <...>,
      'singular_partner_display_name':'AdWords',
      'singular_partner_id':<...>
    },
    {
      'app_site_id': <...>,
      'app_id': <...>,
      'singular_partner_display_name':'SplitMetrics',
      'singular_partner_id':<...>,

    }
  ] 
}

Output Parameters

An array of app sites with the following parameters per app site::

Parameter Description
app_site_id Singular's internal ID for the app site.
app_id Singular's internal ID for the app.
singular_partner_display_name The partner's name in Singular, e.g., "IronSource".
singular_partner_id Singular's internal ID for the partner.

Get All Partners Endpoint

GET https://api.singular.net/api/v1/singular_links/all_partners

Usage

Retrieve details about the partners configured for your organization.

You can filter the request by a partner ID or multiple partner IDs to get details only on specific partners.

Note: The list will not include partners such as Facebook, Google Ads, or other self-attributing networks (SANs) that do not support Singular Links.

Sample Query

Pythoncurl
import requests        

url = "https://api.singular.net/api/v1/singular_links/all_partners"
api_key = <...> # Retrieve API Key from Singular platform at Developer Tools > Reporting API Keys

params = {
  #Optional: filter to see specific partner(s)
  "partner_id": "<PARTNER_ID1>,<PARTNER_ID2>" 
}

response = requests.get(url=url, params=params, headers={'Authorization':api_key})

Query Parameters

Parameter Description
singular_partner_id [Optional] Comma-separated list of partner IDs to display details about.

Sample Output

JSON
{
  'partners': [
    {
      'singular_partner_id': <...>,
      'singular_partner_display_name': 'One Network',
      'support_multiple_os': True,
      'support_reengagement': True,
      'support_ctv': False,
    },
    {
      'singular_partner_id': <...>,
      'singular_partner_display_name': 'Other Network',
      'support_multiple_os': False,
      'support_reengagement': True,
      'support_ctv': True,
    },

    ...
         
  ]
}

Output Parameters

An array of partners with the following parameters per partner:

Parameter Description
singular_partner_id Singular's internal ID for the partner.
singular_partner_display_name The partner's name in Singular, e.g., "IronSource".
support_multiple_os True if the partner supports defining an iOS destination and an Android destination in the same tracking link. If supported by the partner, you can create one Singular Link to be used in campaigns for both OSs.
support_reengagement True if the partner supports reengagement links. If supported by the partner, you can create a Singular Link that is marked as a reengagement link and use it in your retargeting campaign.
support_ctv True if the partner supports CTV. If supported by the partner, you can create links that are CTV-enabled.

Get Link Domains Endpoint

GET https://api.singular.net/api/v1/singular_links/domains

Usage

Retrieve a list of your Singular Links domains. Singular tracking links have the following structure, where [SUBDOMAIN] is chosen by you, and the DNS zone is "sng.link":

https://[SUBDOMAIN].sng.link/[PARAMETERS]

When you create a Singular link, you have to specify the subdomain and DNS zone to be used in the link URL.

Tip: Link domains are created in the Singular platform under Attribution > Manage Links. You have to define at least one domain before you can create any Singular Links.

Sample Query

Pythoncurl
import requests        

url = "https://api.singular.net/api/v1/singular_links/domains"
api_key = <...> # Retrieve API Key from Singular platform at Developer Tools > Reporting API Keys

response = requests.get(url=url, headers={'Authorization': api_key})

Sample Output

This request returns a list of the Singular Links domains created for your organization.

JSON
{
  'available_domains': [
    {
      'subdomain': 'myorg',
      'dns_zone': 'sng.link'
    }, 
    {
      'subdomain': 'awesomeapp',
      'dns_zone': 'sng.link'
      }
  ]
}

Output Parameters

Parameter Description
subdomain The name you gave the subdomain, for example, the name of your company. Together with the dns_zone, it creates the domain to be used in Singular Links.
dns_zone "sng.link"