How to post pictures to instagram using API
If you read the link you shared, the accepted answer is:
You cannot post pictures to Instagram via the API.
Instagram have now said this:
Now you can post your content using Instagram APIs (New) effects from
26th Jan 2021 !
https://developers.facebook.com/blog/post/2021/01/26/introducing-instagram-content-publishing-api/
Hopefully you have some luck here.
Instagram Graph API - Post an image
It is now possible to POST contents (images, videos inclusive) to your instagram feed using Instagram Content Publishing API(Visit their website for more details).
There exist many restrictions/limitations for posting images as well:
- Can only be used to publish to business IG User accounts; Creator IG User accounts are not supported.
- Accounts are limited to 25 API-published posts within a 24 hour period.
- JPEG is the only image format supported. Extended JPEG formats such as MPO and JPS are not supported.
- Stories are not supported.
- Shopping tags are not supported.
- Branded content tags are not supported.
- Filters are not supported.
- Multi-image posts are not supported.
Publishing photos is a two-step process:
- Use the
POST /{ig-user-id}/media
endpoint to create a media object container. - Then, use the
POST /{ig-user-id}/media_publish
for creating endpoint to publish that container.
Post image to Instagram from a Javascript using Instagram API
I found the correct way to publish images:
var formData = {
'image_url': image,
'caption': text,
'access_token': access_token
};
var options = {
'method' : 'post',
'payload' : formData
};
const container = 'https://graph.facebook.com/v11.0/' + instagram_business_account + '/media';
const response = UrlFetchApp.fetch(container, options);
const creation = response.getContentText();
var data = JSON.parse(creation);
var creationId = data.id
var formDataPublish = {
'creation_id': creationId,
'access_token': access_token
};
var optionsPublish = {
'method' : 'post',
'payload' : formDataPublish
};
const sendinstagram = 'https://graph.facebook.com/v11.0/' + instagram_business_account + '/media_publish';
UrlFetchApp.fetch(sendinstagram, optionsPublish);
How can i Post image at instagram using API or Direct Image link
http://instagram.com/developer/endpoints/media/
"At this time, uploading via the API is not possible"
Programatically upload pictures on Instagram workaround
You cannot upload images via Instagram’s API.
Per Instagram's API documentation:
At this time, uploading via the API is not possible. We made a conscious choice not to add this for the following reasons...
While it is possible to use Instagram's private API to upload photos (you'd need to capture this information using a proxy server) it is a very quick way to get you instantly banned for life from using the API.
There are a handful of exceptions to this rule, Hipstamatic/Oggl being one of them. Whether or not posts.so is or not, I can't say, though I find it highly unlikely that they're authorized to do that they're doing. More-so with gramblr, their site is.. shady at best.
You can read a similar post here: Uploading photos to Instagram via your own iOS app
Related Topics
Build Select Query With Dynamic Number of Like Conditions as a MySQLi Prepared Statement
Index.PHP Not Loading by Default
File_Put_Contents - Failed to Open Stream: Permission Denied
What Does It Mean to Escape a String
Show Ajax Upload Status on Progress Element
Error With PHP Mail(): Multiple or Malformed Newlines Found in Additional_Header
Passing $_Post Values With Curl
Weird PHP Error: 'Can't Use Function Return Value in Write Context'
PHPmailer - Smtp Error: Password Command Failed When Send Mail from My Server
Http Requests With File_Get_Contents, Getting the Response Code
Having Issue With Matching Rows in the Database Using Pdo
How to Find the Mime Type of a File With PHP
Calling Non-Static Method With Double-Colon(::)
Where to Put Password_Verify in Login Script
Pdo::_Construct(): Server Sent Charset (255) Unknown to the Client. Please, Report to the Developers