Using Account Activity API

webhooks
oauth

#1

Hi everyone,

I’m getting:

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

while trying to create a webhook using https://api.twitter.com/1.1/account_activity/webhooks.json.

  • My app has Read, Write and Access direct messages permissions.
  • I regenerated the token after changing the permissions and I’m using the new one.
  • My webhook handler does not gets any hit

I’m using this script(create-webhook-config.js from twitter-webhook-boilerplate-node):

var request = require('request')

// twitter authentication
var twitter_oauth = {
  consumer_key: '0IuI...',
  consumer_secret: '18Be...',
  token: '2845...',
  token_secret: 'JcM...'
}

var WEBHOOK_URL = 'https://4ff464ad.ngrok.io'


// 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)
})

Problem accessing account_activity web hooks
#2

Have you been granted access to the Account Activity API by using one of the links at https://developer.twitter.com/en/docs/accounts-and-users/subscribe-account-activity/overview and providing your application ID from apps.twitter.com in the form?


#3

Hi Andy, Thanks for response.

Yes, I’ve been granted access for 30-days trial premium access and I’ve set the app from https://developer.twitter.com/en/dashboard


#4

@andypiper I wanna ask you one question as this thread is relevant. Is Account Activity API: All Activities got the full set of activities includes Tweets, @mentions , Replies, Retweets , Quote Tweets , Retweets of Quoted Tweets , Likes, Direct Messages Sent , Direct Messages Received , Follows , Blocks , Mutes , Typing indicators and Read receipts ? ref: https://developer.twitter.com/en/products/accounts-and-users/account-activity-api.html
I was looking here and it says only direct messages, https://developer.twitter.com/en/docs/accounts-and-users/subscribe-account-activity/guides/receiving-events

FYI: I applied for getting the access.

Thanks


#5

Hi @0sman - the 30-day premium product you mentioned is a search product. Regardless, I do not see that you have a developer account set up with your @0sman handle. Are you using another @handle to access the developer portal?

@mnrahman I do not see that you applied for access to the All Activities version of the Account Activity API. Can you please be sure you apply here - https://developer.twitter.com/en/apply/user


#6

Hi KyleW, Thanks for your reply. I applied from our company twitter account which @cention. I’m really sorry to mention the account.
So basically if the application approved then we will get Account activity for all activities, right?

Thanks


#7

It looks like your account is pending - once the account is approved, we can help provision access to the Account Activity API. You will likely hear from someone about your application soon.


#8

@KyleW
We’re having the same issue with the API returning code 32, so we suspect that we don’t have access to the Account Activity API yet. But we’re also not able to apply:

When I click on https://developer.twitter.com/en/apply/user it redirects me to the Dashboard (https://developer.twitter.com/en/dashboard) and there it lists

  • Search Tweets: 30-Days / Sandbox
  • Search Tweets: Full Archive / Sandbox

Also can’t see any possibility besides those two at https://developer.twitter.com/en/account/subscriptions.

Is it true that this account has no access to Account Acitivity API?
Where else can we apply for Account Acitivity API?


#9

Hey @socialassiONE - It looks like the Account Activity API is not set up for your developer account. Which Client App would you like us to provide access for?


#10

For the App: “SocialHub by maloon” (5399622)

Thanks a lot!


#11

Hi @socialassiONE - we were able to provide access to the app you requested. Your environment name is: env-beta

Please be sure to check the documentation if you have any questions.


#12

Hello @KyleW
Can you please help in How do i know, whether i have access to Standard or Direct Message API thread…