6

I'm going to implement a schedule job using c# which will schedule to run every 3 hours and get the latest 50 images posted in instagarm, and saved in the local cache directory to display instagarm images in site.

So far I have implemented as per the https://www.instagram.com/developer

When I calling the below url (REPLACING CORRECT VALUES) It redirecting to instagram login screen, So is this one time login? since I'm going to use this in a schedule job if this login expired will cause issues.

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

KRR
  • 465
  • 3
  • 6
  • 22

1 Answers1

6

When you login first time it should store the auth token somewhere and this token will be used to authenticate all your requests.

Try to use InstaSharp - a wrapped over Instagram API.

There is also some examples about how to use it, how to setup the authentication etc.

MaKCbIMKo
  • 2,800
  • 1
  • 19
  • 27
  • Any idea, how long it will keep auth token somewhere ? since I'm going to use this as a scheduke job – KRR Jul 05 '16 at 14:32
  • According to Instagram Docs: "These tokens are unique to a user and should be stored securely. Access tokens may expire at any time in the future." So, you can store it locally permanently, but it can be expired at the API side at any time. I think if you will be doing authentication every 3 hours - that's will be fine. Anyway, you can create some check for that and do re-auth if you need to. – MaKCbIMKo Jul 05 '16 at 14:37
  • That is fine, but to get auth token i need to login to instagram, this login session might be expired at any time? – KRR Jul 05 '16 at 15:53
  • Right, at any time. – MaKCbIMKo Jul 05 '16 at 16:06