Querying Download Links of Recording Files
Description
This API is used to query the download link of a meeting recording.
- Only enterprise administrators can query download links of recording files.
- This API is available only for some enterprises. Contact Huawei sales personnel and provide your enterprise ID to apply for this API.
Debugging
You can debug this API in API Explorer.
Prototype
Request Method |
GET |
---|---|
Request Address |
/v1/mmc/management/record/downloadurls |
Transport Protocol |
HTTPS |
Request Parameters
Parameter |
Mandatory |
Type |
Location |
Description |
---|---|---|---|---|
confUUID |
Yes |
String |
Query |
UUID of a meeting, which can be obtained by calling the API for Querying the Recording File List. |
offset |
No |
Integer |
Query |
Query offset. Default value: 0. |
limit |
No |
Integer |
Query |
Number of records to query. The default value is 20 and the maximum value is 500. |
X-Access-Token |
Yes |
String |
Header |
Authorization token. Use the value of accessToken in the response to the request for Authenticating an App ID. |
X-Authorization-Type |
No |
String |
Header |
Whether the request is sent from a third-party portal.
NOTE:
This parameter will be discarded. Do not use it. |
X-Site-Id |
No |
String |
Header |
ID of the HCS Online site where the authentication is performed.
NOTE:
This parameter will be discarded. Do not use it. |
Status Codes
HTTP Status Code |
Description |
---|---|
200 |
Operation successful. |
400 |
Invalid parameters. |
401 |
Authentication is not performed or fails. |
403 |
Insufficient permissions. |
500 |
Server exception. |
Response Parameters
Parameter |
Type |
Description |
---|---|---|
recordUrls |
Array of DownloadInfo objects |
Links for downloading the recording files. |
Parameter |
Type |
Description |
---|---|---|
confUuid |
String |
Meeting UUID. |
urls |
Array of UrlInfo objects |
Download link details. |
Parameter |
Type |
Description |
---|---|---|
token |
String |
Token used for authentication during download. (A token is valid within one hour and expires immediately after being used.) |
fileType |
String |
File type.
NOTE:
If the recording duration of a single meeting exceeds 3 hours, multiple recording files are generated, each with its own download link. (In earlier versions, recording files larger than 1 GB are split.) |
url |
String |
File download URL, which contains a maximum of 1000 characters. |
Example Request
GET /v1/mmc/management/record/downloadurls?confUUID=51adf610220411eaaae03f22d33cc26b Connection: keep-alive X-Access-Token: stbX5ElstO5QwOwPB9KGQWUZ1DHoFrTsQjjC user-agent: WeLink-desktop Host: api.meeting.huaweicloud.com User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_191)
Example Response
HTTP/1.1 200 Date: Wed, 18 Dec 2019 06:20:40 GMT Content-Type: application/json;charset=UTF-8 Content-Length: 505 Connection: keep-alive Expires: 0 Pragma: No-cache Cache-Control: no-cache http_proxy_id: 4556e88832e5990723d1712395f5bee8 Server: api-gateway X-Request-Id: 629891c82bb852d8796e2f6acc74721e { "recordUrls": [ { "confUuid": "ef67f6ada67e11eba6374db4b9a61d2c", "urls": [ { "token": "f8fe906eaa6d690ef72bc831df54ffd9fc906412aefd329ace96d100cf1bc4be", "fileType": "Aux", "url": "https://100.85.230.37/download/typeThree/video/resource/00037/00037ed2-351a-4741-8ce6-a2078f21ba6b/videoAux/0_0.mp4" }, { "token": "ad8a6f6e009d643ca21f8be306e9e2cadd726360236f07bd176c1b85423b7136", "fileType": "Hd", "url": "https://100.85.230.37/download/typeThree/video/resource/00037/00037ed2-351a-4741-8ce6-a2078f21ba6b/videoHD/0_0.mp4" }, { "token": "fe7a59c69e3f97e831c83d55193a061e5e33e019f4704e5eb441c7f1fa629ad2", "fileType": "Sd", "url": "https://100.85.230.37/download/typeThree/video/resource/00037/00037ed2-351a-4741-8ce6-a2078f21ba6b/videoSD/0_0.mp4" }, { "token": "38e6b3fe7f7c62dd2141a408f4f64b911d1b58a5e04a4f6e0cfd2602181a8ad3", "fileType": "Aux", "url": "https://100.85.230.37/download/typeThree/video/resource/00037/00037ed2-351a-4741-8ce6-a2078f21ba6b/videoAux/0_1.mp4" }, { "token": "843731642aba1ebb720195a7c44f3f1e32ab409d29b2ecd1c58f30ee269f6da6", "fileType": "Hd", "url": "https://100.85.230.37/download/typeThree/video/resource/00037/00037ed2-351a-4741-8ce6-a2078f21ba6b/videoHD/0_1.mp4" }, { "token": "9fd3471e9dc047c3c345308f0cbed005f227bf48aa47875c7fe752c5a817cbd9", "fileType": "Sd", "url": "https://100.85.230.37/download/typeThree/video/resource/00037/00037ed2-351a-4741-8ce6-a2078f21ba6b/videoSD/0_1.mp4" } ] } ] }
Downloading Recording Files
After obtaining the download link of a recording file and the download authentication token, you can use the following sample code (Java) to download the recording file:
/** * Downloads a recording file. * * @param downloadUrl Link for downloading the recording file * @param localPath Local storage path * @param token Download authentication token */ public static void httpDownload(String downloadUrl, String localPath, String token) { int byteRead; try { URL url = new URL(downloadUrl); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); // The request header carries the download authentication token. connection.setRequestProperty("Authorization", token); connection.setHostnameVerifier(new HostnameVerifier() { @Override public Boolean verify(String hostname, SSLSession sslSession) { return true; } }); TrustManager[] trustManagers = new TrustManager[]{ new X509TrustManager() { public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { } public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { } public X509Certificate[] getAcceptedIssuers() { return null; } } }; SSLContext ctx = SSLContext.getInstance("TLS"); ctx.init(null, trustManagers, null); connection.setSSLSocketFactory(ctx.getSocketFactory()); // Obtains the file stream. InputStream inStream = connection.getInputStream(); // Saves the file stream to a local path. FileOutputStream fs = new FileOutputStream(localPath); byte[] buffer = new byte[1024]; while ((byteRead = inStream.read(buffer)) != -1) { fs.write(buffer, 0, byteRead); } inStream.close(); fs.close(); } catch (IOException | KeyManagementException | NoSuchAlgorithmException e) { e.printStackTrace(); } }
Error Codes
If an error code starting with MMC or USG is returned when you use this API, rectify the fault by following the instructions provided in Huawei Cloud API Error Center.
Example cURL Command
curl -k -i -X GET -H 'X-Access-Token:stbX5ElstO5QwOwPB9KGQWUZ1DHoFrTsQjjC' 'https://api.meeting.huaweicloud.com/v1/mmc/management/record/downloadurls?confUUID=51adf610220411eaaae03f22d33cc26b'
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot