0

I am trying to update a video title using below rest Api but I'm getting 403 forbidden error.

https://xxxxxxxxx.sharepoint.com/portals/hub/_api/VideoService/Channels('" + channelID + "')/Videos('" + videoID + "')
var JSONObject = JSON.stringify({ '__metadata': { 'type': 'SP.Publishing.VideoItem' }, 'Title': 'New title'+videoID });
    $.ajax({
        method: "POST",
        url: sUrl,
        dataType: 'json',
        data: JSONObject,
        headers: {
            "X-HTTP-Method": "MERGE",
            //"accept": "application/json;odata=verbose",
            //"content-type": "application/json;odata=verbose",
            "X-RequestDigest": $("#__REQUESTDIGEST").val()
            //"IF-MATCH": "*"
        },
        success: onViewsUpdatesuccess,
        error: onError
    });
0

You will need Azure access token. Which can be obtained as below

function GetAzureMediaAccessToken(spVideoUrl) {

    var deferred = $.Deferred();

    var executor = new SP.RequestExecutor(_spPageContextInfo.webAbsoluteUrl);

    executor.executeAsync({

        url: "https://tenant.sharepoint.com/portals/hub/_api/VideoService/GetVideoByUrl('" + spVideoUrl + "')/GetStreamingKeyAccessToken",

        method: "GET",

        headers: {

            "Accept": "application/json; odata=nometadata"

        },

        success: function(data) {

            deferred.resolve(data);

        },

        error: function(data, errorCode, errorMessage) {

            deferred.reject(data, errorCode, errorMessage);

        }

    });

    return deferred.promise();

}

For entire code you can refer below

https://collab365.community/o365-pointpublishingpersonaltopic-blog-site/

0

I think you need to get the form digest of the video portal first. I found this complete code example that uses the video chunking api

http://siliconreef.co.uk/2018/06/28/o365-video-api-slicing-dicing-uploading/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.