Authentication

For this we will send a simple post request via curl.

curl -X POST https://api.pontiac.media/auth -d ‘{“auth”:{“userName”:”user1″, “password”:”myPassword”}}’

Response:

{

   “timestamp”:”Tue Aug 04 18:55:27 UTC 2020″,

   “response”:{

      “userId”:2342,

      “seatId”:1000,

      “authToken”:”eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzZWF0SWQiOjI3MDIsInVzZXJJZCI6MzU1LCJleHBpcmVzIjoiMjAyMC0wOC0SDsawMjo1NToyNyJ9.d6gUDLA_Yx_Em5REoathACFMPcfv1TgL8B87P19q7yA”,

      “expiration”:”2020-08-05T02:55:27″,

      “userName”:” user1″,

      “revType”:”costPlus”,

      “seatLoginCount”:171,

      “userLoginCount”:158,

      “funded”:1,

      “isAdmin”:0,

      “appVersion”:”1.14.0.43abcc29″,

      “passwordChanged”:1,

      “userRole”:”user”

   

}

}

 

The token received in the field authToken is to be passed in on all subsequent requests as a header called “auth”.

 

For example, the following is a get request for an existing advertiser:

curl -X GET -H ‘auth: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzZWF0SWQiOjI3MDIsInVzZXJJZCI6MzU1LCJleHBpcmVzIjoiMjAyMC0wOC0SDsawMjo1NToyNyJ9.d6gUDLA_Yx_Em5REoathACFMPcfv1TgL8B87P19q7yA’  ‘https://api.pontiac.media/pontiac/advertiser?advertiser-id=1234’

 

Response:

{

   “timestamp”:”Tue Aug 04 19:07:09 UTC 2020″,

   “response”:{

      “Advertisers”:[

         {

            “pontiacAdvertiserId”:2923,

            “name”:”testAdvertiser.”,

            “status”:1,

            “seatId”:1000,

            “insertionOrdersEnabled”:1,

            “gdprEnabled”:0,

            “politicalContentEnabled”:0,

            “hasProfile”:1

         

}

]

},

   “accountStatus”:1,

   “seatId”:1000

}