I’m using new twitter media API. And it’s work yesterday, but now I have error response on INIT request.
response is
{"errors":[{"message":"Internal error","code":131}]}
api method is https://dev.twitter.com/rest/reference/post/media/upload-init
my JS code (if it helps).
const media_category = extension === 'gif' ? 'dm_gif' : 'dm_image';
const requestDataInit = {
url: `https://upload.twitter.com/1.1/media/upload.json?${
qs.stringify({
command: 'INIT',
media_type: `image/${extension}`,
total_bytes: response.fileSize,
shared: true,
media_category
})
}`,
method: 'POST',
};
const initUpload = await fetch(
requestDataInit.url,
{
method: requestDataInit.method,
headers: oauth.toHeader(oauth.authorize(requestDataInit, {
public: this.props.auth.oauthToken,
secret: this.props.auth.oauthTokenSecret,
})),
}).then(res => res.text());
hope that is temporary.