-
Notifications
You must be signed in to change notification settings - Fork 10
Description
The Taboola Backstage API documentation notes:
Reading, creating or updating Campaigns is only possible when the
[account-id]references an Account withADVERTISERin itspartner_typesfield. Trying to send a request with a non-Advertiser Account will result in a404 Not Foundresponse.
Empirically, the campaigns endpoint actually only returns a 404 if a specific Campaign is requested with such an Account (non-Advertiser).
$ curl "https://backstage.taboola.com/backstage/api/1.0/<non-advertiser-account-id>/campaigns/<campaign-id>" -H "Authorization: Bearer $BEARER_TOKEN" | jq .
{
"http_status": 404,
"message": "Resource not found"
}
Requesting the list of all campaigns for such an Account will return 200 with an empty result set:
$ curl "https://backstage.taboola.com/backstage/api/1.0/<non-advertiser-account-id>/campaigns" -H "Authorization: Bearer $BEARER_TOKEN" | jq .
{
"results": []
}
Users of the Tap may not realize that their Taboola Account doesn't have the ability to query for Campaign objects. For non-Advertiser Accounts, it appears as though the Tap is failing to retrieve Campaign data, when this is actually normal behavior for some Accounts.
Here are a couple possible solutions:
A. When there are no results from the Campaign listing endpoint, log an enlightening warning
B. Use the /backstage/api/1.0/users/current/allowed-accounts endpoint to get the list of accounts, and determine whether or not the config-provided Account ID has the ability to get Campaign data. Log a warning if it doesn't