Unable to connect to Ads API with whitelisted app and correct credentials. Connecting via Nodejs twitter-ads

nodejs
oauth
error-codes

#1

Hi,

I’m new to twitter ads api, i’ve read through the documentation and as far as I’m aware I’m doing everything correctly.

I’m trying to connect to the ads api via the npm package ‘twitter-ads’ https://github.com/FallenTech/twitter-ads

I’ve confirmed that my app is whitelisted. However when i try and connect i receive the error

code: ‘UNAUTHORIZED_CLIENT_APPLICATION’,
message: ‘The client application making this request does not have access to this API’

I’m running the code from my local Ubuntu box.


#2

It’s probable that the twitter-ads package is not using your token to do the request. Please double check that it’s using the same token you are using to confirm that your app is whitelisted. If you haven’t yet, I would attempt to test against the API with twurl before you try to use the SDK. OAuth issues are difficult to debug so we would strongly recommend to either mimic what twurl does or find a library that is working for you.

Thanks,

John


#3

Thanks @JBabichJapan , I’ve tried authentication with twurl (following these instruction https://github.com/twitter/twurl .

Using ‘twurl authorize’ i received the following error:

Authorization failed. Check that your consumer key and secret are correct, as well as username and password.

I’ve checked that all the credentials i’m using are correct


#4

twurl is generally well tested and hasn’t changed for a long time, so I am pretty sure that the problem would have to be with one of those things it mentions to check. If you need to, you can try setting up a new App ID at apps.twitter.com and test the REST API just to go through the OAuth workflow with a different account and token.


#5

@JBabichJapan The rest API works with the current app. I only have issues with twitter ads api.