0

I am trying to create an ads account on the twitter sandbox api.

I first retrieve a request token and convert that request token into an access token, so I think my signature and parameters are correct.

I run the following code:

r = requests.post(url, data={'name': 'Name'},headers={'Authorization': DST})

url = 'https://ads-api-sandbox.twitter.com/3/accounts/'

DST = OAuth oauth_consumer_key= "nlrp3r8PZyct2o7I6SYPx4ee1", oauth_nonce= "oDOXc9WD8SqZNfAp3Iw2B9Qzt0EMOSO2", oauth_signature= "nlC6adCN1yyYPMBflpIvrx74DOQ%3D", oauth_signature_method= "HMAC-SHA1", oauth_timestamp= "1535721065", oauth_token= "2361748680-b2CoGZyg1AHT65LrWQLHVyBiTryG5Ej7BKMaw9f", oauth_version= "1.0",

the response code is 401 with the following text:

{"errors":[{"code":"UNAUTHORIZED_ACCESS","message":"This request is not properly authenticated"}],"request":{"params":{}}}

I have tried with and without the data in the request.

I mainly used the following resources:

jalazbe
  • 1,801
  • 3
  • 19
  • 40
  • Does your Twitter account have access to the Ads API? You need to have applied for access. See the Getting Started section here https://developer.twitter.com/en/docs/ads/general/guides/getting-started – Andy Piper Aug 31 '18 at 14:52
  • 1
    I have the same error. I can get info from Ads API but I can't POST. Did you find a solution? – IgorAlves May 03 '19 at 16:52
  • Does your application have write access? – osowskit Jul 16 '19 at 23:25

0 Answers0