ParkingReformNetwork / organization-dashboard

Supporting code for an InfluxDB dashboard showing how the Parking Reform Network is doing over time, such as # of social media followers and # donors.
MIT License
0 stars 2 forks source link

Obtain Instagram access token and the problem of refreshing it #54

Open wilson34679 opened 11 months ago

wilson34679 commented 11 months ago

Follow the steps below to get a long-lived token

1. Getting started

https://developers.facebook.com/docs/instagram-api/getting-started

2. Getting a long-lived access token

App secret and app ID are needed to get the long-lived access token. They can be obtained in the basic app settings, and the fb_exchange_token is the temporary access token obtained from step 1. https://developers.facebook.com/docs/facebook-login/guides/access-tokens/get-long-lived

Difficulty of refreshing the token

Long-lived tokens will expired in 60 days. However, I could only find a refreshing method for Instagram Basic Display API but not Graph API. Therefore, we currently have to manually acquire a new long-lived token for every 60 days.

This could be a potential way to refresh the access token https://developers.facebook.com/docs/instagram-basic-display-api/reference/refresh_access_token/?locale=en_US