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

10,643

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.

Share:
10,643
user4315272
Author by

user4315272

Updated on June 09, 2022

Comments

  • user4315272
    user4315272 almost 2 years

    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?