Hello,
I have recently got an access to Webhook API. However, it is failing to connect with below exception.
Exception: {“errors”:[{“code”:32,“message”:“Could not authenticate you.”}]}
Have used below JS code & tried with POSTMAN as well.
My Twitter App: Ramesh_twitterApiTesting
Could you please check my access.
Thanks,
Ramesh
Just to clarify, you are substituting in your keys and secrets into the script correctly? (please do not post your keys and tokens here).
Hello Andy,
Thank You for your reply. Yes, I did substitute the keys in right place.
I tried with postman as well and got the same error. Please let me know if you need any other details to verify my webhook access.
Appreciate your support.
My Twitter App: Ramesh_tiwtterApiTesting
Thanks,
Ramesh.
@andypiper, Could you please help to resolve this issue.
Thanks,
Ramesh.
@rameshcg_info, you are receiving a general authentication error which is (usually) not related to API access but the validity or structure of your authorization.
If you get the same error with GET account/verify_credentials, then there is something wrong with the way you are providing keys and tokens. You can also try sending a simple DM with POST direct_messages/events/new to test your write access. Let us know how those are working, first.
@joncipriano, I have tried using both APIs(GET account/verify_credentials, POS direct_messages/events/new) and it is working.
- twurl & postman for verify_credentials.
- twurl for POST direct_messages.
However, I could get the same issue with webhooks.“Could not authenticate you.”
I have used below script with appropriate keys and callback url but no luck. Please let me know your thoughts. Could you please verify my access as well.
var request = require(‘request’)
// twitter authentication
var twitter_oauth = {
consumer_key: ‘’,
consumer_secret: ‘’,
token: ‘’,
token_secret: ‘’
}
var WEBHOOK_URL = ‘’
// request options
var request_options = {
url: ‘https://api.twitter.com/1.1/account_activity/webhooks.json’,
oauth: twitter_oauth,
headers: {
‘Content-type’: ‘application/x-www-form-urlencoded’
},
form: {
url: WEBHOOK_URL
}
}
// POST request to create webhook config
request.post(request_options, function (error, response, body) {
console.log(body)
})
Thanks,
Ramesh.
Can you provide your numeric app ID? You can find it in the URL of your app profile on apps.twitter.com. It will allow us to look up your app without knowing your consumer keys.
Example:
https://apps.twitter.com/app/6305153/show
@joncipriano, numeric appid=260843920
Below is the new error message that comes up after changing the webhook url.
{“errors”:[{“code”:200,“message”:“Forbidden.”}]}
Could you please let me know if you need any other details.
Thanks,
Ramesh.
KyleW
#12
Hi @rameshcg_info - we were able to see that you created a developer account and it was approved! We went ahead and provisioned access to the Account Activity API. Your environment name is: env-beta
Please give this another try now that the environment is set up.
@rameshcg_info, one additional note. The scripts in your original post are meant to work with the earlier DM only version of the beta. You may need to modify the URLs in those scripts to work with these endpoints.
1 Like
Thank You @joncipriano,@kyleW & @andypiper for helping to resolve it. It is working now!!!.
Cheers, Ramesh.
2 Likes
Hi, I am facing the same issue with the account_activity api, can you let me know how this can be resolved?
LeBraat
#16
@Codesigma_IN - Please make sure to read our troubleshooting guide first, then if you are still experience issues, please make sure to include additional information about your specific situation… ie your request, etc.
1 Like
@LeBraat I have used below script with appropriate keys and callback URL. Please let me know your thoughts. Could you please verify.
LeBraat
#18
Is your dev environment called :dev?
I don’t believe we permit : in our URIs. Try removing that and giving it another go.
Thank You @LeBraat for helping to resolve it. It is working now.
1 Like