customisable counter
API: Authentication / API / Knowledge Base - Trafficspaces Support

API: Authentication

If you wish to use the Ad Store API, you will need to authenticate your call using the Basic Authentication method over an HTTPS connection.
In contrast, the requests to the Ad Server API endpoint do not require authentication and can be made over a either HTTP or HTTPS connection.

API Credentials

Basic Authentication requires a special username and password to be passed with every request.

Note: This is not the same as the username and password with which you normally login to to use the Ad Store

  • API Username - This is the same as the first part of the subdomain of your ad store. For example, if your subdomain is acme.trafficspaces.com, then your API username will be acme
  • API Password - This is a special key that you have to generate in your Ad Store. To generate one, follow these steps
    1. Login to your Ad Store with your administrator credentials.
    2. Go to the Setup > Integrations > API Access section.
    3. If you haven't yet generated an API Key, or you wish to generate a new one, click on the Generate API Key button.
    4. Finally, click on the Show API Key button to reveal the API key.

Authenticating with your API Credentials

The procedure for setting up Basic Authentication will vary depending on the HTTP library you are using.

However here is an example of how to use the curl command line tool to authenticate.

Assuming the Ad Store's domain name is acme.trafficspaces.com, and the generated API Key is abcdefghijklmnopqwsrtuvwzyz, then to fetch the list of users, you can either do this

curl -u acme:abcdefghijklmnopqwsrtuvwzyz https://acme.trafficspaces.com/resources/users/

or

curl -u  https://acme:abcdefghijklmnopqwsrtuvwzyz@acme.trafficspaces.com/resources/users/

Recent Discussions

25 Apr, 2012 05:25 PM
08 May, 2012 08:34 PM
02 May, 2012 11:13 PM