Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is callback url in instagram api and how to can I implement it

Hi I'm beginner programmer

I'm trying to use instagram's realtime Photo Updates api

My purpose is use this API CONSOLE's subscription method
https://apigee.com/console/instagram

But I can't understand and handle callback url

What is the callback url's function?

And How can I implement the callback url?

like image 278
user4315272 Avatar asked Feb 08 '15 06:02

user4315272


People also ask

How do I use callback in API?

Create or open a workflow and select the Call an API action. Select a Request type of POST or PUT . Check the box labeled Add an API callback. Configure the rest of the fields as needed, then click Save.

What is a callback URL?

A callback URL is an address that a server provides, and any computer in the Internet/private network can POST data to it. This method is more efficient than a computer continuously waiting or polling for data.


1 Answers

The "callback url" (also referred to as redirect_url), is the URL Instagram will send users to after they have logged into Instagram, and authorized your application to read their data.

This is part of the OAuth 2 Spec, which Instagram (and many others) use to control access to their API.

The short version of the OAuth 2 "flow" is this:

  • You send a user to Instagram's page with your application ID, and a redirect URL.
  • The user logs into Instagram on their page and authorizes your application.
  • Instagram will then send the user back to your application (using the redirect URL value), along with a token that you can use to access their data.

GitHub has an excellent guide to how OAuth works on their server, which you will find very similar to Instagram's.


So the "callback url" should be set to the URL of your application server. For example, http://myapp.com/auth. Or, if you are working locally, you would use http://localhost:3000/auth.

Note: With Instagram (as well as most other APIs), the callback URL is permanently set when you register your client. So you'll often have to create separate clients for your live server, and your local one.

like image 71
Steven Schobert Avatar answered Nov 09 '22 07:11

Steven Schobert