InvalidSyntax
InvalidSyntax

Reputation: 9495

How long does Instagram API access tokens last?

I would like to know how long Instagram API access tokens last? It's not very clear how long they last on their documentation and every PHP package that uses the Instagram API and they all just expect a static access token (along with the client ID and secret) which indicates to me it doesn't change very much.

I am trying to display an Instagram feed on a website, and would like to know if I need to build extra code to periodically check the access token still works or if this is negligible.

Upvotes: 0

Views: 2601

Answers (1)

Rossitten
Rossitten

Reputation: 1166

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

Access tokens may expire at any time in the future.

+

Even though our access tokens do not specify an expiration time, your app should handle the case that either the user revokes access, or Instagram expires the token after some period of time. If the token is no longer valid, API responses will contain an “error_type=OAuthAccessTokenException”. In this case you will need to re-authenticate the user to obtain a new valid token. In other words: do not assume your access_token is valid forever.

Upvotes: 1

Related Questions