twitter-webhooks
twitter-webhooks copied to clipboard
Error: Webhook URL must be defined to create subscriptions.

1 . Already port forward to allow twitter access localhost .
2 . Result still same , still return webhook URL must be defined .
3 . {"response_token":"sha256=mD1umRhw7hasLluWUzid0zYDCWQbBmbWrNAUx5T4Z/o="}
I successfully generate crc , somehow still stuck at Webhook URL muse define .
Hi,
I think it’s because you didn’t call userActivityWebhook.register();
before creating subscriptions. If you don’t call this method, Twitter will not be aware of your server URL and cannot send notifications on your webhook
Hi @super-ienien , thanks for reply , actually I also already call userActivityWebHook.register() ;
Here the snippets -
//Register your webhook url - just needed once per URL
const userActivityWebhook = twitterWebhooks.userActivity({
serverUrl:process.env.URL,
route: '/webhooks',
consumerKey: process.env.CONSUMER_KEY,
consumerSecret: process.env.CONSUMER_SECRET,
accessToken: process.env.ACCESS_TOKEN,
accessTokenSecret: process.env.ACCESS_TOKEN_SECRET
environment: "develop",
app
});
userActivityWebhook.register();
//Subscribe for a particular user activity
userActivityWebhook.subscribe({
userId: process.env.USER_ID,
accessToken: process.env.ACCESS_TOKEN,
accessTokenSecret: process.env.ACCESS_TOKEN_SECRET
})
.then(function (userActivity) {
userActivity
.on('favorite', (data) => console.log (userActivity.id + ' - favorite'))
.on ('tweet_create', (data) => console.log (userActivity.id + ' - tweet_create'))
});
For the server url , I already port forward it to ensure twitter can access It . I could get the response_token , and after that it will trigger the error related to web hook .
Same issue. Anyone found any solution?
Same issue ... solution found in 2022 ?
Hello, I will look into it this week