xdevplatform / autohook

Automatically setup and serve webhooks for the Twitter Account Activity API
MIT License
152 stars 32 forks source link

Client application is not permitted to access this user's webhook subscriptions. #35

Closed yordis closed 4 years ago

yordis commented 4 years ago

(node:20122) UnhandledPromiseRejectionWarning: AuthenticationError: Client application is not permitted to access this user's webhook subscriptions. (HTTP status: 401, Twitter code: 348)

Expected behavior

The example code from the README should work

Actual behavior

It fails

Steps to reproduce the behavior

  1. Create .env.twitter file in your home directory

  2. Create a index.js file with the following content

const { Autohook } = require('twitter-autohook');

async function main() {
  const webhook = new Autohook();
  await webhook.removeWebhooks();

  webhook.on('event', (event) => console.log('Something happened:', event));

  await webhook.start();

  await webhook.subscribe({
    oauth_token: process.env.TWITTER_ACCESS_TOKEN,
    oauth_token_secret: process.env.TWITTER_ACCESS_TOKEN_SECRET,
  });
}

main();
  1. Run the app using node index.js

  2. The apps fails.

iamdaniele commented 4 years ago

Hi @yordis, I was able to successfully run this example using test credentials.

This looks like an authentication error, where the credentials in your .env.twitter do not match those of the app owner, or have been invalidated. Make sure you can make an OAuth 1.0a request (e.g. using Twurl) with the credentials you're using in .env.twitter.

yordis commented 4 years ago

@iamdaniele let me get back to this in few days, I will reset all the values and double-check

yordis commented 4 years ago

Got my computer, back, working on it again.