Access to different Ads Account


#1

Hi,
we want to report our ads performance with data from the API.
We successfully linked our app to one of our ads accounts. Since we manage multiple accounts for different clients we actually need to access every ad account.
We created the app with the same account as we access the ads manager UI. Based upon our understanding we should not have any problems at all, but there seems to be a missing link.
Any help is appreciated.
Thanks and BR,
Jonas


#2

Thanks for the question, @CROSSMEDIA_DUS. Glad to hear you are interested in using the Ads API to retrieve performance data.

When making a request to the Ads API, you need four pieces of information as you know:

  • app-specific
    • consumer key
    • consumer secret
  • user-specific
    • access token
    • access token secret

The first set is associated with the app and the second with the user. (To clarify, when I say “user” I’m referring to the Twitter @handle.) It sounds like you’ve already authenticated a user—the same user you use to access the ads manager UI—which is great.

When you make a request to the GET accounts endpoint, you will see all of the ad accounts the authenticated user has access to. This will be (1) the ads account the user owns and (2) any ads accounts that have granted access to the authenticated user. For example, I’m authenticated as @juanshishido and I see the following when I making a request to GET accounts:

$ twurl -H ads-api.twitter.com "/3/accounts"
{
  "request": {
    "params": {}
  },
  "next_cursor": null,
  "data": [
    {
      "name": "Juan Shishido",
      "business_name": null,
      "timezone": "America/Los_Angeles",
      "timezone_switch_at": "2016-07-06T07:00:00Z",
      "id": "18ce54aymz3",
      "created_at": "2016-04-08T03:36:02Z",
      "salt": "1def870c146c80dc70e798edf3fdfbfc",
      "updated_at": "2018-04-05T04:43:40Z",
      "industry_type": null,
      "business_id": null,
      "approval_status": "ACCEPTED",
      "deleted": false
    },
    {
      "name": "API McTestface",
      "business_name": null,
      "timezone": "America/Los_Angeles",
      "timezone_switch_at": "2016-07-21T07:00:00Z",
      "id": "18ce54d4x5t",
      "created_at": "2016-07-21T22:42:09Z",
      "salt": "54cb7b5a34183f77d82dd6d0f4329691",
      "updated_at": "2018-04-10T19:23:24Z",
      "industry_type": null,
      "business_id": null,
      "approval_status": "ACCEPTED",
      "deleted": false
    }
  ]
}

The ads account I own is 18ce54aymz3, but I also have access to 18ce54d4x5t. These are the only ads accounts I can operate on.

Since we manage multiple accounts for different clients we actually need to access every ad account.

For this, we recommend that partners obtain each user’s OAuth tokens. This will follow the same 3-legged OAuth flow you’ve already implemented and successfully used. This is how you authenticated the user you use to access the ads manager UI.

If the way you’re set up doesn’t allow for this, you can ask the ads accounts to grant you—the authenticated user—access. This can only be done via the Twitter UI at ads.twitter.com. (That is how I got access to 18ce54d4x5t.)

To summarize, the two options for gaining access to an ads account are:

  1. Obtain the OAuth tokens
  2. Have the ads account grant you access

Note: Because most rate limiting happens at the token-level, if you use the second option, the rate limit allocation is shared.

For more information see our Obtaining Ads Account Access page.

Hope this helps clarify.

Thanks!


#3

Hello Juan,

we’ve found that we had applied for Ads API access with the wrong account and therefore couldn’t access it with this one.

We’ve now reapplied for Ads API access with this account last Friday and are still awaiting confirmation. Is there a way for you to check our application’s progress?

Thank you,
Alexander