You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a function to post image on instagram with text.
I recently changed my instagram username and I've had ‘400 Bad Request; challenge_required’ ever since.
Yet all my connection info is good, I checked.
I also confirmed that I was the one who logged into Instagram when he asked if it was me, given a new connection.
My code
constIG_USERNAME="****";constIG_PASSWORD="****";[...]constpostToInsta=async(randomImageDoc,description)=>{returnretry(async()=>{constig=newIgApiClient();ig.state.generateDevice(IG_USERNAME);console.log('Attempting to login to Instagram with username:',IG_USERNAME);awaitig.account.login(IG_USERNAME,IG_PASSWORD);console.log('Logged in to Instagram successfully');const{ imageUrl, username, objects }=randomImageDoc;console.log('Fetching image from URL:',imageUrl);constimageBuffer=awaitaxios.get(imageUrl,{responseType: 'arraybuffer'}).then(response=>response.data);console.log('Image fetched successfully');constcaption=`${description}\n\nCosmio's Image of the Day: shot by ${username}\n\nExplore space on Cosmio.io\n\n#astrophotography #astrophoto #astronomy #astro #cosmio #imageoftheday #space #nightsky #telescope #universe #stargaze #nightphotography #cosmos`;console.log('Caption:',caption);console.log('Attempting to publish photo to Instagram');awaitig.publish.photo({file: imageBuffer,caption: caption});console.log('Photo published successfully');console.log('Marking the image as posted in Firestore');awaitadmin.firestore().collection('images').doc(randomImageDoc.id).update({posted: true});console.log('Image marked as posted in Firestore');});};
Hey,
I have a function to post image on instagram with text.
I recently changed my instagram username and I've had ‘400 Bad Request; challenge_required’ ever since.
Yet all my connection info is good, I checked.
I also confirmed that I was the one who logged into Instagram when he asked if it was me, given a new connection.
My code
Error
In my console Firebase Functions
The text was updated successfully, but these errors were encountered: