While performing STATUS check stumbled upon another blocker.
After performing the INIT phase as per above I got the media_id:
[4] pry(#<Attachment>)> media_id = JSON.parse(response.body)['media_id_string']
=> "920638646432272385"
when I submit the same id to status check:
response = Faraday.get do |req|
req.url("https://upload.twitter.com/1.1/media/upload.json?command=STATUS&media_id=#{media_id}")
req.headers['Authorization'] = auth_header.oauth_auth_header.to_s
end
I get {"request":"\/1.1\/media\/upload.json","error":"Invalid mediaId."}.
Please note that url is correct:
[1] pry(#<Attachment>)> response
=> #<Faraday::Response:0x007fd2b70db8a8
@env=
#<struct Faraday::Env
method=:get,
body="{\"request\":\"\\/1.1\\/media\\/upload.json\",\"error\":\"Invalid mediaId.\"}",
url=#<URI::HTTPS https://upload.twitter.com/1.1/media/upload.json?command=STATUS&media_id=920638646432272385>,
Also upload hasn’t expired yet because STATUS request is made in just few seconds after INIT request.
I guess this is why I’m getting 131 on the first place, but how is this possible that media_id is missing seconds after INIT phase?
Going through this Invalid media Id for now