Still unauthorized to webhook, account activity api

account-activity

#1

Hello. I have a developer account and have filled out the form for access to the beta webhook account. Its been a couple weeks and I still dont have access. using twurl I’m testing with the instructions at the URL below. My app ID is 14813579


#2

I’m receiving twurl /1.1/account_activity/all/webhooks.json
{“errors”:[{“code”:200,“message”:“Forbidden.”}]}


#3

Did you receive an email indicating that your request for access was successful?


#4

Hi @andypiper

I’m having a very difficult time simply creating a webhook for the Account Activity API. I was approved on Jan 9.

Subsequently, I tried to create a webhook for the Account Activity API. I keep getting a 261 app cannot perform write actions. Or it says I’m not authorized. I got an email saying I was, I have the env-beta param, and I can’t understand why nothing works. I couldn’t have abused the API because I’ve never used it.

Please. I’m begging. Will someone please help me. I’ve been trying to contact you guys since January. It’s April. Please.

I’m just trying to create a webhook and GET an object. Any help here?

App ID 14633328

Cheers,

Cam Burley
@CodeCamCode


#5

Have you looked at the Account Activity API sample?


#6

Of course, I have.

But I don’t know why I’m getting a 261 response. Is this because I’m not authorized?


#7

If your app cannot perform write actions that would show up in the apps.twitter.com dashboard. I find it unlikely that this is the root issue here. Can you share the code you’re trying to use to create the webhook?


#9
 credentials = Base64.encode64("#{ENV["TW_CONSUMER_KEY"]}:#{ENV["TW_CONSUMER_SECRET"]}").gsub("\n", '')

      url = "https://api.twitter.com/oauth2/token"
      body = "grant_type=client_credentials"
      headers = {
        "Authorization" => "Basic #{credentials}",
        "Content-Type" => "application/x-www-form-urlencoded;charset=UTF-8"
      }
      r = HTTParty.post(url, body: body, headers: headers)
      bearer_token = JSON.parse(r.body)['access_token']

      api_auth_header = {"Authorization" => "Bearer #{bearer_token}"}
      url = "https://api.twitter.com/1.1/account_activity/all/env-beta/webhooks.json?url=https://echo-development.herokuapp.com/twitter/webhook"
      request = HTTParty.post(url, headers: api_auth_header)

#10

You’re asking for application-only auth here. This will not work for the Account Activity API, you need to provide user credentials via the three-legged Oauth flow.


#11

@andypiper I didn’t receive an email stating that the account activity was approved yet. However I did receive an email saying the general dev account was approved. I’ve filled out the account activity api request a couple of times now. What is the general turn around time for approval?

For me, I’d like to get ahead of this as quick as possible. Is there a reason the approval is delayed?

This is how I am testing:


C:\Users\rboha>twurl authorize --consumer-key xxxxxxxxxxxxx --consumer-secret x
Go to https://api.twitter.com/oauth/authorize?oauth_consumer_key=xxxxxxxxxxxxxxxxxxx&oauth_version=1.0 and paste in the supplied PIN
xxxxxxxxxx
Authorization successful

C:\Users\rboha>twurl /1.1/account_activity/all/webhooks.json
{"errors":[{"code":200,"message":"Forbidden."}]}
C:\Users\rboha>

#12

im logged in while making this call

While trying to create the webhook I have authorization and authentication from Twitter

user auth flow -> get app bearer token -> create webhook

am I missing something?

https://developer.twitter.com/en/docs/basics/authentication/api-reference/token


#13

unless your point is –

use this URL: “https://api.twitter.com/oauth/authorize?oauth_token=token

instead


#14

I really don’t understand what you’re telling me I need to do:

If I use the authorize URL instead of the authentication URL, it takes me to the login page and returns the exact same data as before. The oauth_token is the same. And, it returns a

{"errors":[{"code":89,"message":"Invalid or expired token."}]}

It seems like it needs a Bearer TOKEN. And, it’s not clear how that works with the authorize


#15

Thanks for hijacking my thread


#16

This may be my mistake - for the initial registration of the webhook it should be app-only, but for subscriptions per user, obviously user auth. Apologies.

You’ve definitely got the all activities beta approved rather than DM-only?

@raybohac you need to hit /1.1/account_activity/all/env-beta/webhooks.json instead I think.


#17

In both of your cases I strongly recommend plugging your App keys into https://github.com/twitterdev/Account-Activity-dashboard and seeing if things work there. I’ve been running that sample for a number of weeks now and it works for me.


#18

anytime!


#19

Darn didn’t work. I’ll try your other suggestion below…

C:\Users\rboha>twurl /1.1/account_activity/all/env-beta/webhooks.json
{"errors":[{"code":200,"message":"Forbidden."}]}

#20

I installed the account-activity-dashboard as suggested and the log still says forbidden. My account must not be configured yet. Any idea how to get that pushed forward?


///snip///
       href: 'https://api.twitter.com/1.1/account_activity/all/env-beta/subscriptions/list.json',
        req: [Object],
        ntick: true,
        response: [Circular],
        originalHost: 'api.twitter.com',
        originalHostHeaderName: 'host',
        responseContent: [Circular],
        _destdata: true,
        _ended: true,
        _callbackCalled: true },
     toJSON: [Function: responseToJSON],
     caseless: Caseless { dict: [Object] },
     read: [Function],
     body: '{"errors":[{"code":200,"message":"Forbidden."}]}' } }

#21

Unfortunately this is on a gradual onboarding basis during the beta period. What was the handle and app ID you requested access for?