An API, or Application Programming Interface, is a set of defined rules that allow two or more software programs to communicate with each other. Advertisers can use the API to create and manage ad campaigns, while publishers can use it to manage sites and spots.
The API provides all the functionality available to users in the admin.trafficstars.com web interface, as well as several additional features that simplify working with large amounts of data and entities.
Advertisers can use APIs to
Manager campaigns targeting
Set custom prices for spots in ad campaigns
Pause, launch, and edit ad creatives
Publishers can use APIs to:
Create, edit, and view sites (applications)
Create, edit, and view spots on sites
How to start using the API:
#1 Generate an API key in your client profile . The received token is an offline token in OAuth 2.0 terminology.#2 To obtain a session API token, you need to use the Auth by the offline token method.
Request:
Response:
The two fields we are interested in in the response are access_token and refresh_token.
access_token is a token for the current session. It will be used to authorize all subsequent requests. It is valid for expires_in seconds (by default, one day).
refresh_token can be saved in your system and used multiple times to get a new access_token.
The received access_token can be used for requests to the API as a Bearer token.
For example, to get your account balance:
Request:
Response:
Done! Now you can continue working with any of our API methods!