Direct link to transcript file

New Contributor

Hi Everyone, 

I'm trying to build url that can give me access link to generated by Stream transcript file. 

 

https://euwe-1-content.api.microsoftstream.com/api/texttracks/2/f0ea98d5-3cd8-4d2b-995e-dc56eef22bc0...

 

Response: 

{"error":{"code":"Forbidden","message":"User dbb14ffa-418b-4051-a678-bb2693fe6e85 is not provisioned."}}

Can you help me with that?

 

Best Reagrds

Bartosz Rzemek 

3 Replies
Hi
Does anybody know how to use a REST/API or URL to download a transcript? @microsoft
I figured out the API. There are 2 steps to downloading the transcript and you actually *can* download transcripts for other people's videos even though that option is annoyingly not exposed in the UI.

1. Get the video UUID from the URL, i.e. https://web.microsoftstream.com/video/<video_UUID>
2. Make a request like this:

    curl 'https://ukwe-3.api.microsoftstream.com/api/videos/<video_UUID>/texttracks?api-version=1.4-private' -H 'authorization: Bearer very_long_sequence_of_characters'

You will need the authorization cookie, easiest way to get it is from Chrome dev tools after logging in. I'm not sure how long they last for. I also verified you don't need any other headers at all mercifully!

That request will return some JSON like this:

  {
    "value":[
      {
        "id":"<another_random_uuid>","name":"","type":"caption","language":"en-US","url":"https://ukwe-3-content.api.microsoftstream.com/api/texttracks/2/<...a_load_of_junk_ending_with...>signature=<...some_random_letters...>%3d","autoGenerated":true
      }
    ]
  }%

I am not sure why the <another_random_uuid> doesn't match the video ID you requested. Very weird API.

Anyway, all you need is the URL. This is the direct link to the transcript, which you can download again using just the authorisation cookie:

    curl '<url from the JSON>' -H 'authorization: Bearer <same cookie as before>'

It would be nice if they just had a "Download transcript"