tumblrwks - receiving 401 on Post


tumblrwks - receiving 401 on Post



I am able to post to Tumblr from an iOS app that I created and would like to do the same from a node.js app.



My initial test case is have a nodeJS app use the same consumerKey, consumerSecret, accessToken, and accessSecret values that are successful in the iOS app.



But, the node.js app, using tumblrwks, fails with a 401 error.



Note that I am able to get data using the node.js app, which does not require authentication.



I wonder if this is a valid test case, using the same credentials as the iOS app, or do I have to register the nodeJS app separately?



The nodeJS app will be used as part of a batch process, not having user interaction, which is why I would like to use the same credentials as the iOS app.



My thinking is to accept authorization from the user using the iOS app, save that authorization info to a database, which would be leveraged by the nodeJS Below is the sample code used for posting.



Any help would be appreciated.


const Tumblr = require('tumblrwks');

var tumblr = new Tumblr({
consumerKey: "******",
consumerSecret: "*****************",
accessToken: "******************",
accessSecret: "******************"
}, "********.tumblr.com"
);

tumblr.post('/post', {type: 'text', title: 'tumblrwkstesting', body: '<h3>should work!! </h3>'})
.then(json => {
console.log(json);
})
.catch(error => {
console.log(error);
});









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

How to make file upload 'Required' in Contact Form 7?

Rothschild family

amazon EC2 - How to make wp-config.php to writable?