How to get account Id/AppID whitelisted?

api-access
ads
api

#1

Hi,

We recently got approval for Ads API for company account (johnhancockusa) and I am trying to run example code provided attwittterdev-github but it throws following error -

twitter_ads.error.Forbidden: <Forbidden object at 0x3184b20 code=403 details=[{‘code’: ‘NOT_FOUND’, ‘message’: ‘Account 532566678 was not found’}]>

Upon researching a bit, looks like account-id/ AppId need to be whitelisted.

Can someone please guide me how to get ID whitelisted?
App ID is : 5922392
Account ID is : 532566678

Thank you,
@pushkr


#2

Thanks for reaching out, @Pushkr.

It looks like the account ID is incorrect. Making a request to the GET accounts endpoint will get you a list of the ads account the authenticated user has access to. (We highly recommend you use twurl for debugging purposes.)

twurl -H ads-api.twitter.com "/2/accounts"
{
  "request": {
    "params": {}
  },
  "next_cursor": null,
  "data": [
    {
      "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": "2017-09-24T21:49:51Z",
      "business_id": null,
      "approval_status": "ACCEPTED",
      "deleted": false
    }
  ]
}

In this example, I have access to the following ads account: 18ce54d4x5t. (Note: ads account IDs are base-36 values.)

Please let us know if this helps. Thanks!


#3

Awesome! Thank you very much @juanshishido . This helped me .