This issue was referenced in this forum thread but a resolution was never clearly identified.
I’m getting this error when I upload an image, and then re-upload that image a few days later to get an up to date media Id.
Are you specifying the media_category?
media_category
@andypiper Yes. I can successfully upload media within the specified limits
I’m trying to understand a reproducible case here - one image file. You upload and Tweet with it one day successfully. On another day you upload the same image, and get that error when attempting to add it to a Tweet? Does this always happen?
Yes exactly. I never get an error in upload, and I don’t get an error saying that my mediaId has expired. I get this:
{ "code": 324, "message": "Media sharing is only supported on managed mediaId(s)." "statusCode": 400 }
OK. You do get a new (different) mediaId back on the second upload, and use that on the second status update? Do you check the status of the upload as well?
Yes. And from the errors, this is validated. When I try to post an image with an old mediaId, I get an error that the mediaId has expired. On the other hand, when I’ve “refreshed” a mediaId, I get this error.
I think from your point of view you are “refreshing” the id, but in the case of the API, you’re simply uploading an image again, and getting a new id. There’s no relationship between the first upload and the second upload (unless I’m missing something?). I don’t believe there are any restrictions on uploading an image or media file more than once in separate sessions, so this is very odd.
True, I see what you mean.
One thing I can think of is that maybe the first time I uploaded, I had a different accessToken than the second time. Could that affect this? Like you said, they are distinct uploads, so it doesn’t seem like it should.
Ah, OK. Are you using a different token every time? does one token always fail, and one always work?
I am actually using the same token, but there’s a chance the most recent time I received this error it was with different keys. Would that affect things?
This was an error on my part. I wasn’t correctly storing and re-uploading my files.
Ah! good to hear you got to the bottom of it! sorry I was not more helpful, it did sound like an odd issue otherwise.