LiteSwitch API

API Authorization

To connect to LiteSwitch using its API, use the following steps.

  • Make sure you have API account permissions. If you don’t, please contact your account manager.

  • Using your LiteSwitch UI credentials, get your API token by making a POST request to the LiteSwitch authorization endpoint.

  • Pass this token in your request header Authorization:Bearer ${TOKEN}

Temporary and Refresh Tokens

To get a temporary auth token for your integration, use the following steps.

  • Make a HTTP POST request to the auth endpoint.

  • The response will contain your access token, its expiration time, and refresh token. You can use the access token to perform API requests until the token expires.

  • Refresh tokens should be used in long-running applications. To extend your session once your access token expires, get a new access token and a new refresh token using the prior refresh token (possibly multiple times).

Auth Token POST Details

Endpoint Info

Description

endpoint

https://iam.bidswitch.com/auth/realms/bidswitch/protocol/openid-connect/token

Method

POST

headers

Content-Type and Accept {'Content-Type': 'application/x-www-form-urlencoded', 'accept': 'application/json'}

username

(Required) Your UI username

password

(Required) Your UI password

scope

The service to which your user token should grant you access, e.g. scope=openid email profile

Example Using Curl
curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' -H 'accept: application/json' -d 'client_id=public-client&grant_type=password&username={username}&password={password}&scope=openid email profile' 'https://iam.bidswitch.com/auth/realms/bidswitch/protocol/openid-connect/token'

Getting List Of Suppliers

To view the list of available Suppliers, GET the following endpoint:

/api/lsw/ssp/

Creating a Buyer

To create a new Buyer, POST the details to the following endpoint:

/api/lsw/ssp/<id>/

Updating a Buyer

Currently the only edit available for Buyers is changing their status. To update a DSP status, PUT the details to the following endpoint:

/api/lsw/ssp/<id>/

Only the dsp_seats.is_active request field can be edited, refer to the POST/PUT Request Example block.

Updating a Data Center

Currently the only edit available for a data center is changing their status. To update a data center status, PUT the details to the following endpoint:

/api/lsw/ssp/<id>/

Only datacenters.is_active and datacenters.client_qps fields can be edited, refer to the POST/PUT Request Example block.

Warning

The value of the datacenters.client_qps field cannot exceed the summed up value of dsp_seats.qps.value fields for the same data center

POST/PUT Request Example

"name":"freewheel",
"name_external":"Freewheel",
"dsp_seats":[
    {
         "name":"seat1",
         "is_active": true,
         "qps": [
         {
             "location": "Netherlands",
             "value": 10000
         },
         {
             "location": "Germany",
             "value": null
         }
      ]
   },
],
"datacenters":[
    {
         "location":"Netherlands",
         "client_qps":null,
         "is_active":true
    },
    {
         "location":"Germany",
         "client_qps":null,
         "is_active":true
    }
]