Retrieve Video Portal Detail:
First, we will see how we can retrieve the video portal information from Office 365 using SharePoint 2013 REST Search API.
The video portal is a part of the Point Publishing hub site. The site template used to create the portal is POINTPUBLISHINGHUB. The REST search API can be used along with the Web template ID to get the relevant information. Web template property should be used in query parameter to get the channels using search. Template ID should be passed as the Web template value.
The search API will be,
The following code snippet shows the JQuery Ajax call to get the video portal information from Office 365 site, using search API:
The channels are separate site collections present on the portal. The site template used to create a channel (site collection) on the video portal is POINTPUBLISHINGTOPIC. Hence, we can use the template ID to query the portal to get the channels available.
The search API will be,
Some of the parameters that can be retrieved using the above URL are Channel Name, Created by, Channel URL, etc.
The following code snippet shows the JQuery Ajax call to get the video channels:
Next, we will see how we can retrieve the videos from the portal in different ways.
1. Using List REST API: From the channels identified, we will access the videos from the respective channels. REST API is used to query SharePoint list items that will be used. To access a video from one single channel, find the following REST List API URL, given below:
Channel URL is the channel path name, found from the previous query.
To select necessary properties for the videos, use select parameter and specify the properties. Some of the properties displayed in my example are Title, Author Name, and Video URL. Here, to get the author name, an expanded query needs to be used.
The following code snippet shows the Jquery Ajax call to get the videos present on the specified channel, using List API:
2. Using Search REST API Query: In the section above, we have seen how we can retrieve the videos from the channels using List REST API. Now, we will see how we can retrieve the videos (same set of information) from the channel using search REST API.
The content type used for video is cloud video. Navigate to SharePoint Video library from channel site and find out the content, type of list, cloud video, and content type. The search API will be,
The following code snippet shows the Jquery Ajax call to get the videos, present on the specified channel, using the list video content type.