{"errors":[{"code":32,"message":"Could not authenticate you."}]}

webhooks

#1

I’m not able to register the webhooks for the account activity api
it returns me error
“{“errors”:[{“code”:32,“message”:“Could not authenticate you.”}]}”

All the access token are proper with read,write,direct message access.
The app is also subscribe with development environment

Revert with solution


#2

Are you registering the webhook (app-only Auth) or are you attempting to subscribe an account on a registerered webhook *user auth)?


#3

i’m registering the webhook(app-only Auth) all environment variable and access token are proper still am unable to perform webhook registration


#4


#5

If it is bad authentication (error 32) before it hits the webhook, then you should check to make sure that you have done the following. This information and more is located in our troubleshooting doc:

  1. you are using the proper auth keys that you pulled from the Twitter app that is designated as your AAAPI dev environment. Since this endpoint requires user auth, you will need to use both your consumer keys and access tokens.
  2. you have properly generated the oauth nonce, oauth_signature, and oauth_timestamp for your request.

If you have properly set up your Twitter app, then chances are that you aren’t handling number two properly. If so, please consider using an oauth library (example), one of our github repositories (account-activity-dashboard or twitter-webhook-boilerplate-node), using Insomnia, or try using Twurl.


#6

TwitterAPIExchange Object

(

[oauth_access_token:TwitterAPIExchange:private] => ACCESS_TOKEN

[oauth_access_token_secret:TwitterAPIExchange:private] => ACCESS_SECRET

[consumer_key:TwitterAPIExchange:private] => CONSUMER_KEY

[consumer_secret:TwitterAPIExchange:private] => CONSUMER_SECRET

[postfields:TwitterAPIExchange:private] =>

[getfield:TwitterAPIExchange:private] =>

[oauth:protected] => Array

(

[oauth_consumer_key] => CONSUMER_KEY

[oauth_nonce] => 1543377984

[oauth_signature_method] => HMAC-SHA1

[oauth_token] => ACCESS_TOKEN

[oauth_timestamp] => 1543377984

[oauth_version] => 1.0

[oauth_signature] => 7UJCR5ZPgImUVcHifcg1d8eqO20=

)

[url] => https://api.twitter.com/1.1/account_activity/all/devweb/webhooks.json?url=https%3A%2F%2Fwhatabot.biz%2Fwebbot%2Fweb%2Fext_api%2Ftwitter_main.php

[requestMethod] => POST

[httpStatusCode:protected] =>

)

I’m using this above method please check if anything is wrong. I have not shared my access keys in this reply since i can’t make it public


#7

My guess is that you are not properly generating your oauth nonce , oauth_signature , and oauth_timestamp. Have you considered using a tool like this? https://twitteroauth.com/