How to post Link to Tumblr’s API

Working with Tumblr’s API is fun and easy. Below steps will show you how to post link to Tumblr’s API. It is useful when you have a brand website or blog and you want to drive traffic to your website or blog. You can make an automation script to automatically submit your contents to Tumblr. We will be using Node.Js for the purpose.


You can also post photo to Tumblr using API from the link here.

Prerequisite

  • You have Node.Js installed on your machine
  • You have a Node.Js boilerplate. If not, you can generate one using command “express my-node-project”

Get Tumblr Keys and Tokens

Follow the steps below to get it-

  1. Register on the Tumblr site
  2. Visit Application Center to create an application in Tumblr workspace.
  3. Visit the OAuth applications page
  4. Click “Explore API” on the application you want to authorize
  5. Click the “Allow” button, which will take you to the API console
  6. Click the “Show keys” button, which will show you the credentials you can use to make signed requests.
  7. Also get the “Blog Name” from API Console itself.

Install Tumblr.js library

Next install the Tumblr library using command-

npm install --save tumblr.js

Create Tumblr client

var tumblr = require('tumblr.js');
var client = tumblr.createClient({
  consumer_key: '',
  consumer_secret: '',
  token: '',
  token_secret: ''
});

Paste Consumer Key, Consumer Secret, Oauth Token and Oauth Token Secret in above code.

Call Link Post API

const blogName = '';
const params = {
  title: 'Post Title',
  url: 'Post URL',
  thumbnail: 'url of your photo',
  description: 'Website title' // html string to be post as description
}
client.createLinkPost(blogName, params, function(err, resp) {
  console.log(resp); // your link post is submitted to tumblr successfully.
});

Conclusion

This blog post incorporated steps on how to post link to Tumblr using Node.Js API. Tumblr provides numerous APIs to play with. It is useful for the SMO of your brand / website.

Leave a Reply

Your email address will not be published. Required fields are marked *