Quick Start

Public Routes

The API has a public status check endpoint which can be used without any credentials:

http

GET /v3/status HTTP/1.1
Host: api.adspert.net

curl

curl -i -X GET https://api.adspert.net/v3/status

httpie

http https://api.adspert.net/v3/status

python-requests

requests.get('https://api.adspert.net/v3/status')

response

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:

http

POST /v3/auth/token HTTP/1.1
Host: api.adspert.net
Accept: application/json
Authorization: Basic U2FNcExFMEtlWTpzQW1QbGUwU2VDckV0NDMyMQ==

curl

curl -i -X POST https://api.adspert.net/v3/auth/token -H "Accept: application/json" --user SaMpLE0KeY:sAmPle0SeCrEt4321

httpie

http POST https://api.adspert.net/v3/auth/token Accept:application/json -a SaMpLE0KeY:sAmPle0SeCrEt4321

python-requests

requests.post('https://api.adspert.net/v3/auth/token', headers={'Accept': 'application/json'}, auth=('SaMpLE0KeY', 'sAmPle0SeCrEt4321'))

response

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:

http

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

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..."

httpie

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..."

python-requests

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...'})

response

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.