Open smithjessk opened 8 years ago
It's due to a problem in the postCustomApiCall, see #37
Here's my working code:
const path = require('path');
const config = require('../data/twitter_config.json');
const TWITTER_BASE_URL = 'https://api.twitter.com/1.1';
const Twitter = require('twitter-node-client').Twitter;
const twitter = new Twitter(config);
//Callback functions
const error = function (err, response, body) {
console.log('ERROR [%s]', JSON.stringify(err, null, 2));
};
const success = function (data) {
console.log('Data [%s]', data);
};
twitter.doPost(`${TWITTER_BASE_URL}/direct_messages/new.json`, {
user_id: '123456',
text: 'This is easy.'
}, error, success);
Still not work with code from @kevin-smets :(
I believe that this is an OAuth implementation problem because this task works correctly when done with twitter.
I know that the tokens, etc. are correct because I used them to properly view my direct messages.
Error:
Source: