Media sharing is only supported on managed mediaId(s)

restapi
media
media-upload
api

#1

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.


#2

Are you specifying the media_category?


#3

@andypiper Yes. I can successfully upload media within the specified limits


#4

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?


#5

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 }


#6

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?


#7

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.


#8

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.


#9

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.


#10

Ah, OK. Are you using a different token every time? does one token always fail, and one always work?


#11

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?


#12

This was an error on my part. I wasn’t correctly storing and re-uploading my files.


#13

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.