{"id":2111,"date":"2015-12-24T12:31:47","date_gmt":"2015-12-24T11:31:47","guid":{"rendered":"http:\/\/www.itidea.nl\/?p=2111"},"modified":"2015-12-24T12:31:47","modified_gmt":"2015-12-24T11:31:47","slug":"office-365-video-rest-api-create-a-channel-overview","status":"publish","type":"post","link":"https:\/\/www.itidea.nl\/index.php\/office-365-video-rest-api-create-a-channel-overview\/","title":{"rendered":"Office 365 Video REST API &#8211; Create a channel overview"},"content":{"rendered":"<p>Microsoft exposes almost everything through REST API&#8217;s these days, which is excellent!<\/p>\n<p>Not only Mail, Contacts, Calendar and Files, but also Video. In this post I&#8217;m going to show you some simple steps to interact with Channels using the REST Video API. But first some basics.<\/p>\n<h4>Video Portal basics<\/h4>\n<p>The Video Portal exists of a video hub, channels and video&#8217;s.<br \/>\nThe hub functions as a sort of root, which it isn&#8217;t hierarchically speaking. The hub shows all the channels, trending video&#8217;s and other stuff you can configure in the Portal Settings section to show eg video&#8217;s from a certain channel and some spotlight video&#8217;s.<br \/>\n<a href=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-hub.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2120 size-medium\" src=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-hub-287x300.png\" alt=\"Video - hub\" width=\"287\" height=\"300\" srcset=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-hub-287x300.png 287w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-hub-981x1024.png 981w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-hub-600x626.png 600w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-hub-900x939.png 900w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-hub.png 1666w\" sizes=\"auto, (max-width: 287px) 100vw, 287px\" \/><\/a><\/p>\n<p>From the hub a single channel can be accessed through the Channels overview. When a single channel is selected the button Channel Settings is available when you have enough permissions. Here items like channel name, color, permissions etc can be configured.<br \/>\n<a href=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-channel-settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2119 size-medium\" src=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-channel-settings-300x139.png\" alt=\"Video - channel settings\" width=\"300\" height=\"139\" srcset=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-channel-settings-300x139.png 300w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-channel-settings-1024x476.png 1024w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-channel-settings-600x279.png 600w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-channel-settings-900x418.png 900w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-channel-settings.png 1161w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>A nice feature is the link to Storage Metrics.\u00a0It displays the allocation of quota within the site.<br \/>\n<a href=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-storage-metrics.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2118 size-medium\" src=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-storage-metrics-296x300.png\" alt=\"Video - storage metrics\" width=\"296\" height=\"300\" srcset=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-storage-metrics-296x300.png 296w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-storage-metrics-1011x1024.png 1011w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-storage-metrics-600x607.png 600w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-storage-metrics-900x910.png 900w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-storage-metrics.png 1180w\" sizes=\"auto, (max-width: 296px) 100vw, 296px\" \/><\/a><\/p>\n<h4>Channel basics<\/h4>\n<p>The hub and channels are all separate site collections. The hub and the default Community channel are visible in the SharePoint admin center, including the storage used, storage limit, etc as shown in the picture below.<br \/>\n<a href=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-admin-center.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2117 size-large\" src=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-admin-center-1024x107.png\" alt=\"Video - admin center\" width=\"598\" height=\"62\" srcset=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-admin-center-1024x107.png 1024w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-admin-center-300x31.png 300w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-admin-center-600x62.png 600w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-admin-center-900x94.png 900w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><\/a><\/p>\n<p>User created channels, site collections, are hidden in de SharePoint admin center. These site collections are perfectly fine accessible by their url. For example a channel named MyChannel was created. The server relative url would then be \/portals\/MyChannel.<\/p>\n<p>The site collection is used to store video&#8217;s, settings and permissions.<\/p>\n<p>A library called Videos stores all the original video&#8217;s uploaded into the channel. Also the thumbnail generated after processing the video by Azure Media Services is stored in this list and other metadata about the video. A video is based on a content type called Cloud Video. Besides the &#8216;regular&#8217;\u00a0 columns as Title and Description other columns are present:<\/p>\n<ul>\n<li>Owner<\/li>\n<li>People in Video<\/li>\n<li>Categories &#8211; managed metadata, can be set to a term set of your choice.<\/li>\n<li>Thumbnail preview<\/li>\n<li>Length (seconds)<\/li>\n<li>Frame width<\/li>\n<li>Frame height<\/li>\n<\/ul>\n<p>Since the video is stored in SharePoint the video file size limit is the same as SharePoint file size limit.<\/p>\n<p>Another important list is the Channel Settings list. In this list the channel name, tile color and spotlight videos are stored.<\/p>\n<p>Permissions are just some regular SharePoint groups. The link to the groups isn&#8217;t present from the Settings page, but it&#8217;s accessible: \/_layouts\/15\/groups.aspx<br \/>\n<a href=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-groups.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2123 size-medium\" src=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-groups-300x191.png\" alt=\"Video - groups\" width=\"300\" height=\"191\" srcset=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-groups-300x191.png 300w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-groups-1024x654.png 1024w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-groups-600x383.png 600w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-groups-900x575.png 900w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-groups.png 1071w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The groups Creators, Contributors and Viewers are the groups meant in the channel settings accessible from the hub at the Permissions tab: Owners, Editors and Viewers.<\/p>\n<p>Now you have a basic understanding of the hub and the channels, let&#8217;s do some code.<\/p>\n<h4>Some code<\/h4>\n<p>At the hub level a list of channels is available, but it&#8217;s only a list of the channel name and the color, no other information is shown here.<\/p>\n<p>Let&#8217;s show the users in the permission groups set at the channels next to the channel so a more informative overview is created.<\/p>\n<p>This is a simple example of using the Video REST API and the SharePoint REST API. The Video REST API is used to get information about the video portal and the channels, the SharePoint REST API is used to get the users of some groups.<\/p>\n<p>First a request has to be created to the Video portal&#8217;s discovery endpoint to discover whether the video portal is set up and enabled and to get the URL of the video portal.<\/p>\n<p>https:\/\/&#8230;sharepoint.com\/_api\/VideoService.Discover<\/p>\n<p>The Video portal root url is used in subsequent calls.<\/p>\n<p>There are two options to get a list of channels. \/_api\/VideoService\/CanEditChannels can be used to get channels he user has Owner or Editor permissions and \/_api\/VideoService\/Channels can be used to get channels the user can view.<br \/>\n<a href=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-response-calling-channel.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2122 size-large\" src=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-response-calling-channel-1024x422.png\" alt=\"Video - response calling channel\" width=\"598\" height=\"246\" srcset=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-response-calling-channel-1024x422.png 1024w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-response-calling-channel-300x123.png 300w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-response-calling-channel-600x247.png 600w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-response-calling-channel-900x371.png 900w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-response-calling-channel.png 1409w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><\/a><\/p>\n<p>The picture above shows the response of the call.<\/p>\n<p>These are the only calls needed to the Video REST API. To request the users in the specified groups the SharePoint REST API can be used like:<\/p>\n<p>https:\/\/&lt;channelurl&gt;\/_api\/web\/sitegroups\/getbyname(&#8216;&lt;name of the group&gt;&#8217;)\/users<\/p>\n<p>And the users in the group are returned.<\/p>\n<p>Possible result can be like the image below.<br \/>\n<a href=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-channel-overview-and-users-in-groups.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2121 size-large\" src=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-channel-overview-and-users-in-groups-1024x175.png\" alt=\"Video - channel overview and users in groups\" width=\"598\" height=\"102\" srcset=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-channel-overview-and-users-in-groups-1024x175.png 1024w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-channel-overview-and-users-in-groups-300x51.png 300w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-channel-overview-and-users-in-groups-600x103.png 600w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/12\/Video-channel-overview-and-users-in-groups-900x154.png 900w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><\/a><\/p>\n<h4>Summary<\/h4>\n<p>In this post the basics about the video portal and channels are explained.<\/p>\n<p>The above overview was just a quick demo with a small amount of channels. Production code should probably contain code more based on search.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft exposes almost everything through REST API&#8217;s these days, which is excellent! Not only Mail, Contacts, Calendar and Files, but also Video. In this post I&#8217;m going to show you some simple steps to interact with Channels using the REST &#8230; <a class=\"more-link\" href=\"https:\/\/www.itidea.nl\/index.php\/office-365-video-rest-api-create-a-channel-overview\/\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39,35],"tags":[37,44],"class_list":["post-2111","post","type-post","status-publish","format-standard","hentry","category-office-365","category-sharepoint-2013","tag-office365","tag-sharepoint-2013"],"_links":{"self":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts\/2111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/comments?post=2111"}],"version-history":[{"count":9,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts\/2111\/revisions"}],"predecessor-version":[{"id":2127,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts\/2111\/revisions\/2127"}],"wp:attachment":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/media?parent=2111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/categories?post=2111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/tags?post=2111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}