I’m trying to upload images via the api (using npm twit) and getting this back from api each time:
{ [Error: Unknown Twitter API Error]
message: 'Unknown Twitter API Error',
statusCode: 400,
twitterReply: '{"request":"\\/1.1\\/media\\/upload.json","error":"media type unrecognized."}',
code: null,
allErrors: []
}
I read a possible reason could be file size, but my files are ~40kb . I’ve tried lots of different images and none of them have worked, all with the same error thrown.
Am I doing something wrong? I’ve tried using {media: base64_data} and {media_data: base64_data}
I’m using .jpg and .png images only.