How to register new client on Instagram API

只愿长相守 提交于 2020-01-11 08:39:09

问题


Hi I'm trying to create a new client_ID, but I don't have a website. I want a client_id, for learning purpose. When I try to create a new client, I get ask the following: Application Name: amb1s1_test Description: Learning how to use instagram with python

website: (Don't know what to use since I will be using my home computer to use the intagram python api)

OAuth redirect_uri: (I have no idea)

Thanks


回答1:


You can 'play around' without a website. Dikei's answer is technically correct, however you can put any return URL you want if you know what you are looking for.

If you were to put http://www.google.com as your return URI, and then from a signed in account visited this
https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=http://www.google.com&response_type=code

with CLIENT-ID replaced by your application ID, then you would receive an authorize request form instagram for your account. Once you accept you will be returned to Google with a query string attached which would look something like this: http://www.google.com?code=AABSDAKJHSF1283789012ASDBALKSD

That code in the query string (for a short time-frame after the authorisation) can be used with to get an authorisation token for that user. With that you can then run any of the other fun things in the API.

That's the trick around not having a return URL, and the rest is all here: http://instagram.com/developer/authentication/




回答2:


Instagram API requires a website. The flow is

  1. You direct the user to Instagram website to authenticate.
  2. Instagram redirect the user back to your redirect_uri with the necessary data to get an access token
  3. You get the access token, then use it to request the user's data

For development, you can use http://localhost as the website address, the redirect_uri depends on the structure of your website.

  • Official documentation


来源:https://stackoverflow.com/questions/14732454/how-to-register-new-client-on-instagram-api

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