问题
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
- You direct the user to Instagram website to authenticate.
- Instagram redirect the user back to your
redirect_uriwith the necessary data to get an access token - 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