Could not access Ads API with UNAUTHORIZED_ACCESS error

oauth

#1

My application ID is 6957762.
I have received the email which shows the ads access has been approved for my APP.

I have tried to access the following API:
https://api.twitter.com/1.1/account/verify_credentials.json
With header:
Authorization OAuth oauth_version=“1.0”, oauth_consumer_key=“xxx”, oauth_token=“xxx”, oauth_timestamp=“1500587019”, oauth_nonce=“xx”, oauth_signature_method=“HMAC-SHA1”, oauth_signature=“xx”

everything is fine. I could get a correct response:
my twitter account Id is :
“id”: 3082789737,
“id_str”: “3082789737”,

Then, I am trying to access the following ads api
https://ads-api.twitter.com/2/stats/accounts/3082789737
with the same header
I get the following error:
{
“errors”: [
{
“code”: “UNAUTHORIZED_ACCESS”,
“message”: “This request is not properly authenticated”
}
],
“request”: {
“params”: {}
}
}

Please let me know if I miss anything here.
Any suggestions are welcome!


Guidance for UNAUTHORIZED_ACCESS issues
#2

The oauth_signature cannot be the same for both calls. The signature is an encrypted string that includes the URL being called. I suspect that may be the issue. Have you tried twurl?


#3

@SimplrConnector: This is very likely due to an issue with the oauth_signature. Please see this post for additional details.