Member-only story
Publish media to Instagram via the Instagram Graph API

Instagram supports to publish different kind of contents to a business account programmatically, but to get everything working you have to do some preperation. I focus to avoid any SDK or dependencies, simple cURL commands are enough and can be implemented in any programming language.
3 steps to get started
Content publishing via the Graph API needs the following 3 step setup:
1. Business Instagram account(Creator accounts aren’t supported)

2. A Facebook page linking to the Instagram account

3. A Facebook App with the business login and Instagram API added

Long live the token :)
Once this is done you can start retrieving a long lived access token to work for 60 days before refreshing it. The simplest method is to use the Graph API explorer:
- Head to the Graph API explorer: https://developers.facebook.com/tools/explorer/
- Select your Meta App, User Token and add the following permissions:

Click generate access token and you get a basic short lived access token. To gather a 60 day long lived token run the following cURL command:
curl -i -X GET "https://graph.facebook.com/v16.0/oauth/access_token?
grant_type=fb_exchange_token&
client_id={app-id}&
client_secret={app-secret}&
fb_exchange_token={your-access-token}"