UNAUTHORIZED_ACCESS - 401 Error - Authorization Required



This issue is similar to - UNAUTHORIZED CLIENT APPLICATION Error - Bad Application Setup

Our Application Id (API key) is already white listed by twitter and
Our application can access the OAuth Apis and successfully create a
user token/secret.We cannot access the Ads API and we try to hit an
tailored_audiences API endpoint we got the following response

  • status code::401:::Authorization Required
    {“errors”:[{“code”:“UNAUTHORIZED_ACCESS”,“message”:“This request is not properly authenticated”}],“request”:{“params”:{}}}

Twitter team suggested to develop it on sandbox and we are able create sandbox account successfully. But we are unable to access tailored_audiences API. I tried it on sandbox also.

https://ads-api-sandbox.twitter.com/0/accounts/account_id/tailored_audiences (Tried with sandbox account id and as well as ads account id), nothing seems to be working.

Can someone help me to find out what is wrong and solution?

Owner Id: 2775375747
Application Id : 9102307
Ads Account Id : 18ce546f2hx

Please let me know if any other details required.



You might find this FAQ helpful in trying to figure out what’s going wrong.

We highly recommend you use twurl and/or one of our officially supported SDKs when making requests and trying to figure out what’s happening. You can then share with us the relevant code you are making use of so we can help you more effectively!