Skip to content

Better messaging re: non-Advertiser Taboola Accounts #1

@bi1yeu

Description

@bi1yeu

The Taboola Backstage API documentation notes:

Reading, creating or updating Campaigns is only possible when the [account-id] references an Account with ADVERTISER in its partner_types field. Trying to send a request with a non-Advertiser Account will result in a 404 Not Found response.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions