Hi There,
I’m trying to create a webhook using Ruby and Faraday library. Here’s my request:
# client
# => #<Twitter::REST::Client:0x007fd7c19015f0
# @access_token="token is here",
# @access_token_secret="secret is here",
# @consumer_key="key is here",
# @consumer_secret="secret is here">
headers = Twitter::Headers.new(client, :post, 'https://api.twitter.com/1.1/account_activity/webhooks.json')
Faraday.post do |req|
req.url('https://api.twitter.com/1.1/account_activity/webhooks.json', url: 'http://127.0.0.1/webhooks/twitter')
req.headers['Authorization'] = headers.oauth_auth_header.to_s
end
As far as docs go - this should work. However I get {"errors":[{"code":32,"message":"Could not authenticate you."}]} response 
this is my request when executed:
#<struct Faraday::Env
method=:post,
body="{\"errors\":[{\"code\":32,\"message\":\"Could not authenticate you.\"}]}",
url=#<URI::HTTPS https://api.twitter.com/1.1/account_activity/webhooks.json?url=http%3A%2F%2F127.0.0.1%2Fwebhooks%2Ftwitter>,
request=
#<struct Faraday::RequestOptions params_encoder=nil, proxy=nil, bind=nil, timeout=nil, open_timeout=nil, boundary=nil, oauth=nil>,
request_headers=
{"User-Agent"=>"Faraday v0.9.2",
"Authorization"=>
"OAuth oauth_consumer_key=\"secret info here\", oauth_nonce=\"secret info here\", oauth_signature=\"secret info here\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"info here\", oauth_token=\"secret info here\", oauth_version=\"1.0\"",
"Content-Length"=>"0"},
Getting desperate. Please Help!
PS:
I have applied for access for two of my applications and got response from twitter saying "Great news! We’ve granted you beta access to the Account Activity API. The app ID you submitted in your application now has the ability to access the webhooks."
A bit worried that I put two application ids in the form (app_id & app_id) instead of one. Can this be a issue?