Twitter Ads API Authentication and Authorization

oauth

#1

Hi,

I have one clarification regarding authentication and authorization for API Call. Please clarify

For every API call, we need consumer key, consumer secret, access token and secret token.

I have my consumer key and consumer secret. Using that am calling “https://api.twitter.com/oauth/request_token” this api and get response like both secret token and access token.

Now when i use these access token and secret token for other API calls like create campaign etc… getting “401:Authorization Required”

Am i missing anything here?

Thanks,


#2

POST oauth/request_token returns an anonymous request token that isn’t authorized to access anything yet. You need to finish the authorization flow by sending a user to twitter.com and then exchange the request token for an access token with POST oauth/access_token.