CodeProject, Office 365, Sharepoint, Technical Posts

Office 365 Video & Office 365 APIs

SharePointers & Other O365 Folks,

Recently MSFT has released its video streaming service for Office 365, that is basically an intranet site for video portal . Just for curiosity, I tried available preview version from my Office 365 and happily created multiple channels and uploaded videos into it. I liked it very much because this can be used in many organization to publish their corporate videos and share with their employees. More interestingly, its backed by Azure Media services, so that we can leverage the features like video encryption, HLS (http live streaming) and many more. So after making my hands dirty with configuration of this new thingy, I was excited to extend this service to other client application. For this purpose MSFT have released  a set APIs which enable developers to manipulate their data from any client applications . Say, Android Apps ,IOS Apps & ASP.NET applications etc. A bunch of sample code is available on MSDN for office 365 API integration with Mail, Files(OneDrive), Contacts etc .

But as of now, this available sample codes does not cover usage of Office 365  Video REST API, which is in preview. So I thought to share information about usage of Video REST API. In this post I am not providing  huge blocks of code to explain contrary to what I have done on my previous posts, rather I am using POSTMAN client to show the video REST API functionality.

Initial steps to do

  1. Login to Office 365 Portal ( use admin privileges if you need to configure or create channel for video)
  2. Navigate to the video portal and upload videos into your channel or to default community channel.



Once the video is uploaded, try to view video from portal so that we can grab the channelID and videoID from the browser URL for the future REST API calls. The below URL highlights the channelID and videoID respectively.


For streaming an encrypted video from Office 365(Azure Media Services) to our client application,  we require 2 stuffs – 1. Video playback URL  2. Access token for decryption of video.

Install and open POSTMAN Client – I prefer CHROME for this because we can utilize chrome app of POSTMAN. (Make sure you open a tab for POSTMAN on the same browser instance of chrome where video portal is open, so that authentication will work without any extra effort)

  1. On the POSTMAN app , paste URL in the below format for GET the video playback URL


For my video service , playback video request URL is like below, I have used StreamingFormatType as “1” which is

for “MPEG-DASH” format. if you want use HLS use “0” , so that it will require extra access token to decrypt‘{a4dc2759-a618-4bc8-bd94-edd12294c0d7}’)/Videos(‘{1d956f90-e4e0-4eb0-877d-cbb798423abd}’)/GetPlaybackUrl(‘1’)

Result will look like this


2.  For getting the decryption access token, again do a GET request in the below format


The token request URL for my video is like below‘{a4dc2759-a618-4bc8-bd94-edd12294c0d7}’)/Videos(‘{1d956f3a-e4ea-4eb0-877d-cbb798423abd}’)/GetStreamingKeyToken


Now we have both PlaybackURL and decryption token to stream the video from Office 365 (Azure media service). I used to test my video streaming or else we can directly use IFRAME (see below) or video tag to stream the video.  Click here to open my video in amsplayer -(UPDATE : accesstoken is expired now, if any viewers need to see it functioning Kindly do the request so can update the token.)

<iframe src="//" name="azuremediaplayer" scrolling="no" frameborder="no" align="center" height="280px" width="500px" allowfullscreen></iframe>

Note : Office 365 Video API is still in preview, so kindly keep in mind that MSFT
may change the procedures in future. Also GUIDs & Access tokens used in this post is scrambled because of security concerns.

Hope you enjoyed the post, Feel free to ask your queries.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s