Wednesday, February 28, 2018

How to get instagram user id and access token

first log in

https://www.instagram.com/developer/

create client_id and secret_key and  request_url

after that you should pass client_id and request_url in this url


https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token

we get access_token like this

http://your-redirect-uri#access_token=ACCESS-TOKEN

now you should pass token for find user information like this

https://api.instagram.com/v1/users/self?access_token=access_token

{"data": {"id": "XXXXX", "username": "XXXX", "profile_picture": "XXXX", "full_name": "Naresh Chaudhary", "bio": "", "website": "", "is_business": false, "counts": {"media": 4, "follows": 6, "followed_by": 52}}, "meta": {"code": 200}} 

No comments:

Post a Comment