Video REST API reference

Applies to: SharePoint Online | Office 365

You can use the REST Video API to discover and interact with videos in the Office 365 Video service in SharePoint Online. You can get information about videos and channels, upload new videos, and get information to stream videos.

Using the Video REST API

There are two types of objects that the Video REST API interacts with: videos and channels.

To interact with the Video REST API, you send HTTP requests that use a supported method: GET, POST, MERGE, or DELETE.

All Video API requests use the root URL obtained from the Discovery Service, as explained in the "Video Portal operations" section.

The path URL resource names and query parameters are case insensitive. However, values you assign, entity IDs, and other base64 encoded values are case sensitive.

The Office 365 APIs use Microsoft Azure Active Directory (Azure AD) and OAuth to authenticate application requests. To access the Video API from your application, you'll need to register it in Azure AD with permissions at the appropriate scope. The Office 365 Video REST API supports OData 4.0 standards and lets apps interact with video data on Office 365 by using RESTful interfaces.

Permissions are scoped into three custom groups:

  • Administrators can change channel settings and edit videos.
  • Contributors can create, read, update, and delete (CRUD) videos.
  • Viewers can only view videos.

The channel owner for each channel determines who in the organization falls into each of these groups. In addition, the SharePoint tenant administrator can make the same determination.

Note

To learn more, see Developing on the Office 365 platform.

Video portal operations

You can get the root URL of the video portal to use in all other Video REST API operations, and you can discover whether the video portal is set up and enabled.

Get information about the video portal

Use the O365 Discovery Service to get the root SharePoint Site Collection URL (RootSite), and then call VideoService.Discover from that URL to get the URL of the video portal in SharePoint Online, which you then use in all subsequent calls. Determine if the video portal is set up and enabled.

Note

To access the Discovery Service, you must be logged into the SharePoint portal for your company.

Typically, the endpoint URL for the root site collection for SharePoint would look something like this (for the fictional company Contoso):

https://contoso.sharepoint.com/

The endpoint URL for the video portal for the same company returned by the Discovery Service would then look something like this:

https://contoso.sharepoint.com/portals/hub

GET {RootSite}/_api/VideoService.Discover

Note

The RootSite parameter is a string that represents the endpoint URL of the root site collection for SharePoint, as retrieved from the Discovery Service.

Response type

  • IsVideoPortalEnabled - Returns True if portal is enabled and set up, False if portal is either not enabled or not set up.
  • VideoPortalURL - The endpoint URL of the video portal, used in all subsequent calls.

Note

We suggest that you define and use a constant for this URL, so that you can easily add versioning information when that becomes available.

Sample request

GET https://a830edad9050849nda1.sharepoint.com/_api/VideoService.Discover

Sample response

Status code: 200

{
  "odata.metadata": "https://a830edad9050849nda1.sharepoint.com/_api/$metadata#SP.ApiData.VideoServiceDiscoverers/@Element",
  "odata.type": "SP.Publishing.VideoServiceDiscoverer",
  "odata.id": "https://a830edad9050849nda1.sharepoint.com/_api/VideoService.Discover",
  "odata.editLink": "VideoService.Discover",
  "ChannelUrlTemplate": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_layouts/15/videochannel.aspx?channel={0}",
  "IsVideoPortalEnabled": true,
  "PlayerUrlTemplate": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_layouts/15/videoplayer.aspx?v={0}",
  "VideoPortalLayoutsUrl": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_layouts/15",
  "VideoPortalUrl": "https://a830edad9050849nda1.sharepoint.com/portals/hub"
}

Channel operations

Videos are stored in channels. You can get a list of all the channels to which users can upload videos, and a list of all the channels a user can view. You can also get information about a particular channel, including the ID of a channel, the color of a channel, the title of a channel, and a list of all the videos a channel contains.

Get information about the channels the user can view or upload to

Get a list of channels to which the user can upload videos

Get the list of channels to which a user can upload videos. These are the channels to which they have Owner or Editor permissions.

GET {VideoPortalURL}/_api/VideoService/CanEditChannels

Note

In this and all subsequent calls, VideoPortalURL is a string that represents the endpoint URL of the video portal, as retrieved from the VideoService.Discover call.

Response type

Returns a list of Channel objects.

Note

If your video portal has a lot of channels, this API can take a long time to return.

Get a list of channels the user can view

Get the list of all the channels a user can view. These are the channels to which they have Owner, Editor, or Viewer permissions.

GET {VideoPortalURL}/_api/VideoService/Channels
Response type

Returns a list of Channel objects.

Sample request
GET https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/VideoService/Channels
Sample response

Status code: 200

{
  "odata.metadata": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/$metadata#SP.ApiData.VideoChannels",
  "value": [
    {
      "odata.type": "SP.Publishing.VideoChannel",
      "odata.id": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/VideoService/Channels(guid'1833f204-bb2a-4e93-b8dd-b236daeccae8')",
      "odata.editLink": "VideoService/Channels(guid'1833f204-bb2a-4e93-b8dd-b236daeccae8')",
      "Description": "",
      "Id": "1833f204-bb2a-4e93-b8dd-b236daeccae8",
      "ServerRelativeUrl": "/portals/Red-Channel",
      "TileHtmlColor": "#FF0000",
      "Title": "Red Channel",
      "YammerEnabled": true
    },
    {
      "odata.type": "SP.Publishing.VideoChannel",
      "odata.id": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/VideoService/Channels(guid'c0949ba6-44fb-4db4-9d44-a395f7e9070f')",
      "odata.editLink": "VideoService/Channels(guid'c0949ba6-44fb-4db4-9d44-a395f7e9070f')",
      "Description": "",
      "Id": "c0949ba6-44fb-4db4-9d44-a395f7e9070f",
      "ServerRelativeUrl": "/portals/Blue-Channel",
      "TileHtmlColor": "#0072c6",
      "Title": "Blue Channel",
      "YammerEnabled": true
    },
    {
      "odata.type": "SP.Publishing.VideoChannel",
      "odata.id": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/VideoService/Channels(guid'f92879ac-63bb-4247-a267-73e91cd2fe59')",
      "odata.editLink": "VideoService/Channels(guid'f92879ac-63bb-4247-a267-73e91cd2fe59')",
      "Description": "",
      "Id": "f92879ac-63bb-4247-a267-73e91cd2fe59",
      "ServerRelativeUrl": "/portals/community",
      "TileHtmlColor": "#2A8DD4",
      "Title": "Community",
      "YammerEnabled": true
    }
  ]
}

Get information about a particular channel

Get the channel ID, the channel color, and the channel title

GET {VideoPortalURL}/_api/VideoService/Channels('{channelId}')
Request URL parameters
Required parameter Type Description
channelId string The ID of the channel.
Response type

Returns the following information about a channel:

  • Id -- The ID of the channel.
  • TileHtmlColor -- The color of the channel.
  • Title -- The title of the channel.
Sample request
GET https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/VideoService/Channels(guid'1833f204-bb2a-4e93-b8dd-b236daeccae8')
Sample response

Status code: 200

{
  "odata.metadata": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/$metadata#SP.ApiData.VideoChannels/@Element",
  "odata.type": "SP.Publishing.VideoChannel",
  "odata.id": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/VideoService/Channels(guid'1833f204-bb2a-4e93-b8dd-b236daeccae8')",
  "odata.editLink": "VideoService/Channels(guid'1833f204-bb2a-4e93-b8dd-b236daeccae8')",
  "Description": "",
  "Id": "1833f204-bb2a-4e93-b8dd-b236daeccae8",
  "ServerRelativeUrl": "/portals/Red-Channel",
  "TileHtmlColor": "#FF0000",
  "Title": "Red Channel",
  "YammerEnabled": true
}

Get a list of all the videos on a channel

Gets the list of all the videos on the specified channel.

GET {VideoPortalURL}/_api/VideoService/Channels('{channelId}')/Videos
Request URL parameters
Required parameter Type Description
channelId string The ID of the channel.
Response type

Returns a list of Video objects.

Sample request
GET https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/VideoService/Channels(guid'1833f204-bb2a-4e93-b8dd-b236daeccae8')/Videos
Sample response

Status code: 200

{
  "odata.metadata": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/$metadata#SP.ApiData.VideoChannels/@Element",
  "odata.type": "SP.Publishing.VideoChannel",
  "odata.id": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/VideoService/Channels(guid'1833f204-bb2a-4e93-b8dd-b236daeccae8')",
  "odata.editLink": "VideoService/Channels(guid'1833f204-bb2a-4e93-b8dd-b236daeccae8')",
  "Description": "",
  "Id": "1833f204-bb2a-4e93-b8dd-b236daeccae8",
  "ServerRelativeUrl": "/portals/Red-Channel",
  "TileHtmlColor": "#FF0000",
  "Title": "Red Channel",
  "YammerEnabled": true
}

Get a list of most recent playable videos on a channel

Gets a sorted list of the most recently uploaded videos for a channel and filters out all videos that aren't yet ready to play, except for those that were uploaded by you.

This will return a sorted list of all videos for the channel that have completed transcoding and are ready to play (VideoProcessingStatus = 2), along with videos that aren't ready to play, if they were uploaded by the currently logged-in user.

GET {VideoPortalURL}/_api/VideoService/Channels('{channelId}')/GetAllVideos
Request URL parameters
Required parameter Type Description
channelId string The ID of the channel.
Response type

Returns a list of Video objects

Video operations

Get information about a particular video from a channel, get the count of how many times the video has been viewed, and get playback information. Also, upload videos to a channel, update the videos on a channel, and delete videos from a channel.

Get information about a video

Get information about a particular video, including the date it was created, its title, its duration, the URL of the thumbnail of the video, and its processing status.

GET {VideoPortalURL}/_api/VideoService/Channels('{channelId}')/Videos('{videoId}')

Request URL parameters

Required parameter Type Description
channelId string The ID of the channel.
videoId string The ID of the video.

Response type

Returns the following information:

  • CreatedDate -- The date the video was originally uploaded.
  • Title -- The title of the video.
  • VideoDurationInSeconds -- The duration of the video, in seconds.
  • ThumbnailURL -- The URL of the thumbnail image of the video.
  • VideoProcessingStatus -- The status of the video processing. Can take the following values:
    • 0 -- (default) -- The video has not yet been processed for playback.
    • 1 -- The video has been picked up and is being processed.
    • 2 -- The video is ready to play.
    • 3 -- The video encountered an error while it was being uploaded to Azure Media Services for processing.
    • 4 -- Error -- Generic error--Unable to process the video for streaming.
    • 5 -- Error -- Timeout error--Unable to process the video for streaming.
    • 6 -- Error -- Unsupported format --The video file type is not supported for streaming playback by Azure Media Services.

Sample request

GET https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/VideoService/Channels(guid'1833f204-bb2a-4e93-b8dd-b236daeccae8')/Videos(guid'6b518eae-b0d9-4951-b6da-1e5f58a43daa')

Sample response

Status code: 200

{
  "odata.metadata": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/$metadata#SP.ApiData.VideoItems/@Element",
  "odata.type": "SP.Publishing.VideoItem",
  "odata.id": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/VideoService/Channels(guid'1833f204-bb2a-4e93-b8dd-b236daeccae8')/Videos(guid'6b518eae-b0d9-4951-b6da-1e5f58a43daa')",
  "odata.editLink": "VideoService/Channels(guid'1833f204-bb2a-4e93-b8dd-b236daeccae8')/Videos(guid'6b518eae-b0d9-4951-b6da-1e5f58a43daa')",
  "ChannelID": "1833f204-bb2a-4e93-b8dd-b236daeccae8",
  "CreatedDate": "2015-07-08T05:05:06Z",
  "Description": "",
  "DisplayFormUrl": "https://a830edad9050849nda1.sharepoint.com/portals/Red-Channel/pVid/Forms/DispForm.aspx?ID=5",
  "FileName": "Divers - Future of Productivity.mp4",
  "OwnerName": "TEST_TEST_SPOProvHeartbeat_E3_15_4911090814_22,#i:0#.f|membership|admin@a830edad9050849nda1.onmicrosoft.com,#admin@a830edad9050849NDA1.onmicrosoft.com,#admin@a830edad9050849NDA1.onmicrosoft.com,#TEST_TEST_SPOProvHeartbeat_E3_15_4911090814_22,#https://a830edad9050849nda1-my.sharepoint.com:443/User%20Photos/Profile%20Pictures/admin_a830edad9050849nda1_onmicrosoft_com_MThumb.jpg,#,#",
  "ServerRelativeUrl": "/portals/Red-Channel/pVid/Divers - Future of Productivity.mp4",
  "ThumbnailUrl": "https://a830edad9050849nda1.sharepoint.com/portals/Red-Channel/pVid/Divers - Future of Productivity.mp4.PNG?VideoPreview=1",
  "Title": "Divers - Future of Productivity",
  "ID": "6b518eae-b0d9-4951-b6da-1e5f58a43daa",
  "Url": "https://a830edad9050849nda1.sharepoint.com/portals/Red-Channel/pVid/Divers - Future of Productivity.mp4",
  "VideoDurationInSeconds": 388,
  "VideoProcessingStatus": 2,
  "ViewCount": -1,
  "YammerObjectUrl": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_layouts/15/videoplayer.aspx?v=https%3A%2F%2Fa830edad9050849nda1%2Esharepoint%2Ecom%2Fportals%2FRed%2DChannel%2FpVid%2FDivers%20%2D%20Future%20of%20Productivity%2Emp4"
}

Get a count of how many times a video has been viewed

View counts are returned only when you retrieve the Video object from search endpoints, because view counts are aggregated by search analytics. Thus the ViewCount property will have inaccurate values unless it is retrieved through the /Search end points of the hub or a channel.

To get the view count for a single video, run a search query using the video ID.

GET {VideoPortalURL}/_api/videoservice/Channels('{channelId}')/search/query('{videoId}')?$Select=ViewCount
Request URL parameters
Required parameter Type Description
channelId string The ID of the channel.
videoId string The ID of the video.
Query parameters
Name Type Description
_$Select=ViewCount string The view count to include in the response.
Response type

Returns the number of times the video has been viewed.

Sample request
GET https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/VideoService/Channels(guid'1833f204-bb2a-4e93-b8dd-b236daeccae8')/Videos(guid'6b518eae-b0d9-4951-b6da-1e5f58a43daa')?$Select=ViewCount
Sample response
{
  "odata.metadata": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/$metadata#SP.ApiData.VideoItems/@Element&$select=ViewCount",
  "odata.type": "SP.Publishing.VideoItem",
  "odata.id": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/VideoService/Channels(guid'1833f204-bb2a-4e93-b8dd-b236daeccae8')/Videos(guid'6b518eae-b0d9-4951-b6da-1e5f58a43daa')",
  "odata.editLink": "VideoService/Channels(guid'1833f204-bb2a-4e93-b8dd-b236daeccae8')/Videos(guid'6b518eae-b0d9-4951-b6da-1e5f58a43daa')",
  "ViewCount": -1
}

Get information about playing a video

Get URL of the Azure Media Services manifest for a video

This gets the Azure Media Services manifest URL for the video. You can feed this manifest to a player that has support for playing Azure Media Services assets.

GET {VideoPortalURL}/_api/VideoService/Channels('{channelId}')/Videos('{videoId}')/GetPlaybackUrl('{streamingFormatType}')
Request URL parameters
Required parameter Type Description
channelId string The ID of the channel.
videoId string The ID of the video.
streamingFormatType numeric The streaming format type of the video.

The streamingFormatType parameter can take the following values:

  • 1 -- Smooth Streaming or MPEG-DASH
  • 0 -- HLS Streaming
Response type

Returns the URL of the manifest for the video.

Sample request
GET https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/VideoService/Channels(guid'1833f204-bb2a-4e93-b8dd-b236daeccae8')/Videos(guid'6b518eae-b0d9-4951-b6da-1e5f58a43daa')/GetPlaybackUrl(1)
Sample response

Status code: 200

{
  "odata.metadata": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/$metadata#Edm.String",
  "value": "https://cdn-cvprbl201m01.streaming.mediaservices.windows.net/dc91ba77-e23b-4f2d-9a6b-1b4e96ed554a/9c9b55ed-24d3-45d5-b8dd-f262856a8812.ism/Manifest"
}

Get the bearer token to get access to decrypt the video

All O365 Videos are AES-encrypted. For playing videos in the Smooth Streaming or MPEG-DASH format, you first need to get the bearer token to get access to decrypt the content. This API returns the authentication token to allow the player to decrypt the content.

However, for HLS streaming, you do not need to retrieve the key access token separately, because it is already part of the manifest URL you get when you retrieve the HLS format of the manifest.

GET {VideoPortalURL}/_api/VideoService/Channels('{channelId}')/Videos('{videoId}')/GetStreamingKeyAccessToken
Request URL parameters
Required parameter Type Description
channelId string The ID of the channel.
videoId string The ID of the video.
Response type

Returns the authentication token to allow the player decrypt the content.

Sample request
GET https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/VideoService/Channels(guid'1833f204-bb2a-4e93-b8dd-b236daeccae8')/Videos(guid'6b518eae-b0d9-4951-b6da-1e5f58a43daa')/GetStreamingKeyAccessToken
Sample response

Status code: 200

{
  "odata.metadata": "https://a830edad9050849nda1.sharepoint.com/portals/hub/_api/$metadata#Edm.String",
  "value": "Bearer=urn%3amicrosoft%3aazure%3amediaservices%3acontentkeyidentifier=589ae2f2-969e-43bb-bd04-8d5dad4cce4b&urn%3amicrosoft%3aazure%3amediaservices%3akeyacquisitionhostname=cvprbl201m01.keydelivery.mediaservices.windows.net&http%3a%2f%2fschemas.microsoft.com%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2fnimbuslkgglobacs.accesscontrol.windows.net&urn%3aServiceAccessible=service&Audience=urn%3aNimbus&ExpiresOn=1438217438&Issuer=https%3a%2f%2fnimbuslkgglobacs.accesscontrol.windows.net%2f&HMACSHA256=QHrVRPwi4z1ogCTC5VSbzB%2bS4ThTAaZMvIRCrPQSYno%3d"
}

Upload videos to a channel

Create an empty video object to act as a placeholder for where you will upload a video.

After doing so, you can upload a single small video in one POST call, or a larger one, in chunks, in several POST calls.

Create a placeholder for where you will upload the video

Creates an empty video object that acts as a placeholder for where you will upload the video.

POST {VideoPortalURL}/_api/VideoService/Channels('{channelId}')/Videos
Request URL parameters
Required parameter Type Description
channelId string The ID of the channel.
Request body
{
    '__metadata': {
        'type': 'SP.Publishing.VideoItem'
    },
    'Description': '
    {
        *your description text here*
    }
    ',
    'Title': '
    {
        *your title of video here*
    }
    '
}
Name Type Description
metadata SP.Publishing.VideoItem The type of object you are updating
Description string The description of the video.
Title string The title of the video.
FileName string The file name of the video.
Response type

VideoObject -- The object into which to upload the video. Use the ID returned as the video ID to start uploading into.

Upload a smaller video in a single post

Uploads a single video small enough to be transmitted in a single post.

POST {VideoPortalURL}/_api/VideoService/Channels('{channelId}')/Videos('{videoId}')/GetFile()/SaveBinaryStream
Request URL parameters
Required parameter Type Description
channelId string The ID of the channel.
videoId string The ID of the video.
Request body

The file binary stream.

Response type

Returns 200. No response body.

Upload a larger video in chunks

Use the following calls to upload a video too large to fit in a single POST call, or to cancel a chunked upload.

Start uploading to the video object created earlier

Starts the upload of the chunked video.

POST {VideoPortalURL}/_api/VideoService/Channels('{channelId}')/Videos('{videoId}')/GetFile()/StartUpload(uploadId=guid'{yourGeneratedGuid}')
Request URL parameters
Required parameter Type Description
channelId string The ID of the channel.
videoId string The ID of the video.
yourGeneratedGuid GUID The GUID you generate for your upload session.
Response type

Returns 200. No response body.

Upload each chunk of the file to the video object created earlier

Continues uploading the next chunk of the file. Repeat as many times as necessary.

POST {VideoPortalURL}/_api/VideoService/Channels('{channelId}')/Videos('{videoId}')/GetFile()/ContinueUpload(uploadId=guid'{yourGeneratedGuid}',fileOffset='{offsetSize}')
Request URL parameters
Required parameter Type Description
channelId string The ID of the channel.
videoId string The ID of the video.
yourGeneratedGuid GUID The GUID you generate for the upload session.
offsetSize integer The value of the bytes already uploaded.

Note

If you were uploading 8MB chunks, the offset for the first chunk would be 0, and the offset for the second chunk would be 8*1024=8192.

Request body

The file binary stream of this chunk.

Response type

Returns 200. No response body.

Finish uploading the last chunk of the file to the video object created earlier

Finishes the upload of the chunked video.

POST {VideoPortalURL}/_api/VideoService/Channels('{channelId}')/Videos('{videoId}')/GetFile()/FinishUpload(uploadId=guid'{yourGeneratedGuid}',fileOffset='{offsetSize}')
Request URL parameters
Required parameter Type Description
channelId string The ID of the channel.
videoId string The ID of the video.
yourGeneratedGuid GUID The GUID you generate for the upload session.
offsetSize integer The value of the bytes already uploaded.
Request body

The file binary stream of the last chunk.

Response type

Returns 200. No response body.

Cancel uploading

Cancels the upload of the chunked video.

POST {VideoPortalURL}/_api/VideoService/Channels('{channelId}')/Videos('{videoId}')/GetFile()/CancelUpload(uploadId=guid'{yourGeneratedGuid}')
Request URL parameters
Required parameter Type Description
channelId string The ID of the channel.
videoId string The ID of the video.
yourGeneratedGuid GUID The GUID you generate for the upload session.
Response type

Returns 200. No response body.

Update video metadata

Update the metadata for an existing video on a channel

Change the title and description of a video.

POST {VideoPortalURL}/_api/VideoService/Channels('{channelId}')/Videos('{videoId}')
Request URL parameters
Required parameter Type Description
channelId string The ID of the channel.
videoId string The ID of the video.
Request header
Name Type Description
X-HTTP-Method string MERGE is the value of the property X-HTTP-Method.
Request body
{'__metadata':{'type':'SP.Publishing.VideoItem'},'Description':'{ *your description text here* }', 'Title':'{ *your title of video here* }'}
Name Type Description
metadata SP.Publishing.VideoItem The type of the video object.
Description string The description of the video.
Title string The title of the video.
Response type

Returns 200. No response body.

Delete videos from a channel

Delete an existing video from a channel

 POST {VideoPortalURL}/_api/VideoService/Channels('{channelId}')/Videos('{videoId}')
Request URL parameters
Required parameter Type Description
channelId string The ID of the channel.
videoId string The ID of the video.
Request header
Name Type Description
X-HTTP-Method string DELETE is the value of the property X-HTTP-Method.
Response type

Returns 200. No response body.

Embed a video in another page

Get a code that allows you to embed a video item in another web page, specifying parameter values

Using this call, you can specify values for the parameters you pass, including the width and height of the embedded window, whether the video plays automatically upon opening the page, and whether certain information is shown in the video player when the video is paused. The information includes the video title, its duration, a count of how many times it has been played. and the name of the channel.

GET {VideoPortalURL}/_api/VideoService/Channels('{channelId}')/Videos('{videoId}')/GetVideoEmbedCode?width={width}&height={height}&autoplay={true/false}&showinfo={true/false}

If you don't pass values for the parameters, Office 365 will pick some sensible default values, such as 120 for width, and 230 for height.

Request URL parameters
Required parameter Type Description
channelId string The ID of the channel.
videoId string The ID of the video.
width numeric The width of the embedded video window.
height numeric The height of the embedded video window.
Autoplay true/false Whether the embedded video will start automatically.
ShowInfo true/false Whether the video title, duration, view count, and channel name are shown in the player when the video is paused.
Response type

Returns the embed code.

Get a code that allows you to embed a video item in another web page using default values

Using this call, you can get an embed code that specifies the default values for the embedded video player.

GET {VideoPortalURL}/_api/VideoService/Channels('{channelId}')/Videos('{videoId}')/?$Select=Title,DefaultEmbedCode

The “DefaultEmbedCode” property isn’t automatically returned on the Video object. To get the “DefaultEmbedCode” you need to use the $select option.

By using the $select option, you can request the video item to return any of the video properties, including the title and default embed code, as shown.

Request URL parameters
Required parameter Type Description
channelId string The ID of the channel.
videoId string The ID of the video.
Response type

Returns any default properties you request by using $select, including the default embed code.

Get the video item information and the default embed code from the player-page URL

Using this call, if you know the URL of the O365 Video portal player page for a video, you can get the video ID, the channel ID, and other information about the video.

POST {VideoPortalURL}/_api/VideoService/GetVideoByURL?$Select=Title,Description,CreatedDate,DefaultEmbedCode,VideoDurationInSeconds,ID,VideoProcessingStatus

By using the $select option, you can request that the video item return any of the video properties, including the title and default embed code, as shown.

Request header

Accept=application/json;odata=verbose

Content-Type=application/json;odata=verbose

Request body
{'videoFileRelativeUrl':'https://*root_SharePoint_site*/portals/hub/_layouts/15/PointPublishing.aspx?app=video&p=p&chid=b74774cb-faad-43a0-8de9-cb263e38d75d&vid=e5b66725-9f87-4813-9b50-b24fe80c9c20'}

Where videoFileRelativeURL is the relative or absolute URL of the O365 Video portal player page for a video.

Next steps

Whether you're ready to start building an app or just want to learn more, we've got you covered.

Or, learn more about using the Office 365 platform: