This document is new for the Knox cloud services 26.10 UAT.
The Knox Configure v2 APIs provide functionalities to manage content files pushed to your enrolled devices. This tutorial shows you how to upload content files, generate a content download URL, and delete content files.
Prerequisites
Ensure that you have the necessary permissions to manage content and obtain an authentication token. For more information, see Get started. Include your access token in the Authorization: Bearer <access_token> header of every request. Access tokens expire after 30 minutes.
Upload content files
-
To upload a content file, make a POST request to the /kc/v2/contents endpoint using
multipart/form-data. This operation requires thekc.content:managescope. -
In the request, provide the following parameter:
- file — The content file to be uploaded to the server. This is a required parameter. The allowed file types are
.jpg,.jpeg, and.png, and the maximum file size is 50 MB.
- file — The content file to be uploaded to the server. This is a required parameter. The allowed file types are
The response includes the new contentId and the contentSize of the uploaded file. For detailed response schema, see POST /kc/v2/contents.
Generate a content download URL
-
To generate a temporary download URL for a content file, make a POST request to the /kc/v2/contents/{contentId}/downloadUrl endpoint. This operation requires the
kc.content:managescope. -
In the request, specify the
contentIdas a path parameter.
For example, the following request generates a download URL for the content file with ID 123654:
POST /kc/v2/contents/123654/downloadUrl
You can adjust the content ID based on the content file you want a download URL for. For detailed response schema, see POST /kc/v2/contents/{contentId}/downloadUrl.
Delete content files
-
To delete one or more content files from your tenant, make a DELETE request to the /kc/v2/contents endpoint. This operation requires the
kc.content:managescope. -
In the request, provide the following query parameter:
- contentIds — The list of content file IDs to be deleted. This is a required parameter.
For example, the following request deletes the content files with IDs 123654 and 123655:
DELETE /kc/v2/contents?contentIds=123654&contentIds=123655
If some content files fail to be deleted, the response returns a 207 status with a failedContentIds list identifying which ones. For detailed response schema, see DELETE /kc/v2/contents.
Ensure that you check the code and message in the response for any errors and handle them appropriately for your app. See Error codes for the full list of Knox Configure error codes. For detailed specification, see Knox Configure API reference.
Is this page helpful?
Thank you for your feedback!