The API accepts parameters sent in JSON format. Success or error in handling the request is signaled by the corresponding HTTP code of the returned response. HTTP code 200 indicates correct execution of the request, other codes indicate an error adequate to the reported code, such as HTTP 401 – authorization error.
Communication
The API can only be accessed using HTTPS at api.buybox.click.
Authorization
Each request requires authorization using the API * Key (APIkey)* and *APIsecret (APIsecret)*, which you can generate yourself within the administration panel. The authorization mechanism uses the X-BB-API-Authorization header, in which a sequence built according to the following pattern should be passed.
X-BB-API-Authorization: APIkey:signature
signature = HMAC-SHA1( APIsecret, UTF-8-Encoding-Of( stringToSign ) ) );
stringToSign = HTTP-VERB + " " + requestPath + "\n" + JSONPayload;
Important
The maximum number of updated records in one package is 200, while packages can be many.
The example of a query:
POST https://api.buybox.click/api/v1/campaigns/{campaignId}/offers
X-BB-API-Authorization: APIkey:signature
Content-Type: application/json
{
"offers":
[
{
"id":"1001",
"url":"https://offers.io/offer-1",
"price":9.90,
"available":true
},{
"id":"1002",
"url":"https://offers.io/offer-2",
"price":10.99,
"available":true
}
]
}
The Answer:
Content-Type: application/json {"result":"OK"}