can't create a sandbox account on twitter api

倖福魔咒の 提交于 2019-12-23 05:19:45

问题


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:

  • https://twittercommunity.com/t/sandbox-api-create-account-not-working/70442/4
  • https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/accounts#post-accounts

来源:https://stackoverflow.com/questions/52116748/cant-create-a-sandbox-account-on-twitter-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!