Hi @andypiper,
I am using https://www.npmjs.com/package/twitter. I successfully post an image to /media/upload and save the media object below as mediaClient. Then I try to make a GET to the same endpoint to get the status but I get an error and invalid mediaId. I thought it might be timing error but it seems not.
One thing is the media_id and media_id_string are sometimes different. I’m trying to use the string version.
//from successful POST request
let mediaClient = {
media_id: 1068551683716706300,
media_id_string: '1068551683716706304',
size: 311436,
expires_after_secs: 86400,
image: {
image_type: 'image/png',
w: 1536,
h: 1544
}
}
//for upcoming GET - uses media_id_string from above
let params = {
command: 'STATUS',
media_id: mediaClient.media_id_string
}
//logs { command: 'STATUS', media_id: '1068551683716706304' }
client.get('media/upload', params, function(error, upload, response) {
if (error) console.error(error)
// Error: HTTP Error: 400 Bad Request
// at Request._callback (/Users/me/desktop/code_work/vue/clock_html/app/node_modules/twitter/lib/twitter.js:221:9)
// at Request.self.callback (/Users/me/desktop/code_work/vue/clock_html/app/node_modules/request/request.js:185:22)
// at emitTwo (events.js:126:13)
// at Request.emit (events.js:214:7)
// at Request.<anonymous> (/Users/me/desktop/code_work/vue/clock_html/app/node_modules/request/request.js:1161:10)
// at emitOne (events.js:116:13)
// at Request.emit (events.js:211:7)
// at IncomingMessage.<anonymous> (/Users/me/desktop/code_work/vue/clock_html/app/node_modules/request/request.js:1083:12)
// at Object.onceWrapper (events.js:313:30)
// at emitNone (events.js:111:20)
console.log('worked?', upload)
//logs worked? { request: '/1.1/media/upload.json', error: 'Invalid mediaId.' }
})