ADS api service 400 on video creation - wrong id in parameters


We are calling endpoint
with POST method.

and getting that result:
400 - {"errors":[{"code":"NOT_FOUND","message":"Media not found"}],"request":{"params":{"video_media_id":xxxxxy,"account_id":"our-account-id"}}}

video_media_id in params is different than video_media_id passed in query. It is same Id with two last digits turned to 0.

What could the problem here? should we send request differently or there is some kind of problem with api servers?


It sounds like this is a snowflake ID issue. You should use the media_id_string value instead to avoid Javascript from mangling the ID value.


Sorry, but that can’t be accepted as solution.
For mismatched params in response it was indeed snowflake issue, but that is only informational.

For request we use media_id_string.
And it says media id is incorrect

Example: From INIT command (uploading to /media/upload.json) I have a response:
{ media_id: 890151432564994000,
media_id_string: ‘890151432564994048’,
expires_after_secs: 86399 }```
That media_id used to upload chunks and finalize, so I suppose it is correct and handled properly.

But then I try to get status of that video:

I get error response: 400 - {"request":"/1.1/media/upload.json","error":"Invalid mediaId."}
It also fails to create ad account video from that media id via POST to /:account/videos


Given the information that was provided, @andypiper’s answer seemed like the solution to me.

Since you’re still experiencing issues, let’s continue discussing. First, we’ll need additional information. As our Guidelines to Reporting Issues state, “Provide the complete request and response queries if applicable (preferably using twurl).” Please do this for the POST accounts/:account_id/videos endpoint.

In addition:

All API-related IDs are safe to share on the forum. These include:

  • Twitter App ID
  • Ads API entity IDs (account, funding instrument, campaign, line item, or promoted tweet IDs)


Thank you for pointing to guidelines, I’ve missed that somehow.

While investigating I’ve found someone had the same problem, and it fails because parameter
media_category: 'amplify_video'
should be specified on INIT call.

While it makes api call working, there is no documentation on that and error response is very misleading.
I believe it is documentation/error reporting problem. Hope it will be fixed eventually.


@RevJetBridge: This is documented here. That being said, we appreciate the feedback. We should make that easier to find.