Expiry tag and video id


I’m trying to fetch an upload url from the Cloudflare Stream API. Everything’s work fine, but I have two questions:

  1. How to pass the expiry variable in the Upload-Metadata?
  2. I’m able to get the location from headers (const location = result.headers.get(‘Location’)) but how can I get the video id (uid) ?


There are many information missing in the documentation.


About your second question:

I’m also having trouble implementing the Upload via the Stream API using TUS, because the documentation is quite incomplete.

In the same request that you get the location, there will be a header with the ID on header

Try something like:

let uid = result.headers.get(‘Stream-Media-Id’);


Thanks bruno5, I tried Stream-Media-Id and it works fine.
Hope someone provides answer about the expiry tag!

1 Like