I want to automatically share posts on Instagram using Google Sheets and Google Drive. I store the photo to be shared in Google Drive. In Google Sheets, I store the name of the file in Google Drive, the date to be shared, and the caption. I run the system once a day with Schedule Trigger. I couldn’t upload the image in Google Drive directly to Instagram with the Facebook Graph API; it gave an error. I tried downloading the image from Google Drive, uploading it to the imgbb site, and then using the Facebook Graph API to upload the returned photo link to Instagram, but it gave the error:
"Bad request - please check your parameters
Only photo or video can be accepted as media type."
“errorMessage”: “Bad request - please check your parameters”,
“errorDescription”: “Only photo or video can be accepted as media type.”,
“errorDetails”: {
“rawErrorMessage”: [
"400 - {"error":{"message":"Only photo or video can be accepted as media type.","type":"OAuthException","code":9004,"error_subcode":2207052,"is_transient":false,"error_user_title":"Media download has failed. The media URI doesn’t meet our requirements.","error_user_msg":"The media could not be fetched from this URI: …/nsTc7r6R/image01.jpg. Please check the limitations section in our development document for more information: [Media - Instagram Platform - Documentation - Meta for Developers](https://developers.facebook.com/docs/instagram-platform/instagram-graph-api/reference/ig-user/media#creating","fbtrace_id":"ASm73SgGriRm3_0KYeT4D6Q)
url_viewer
“h.ttps://ibb.co/zh1RXsQN”
url
“h.ttps://i.ibb.co/nsTc7r6R/image01.jpg”
display_url
“h.ttps://i.ibb.co/gMGTSym6/image01.jpg”
I tried the “url” and “display_url” links, but they give the same error.
When I try the “url_viewer” link, I get this error:
"Bad request - please check your parameters
The image format is not supported."
“errorMessage”: “Bad request - please check your parameters”,
“errorDescription”: “The image format is not supported.”,
“errorDetails”: {
“rawErrorMessage”: [
"400 - {"error":{"message":"The image format is not supported.","type":"OAuthException","code":36001,"error_subcode":2207005,"is_transient":false,"error_user_title":"Unsupported format","error_user_msg":"The image format unknown is not supported. Please refer to our dev doc for more media specification requirements: [Media - Instagram Platform - Documentation - Meta for Developers]
I tried both AWS S3 Bucket and Azure Blob Storage, but I couldn’t locate the links. I only uploaded an image that I had downloaded from Google Drive and read it back. I couldn’t find the link for image_url to be sent to the Facebook Graph API. I look forward to your help.