Subscription to Account Activity API

account-activity

#1

Hi,
we are using premium account activity API. While adding subcriptions or removing subscriptions, we are getting an error with error code 131 and it is not consistent too. Sometime the subscription happens successfully and sometimes it throws 131 error. Could you please help us why this error occurs and ways to prevent it.
“error”:{“errors”:[{“message”:“Internal error”,“code”:131}]}.


#2

Hi @fd_social - could you share how you’re creating these requests to the API?


#3

Hi @Hamza

We have configured dev environment in our account, registered a webhook with necessary url and making a post request to the endpoint https://api.twitter.com/1.1/account_activity/all/:env_name/subscriptions.json with the respective “env_name” to add subscriptions. We are under premium tier of Account Activity API

A brief implementation is something like below,

var request_options = {
uri: ‘https://api.twitter.com/1.1/account_activity/all/:env_name/subscriptions.json’,
oauth: {
consumer_key: consumerKey,
consumer_secret: consumerSecret,
token: accessToken,
token_secret: secretToken,
},
}

request.post(request_options)
.then(response => {
console.log(true);
})
.catch(error => {
console.log(error);
});

Similarly delete call for delete the subscription.