Quick Start
Public Routes
The API has a public status check endpoint which can be used without any credentials:
GET /v3/status HTTP/1.1
Host: api.adspert.net
curl -i -X GET https://api.adspert.net/v3/status
http https://api.adspert.net/v3/status
requests.get('https://api.adspert.net/v3/status')
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": 200,
"message": "OK",
"data": null,
"meta": {}
}
But of course more interesting are authenticated endpoints which return some data.
Authenticated Routes
Get Your API Key
Log in to the Adspert Dashboard at https://www.adspert.de/dashboard, go to the API section of your user account settings. Create a key as documented on that page.
Request an API Token
Regular API interaction is authenticated with short-living API tokens. A token
can be created with a POST
request to
/v3/auth/token
,
using basic auth with an API key ID and secret:
POST /v3/auth/token HTTP/1.1
Host: api.adspert.net
Accept: application/json
Authorization: Basic U2FNcExFMEtlWTpzQW1QbGUwU2VDckV0NDMyMQ==
curl -i -X POST https://api.adspert.net/v3/auth/token -H "Accept: application/json" --user SaMpLE0KeY:sAmPle0SeCrEt4321
http POST https://api.adspert.net/v3/auth/token Accept:application/json -a SaMpLE0KeY:sAmPle0SeCrEt4321
requests.post('https://api.adspert.net/v3/auth/token', headers={'Accept': 'application/json'}, auth=('SaMpLE0KeY', 'sAmPle0SeCrEt4321'))
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": 200,
"message": "OK",
"data": {
"token": "433126ffa47f453c21f26d9f15ea11f5...",
"ttl": 7200
},
"meta": {}
}
Get Some Data
You can now interact with the API using the retrieved API token as a Bearer token in the Authorization header.
For instance, to get IDs and names of advertising accounts managed by Adspert:
GET /v3/accounts?include=adspert_account_id&include=account_name&sort_adspert_account_id=-1&limit=2 HTTP/1.1
Host: api.adspert.net
Accept: application/json
Authorization: Bearer 433126ffa47f453c21f26d9f15ea11f5...
curl -i -X GET 'https://api.adspert.net/v3/accounts?include=adspert_account_id&include=account_name&sort_adspert_account_id=-1&limit=2' -H "Accept: application/json" -H "Authorization: Bearer 433126ffa47f453c21f26d9f15ea11f5..."
http 'https://api.adspert.net/v3/accounts?include=adspert_account_id&include=account_name&sort_adspert_account_id=-1&limit=2' Accept:application/json Authorization:"Bearer 433126ffa47f453c21f26d9f15ea11f5..."
requests.get('https://api.adspert.net/v3/accounts?include=adspert_account_id&include=account_name&sort_adspert_account_id=-1&limit=2', headers={'Accept': 'application/json', 'Authorization': 'Bearer 433126ffa47f453c21f26d9f15ea11f5...'})
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": 200,
"message": "OK",
"data": [
{
"adspert_account_id": 837421736,
"account_name": "Ten Mare",
},
{
"adspert_account_id": 1193024,
"account_name": "Dolo Curet",
}
],
"meta": {
"pagination": {
"offset": 0,
"limit": 2,
"total": 12,
"sort": {
"adspert_account_id": -1
}
}
}
}
Explore
Check the Routes documentation for more things to do with the API.