javascript - Tumblr API - can GET but not POST -
i'm trying create page users can log in tumblr account , fill out form post blog.
i'm using hello.js tumblr module.
i've modified tumblr module demo , seems working in terms of logging in , authenticating. however, i'm unable convince api let me use oauth-restricted post commands. commands, such retrieving user's followed blogs, work fine. if try simple such user/follow follow new blog, "401 not authorized" response.
what causing oauth restricted commands working fine, post not?
you can see testing code live @ http://www.jereddanielson.com/testing/tumblr/hello.js-master/demos/tumblr.html
below pertinent javascript. i'm using oauth proxy @ https://auth-server.herokuapp.com/
function login(network){ hello( network ).login({scope: 'publish_actions, publish, post, post_actions, follow, follow_actions'}).then( function(r){ // followed blogs hello(network).api({path: '/user/following', method: "get"}).then(function(p){ console.log(p); console.log("tried retrieve followed blogs. response status: " + p.meta.status + " " + p.meta.msg); }); // try follow blog hello(network).api({path: '/user/follow', method: "post", data: {url: "daily-fractal.tumblr.com"}}).then(function(p){ console.log(p); console.log("tried follow blog. response status: " + p.meta.status + " " + p.meta.msg); }); }, function(e){ console.error(e); }); } hello.init({ 'tumblr' : "bqpjorkgiu9pwvann1hvoaow6gognospcmxipwjnqghumkwvgt" }, { redirect_uri:'../redirect.html', oauth_proxy: "https://auth-server.herokuapp.com/proxy" });
thanks.
Comments
Post a Comment