Hi,
I’m setting up a DM bot with the “new” Account Activity API, and have my webhook working receiving and sending messages without any problems.
Next I would like to see the number of subscribed accounts of the webhook, which should only be 2 at this time, but I cannot seem to construct the request correctly.
I keep getting this response:
{“error”:{“message”:“Unauthorized: This application is not authorized to use this endpoint.”,“sent”:“2018-06-01T02:01:15+00:00”,“transactionId”:“none”}}
From this request:
curl -X GET --url http://api.twitter.com/1.1/account_activity/subscriptions/count.json --header ‘Authorization: Bearer AAAAAAAAAAAAAAAAAAAAALsy6QAA…’
I generated the bearer token with @andypiper’s neat little script [1].
It’s my only application and my only endpoint, so weird that the app doesn’t have access to the endpoint or what am I missing?
App id: 15282875
Thanks!
Bent
[1] https://gist.github.com/andypiper/32bdb4c7f0b8d65385fc7c8fa3988083#file-oauth-app-only-sh
[My own follow-up]
Ok, so I never got the above request to work but instead the subscription list seems to be working, which is just as fine.
Request:
curl -X GET --url https://api.twitter.com/1.1/account_activity/all/dev/subscriptions/list.json --header ‘Authorization:Bearer AAAAAAAAAAAAAAAAAAAAALsy6QAA…’
Gives:
{“environment”: “dev”,“application_id”: “15282875”,“subscriptions”:[{“user_id”:“992591882399178xxx”}]}
No idea still, why the count request is not working.
Just wanted to share the work-around, in case somebody else is stuck where I was…