I’m currently building an meteor app which should make use of the twitter API. Therefor I’m using the mrt:twit meteor package (https://atmospherejs.com/mrt/twit).
I have created an app at https://apps.twitter.com with my twitter account and I’m using my consumer_key, consumer_secret, oauth_access_token and oauth_access_token_secret within the meteor app.
What is working: I can query tweets and access all data available. I can also post tweets.
Whats not working: I cannot delete a tweet. I get this message:
{ [Error: Your credentials do not allow access to this resource]
message: 'Your credentials do not allow access to this resource',
statusCode: 403,
code: 220,
allErrors:
[ { message: 'Your credentials do not allow access to this resource',
code: 220 } ],
twitterReply: '{"errors":[{"message":"Your credentials do not allow access to this resource","code":220}]}' }
My code looks like this:
'deleteSingleTweet': function(tweet_id) {
Twit = new TwitMaker({
consumer_key: consumer_key,
consumer_secret: consumer_secret,
access_token: oauth_access_token,
access_token_secret: oauth_access_token_secret
});
const DeleteSingleTweetPromise = new Promise((resolve, reject) => {
Twit.get(`statuses/destroy/${tweet_id}`, function(err, data, response) {
if (err) {
reject(err);
} else {
resolve(data);
}
});
});
DeleteSingleTweetPromise
.then(data => {
console.log(data);
})
.catch(err => {
console.log(err);
});
}
Has anybody an idea what I'm doing wrong here?
Twit.get()when it should be apost.