paint-brush
[InstagramAPI] Set up Nodejs OAuth server in 3 Stepby@peterchang_82818
1,829 reads
1,829 reads

[InstagramAPI] Set up Nodejs OAuth server in 3 Step

by April 30th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

As a developer, setting up everything on InstagramAPI takes more time than Facebook GraphAPI(I love Facebook), as the reason:

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - [InstagramAPI] Set up Nodejs OAuth server in 3 Step
 HackerNoon profile picture

As a developer, setting up everything on InstagramAPI takes more time than Facebook GraphAPI(I love Facebook), as the reason:

  1. public content is required access_token
  2. public content is required a verified account (not sandbox)
  3. a whitelisted Oauth server is required, to verify account and get access_token (Facebook requires only APP_ID and APP_SECRET but not a server, to get ACCESS_TOKEN by HTTP GET)

The Git is a template also a tutorial to setting up a Node.js server, for Intagram-API OAuth purpose.

Everything we do is simple, wire up the config between Instagram and Node.js server, with the right setting, getting access_token is easy, which is used in every Intagram-API request as a compulsory parameter.

1. Create an Instagram Application

Create IG Application in the portal, fill every we need to, and done.

2. Wiring IG APP and Node.js Server

(Node.js tempalte on Git)

After IG application is created, configuring ClientID, ClientSecret and redirectURL are the next, because IG-API does require added access_token for any API request.

remark:

Below are the two URLs needed to add on **_Valid redirect URIs_**

http://youhost/authorize_user

and

http://youhost/handleauth

3. GET access_token

https://www.instagram.com/oauth/authorize?client_id={CLIENT_ID}&redirect_uri={http://youhost/authorize_user}&response_type=code

Press Authorize

Like this story? It is helpful to others? It helps me know if you’d like to see write more about his topic and helps people see the story, when tap the heart below.

Reference:

https://www.instagram.com/developer/authentication/

https://www.npmjs.com/package/instagram-node

https://github.com/wahengchang/instagram-oauth-nodejs-server