Forum Discussion
stuartmcgarrity
Nov 13, 2023Brass Contributor
Is Automatic Transcription for Videos on SharePoint Available Yet?
This article implies it is: https://support.microsoft.com/en-us/office/view-edit-and-manage-video-transcripts-and-captions-3cb9acb6-05b2-4f59-a50d-7df61123aa20?WT.mc_id=M365-MVP-9501 Has anyone ...
JWiersem1925
Jan 11, 2024Brass Contributor
stuartmcgarrity How do you trigger transcript creation via API?
stuartmcgarrity
Jan 20, 2024Brass Contributor
Its the "private API" marc mentions. I just looked at what the JS was doing in the UI. This works, but I do not know if all of it is needed. You may need a different baseUrl based on your location. It needs the driveid, the itemid and bearer access token, I use a dummy correlation id. The body of the post call is empty. (This is MATLAB code, but you get the idea):
baseUrl="https://eastus1-mediap.svc.ms/v1/transcript?provider=spo";
docPart="&docid=https://mathworks.sharepoint.com:443/_api/v2.1/drives/" + driveID + "/items/" + itemid + "?version=Published&file-extension=.mp4";
accessPart="&access_token=" + accessToken;
correlationPart="&correlation-id=c4909103-06da-4446-a84f-d2830f0625cf"; % Dummy
languagePart="&spokenlanguagetag=en-US";
apiCall=baseUrl + docPart + accessPart + correlationPart + languagePart;
uri = matlab.net.URI(apiCall,'literal'); % Required for encoding
% Preflight
request = matlab.net.http.RequestMessage;
request.Method="OPTIONS";
prefightResponse=send(request,uri);
% Main request
jsBodyStruct=struct;
jsBody=jsonencode(jsBodyStruct);
result=webwrite(apiCall,jsBody);
baseUrl="https://eastus1-mediap.svc.ms/v1/transcript?provider=spo";
docPart="&docid=https://mathworks.sharepoint.com:443/_api/v2.1/drives/" + driveID + "/items/" + itemid + "?version=Published&file-extension=.mp4";
accessPart="&access_token=" + accessToken;
correlationPart="&correlation-id=c4909103-06da-4446-a84f-d2830f0625cf"; % Dummy
languagePart="&spokenlanguagetag=en-US";
apiCall=baseUrl + docPart + accessPart + correlationPart + languagePart;
uri = matlab.net.URI(apiCall,'literal'); % Required for encoding
% Preflight
request = matlab.net.http.RequestMessage;
request.Method="OPTIONS";
prefightResponse=send(request,uri);
% Main request
jsBodyStruct=struct;
jsBody=jsonencode(jsBodyStruct);
result=webwrite(apiCall,jsBody);