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

心不动则不痛 提交于 2019-12-01 04:24:16

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/28391359/what-is-callback-url-in-instagram-api-and-how-to-can-i-implement-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!