Last update:2025-03-21 13:58:11
This section provides comprehensive information on how to structure and initiate API calls to the CDNetworks Media Processing Service. Before proceeding, ensure that the Media Processing Service is enabled for your account and that you have the correct AccessKey and AccessKey Secret pair available.
All API requests to the Media Processing Service follow a consistent structure, comprising a specific HTTP method, a defined URI, required headers, and a request body containing the processing parameters.
Currently, the Media Processing Service API only supports the POST
HTTP method for processing requests.
The base URI for accessing the Media Processing Service API is structured as follows:
http://<API Address>/fops
The components of the URI are detailed in the table below:
Parameter | Description |
---|---|
Communication Protocol | Currently, only HTTP is supported for sending requests to the Media Processing Service API. |
API Address | This is also referred to as the Manage Domain within the Object Storage console. You can locate this information by navigating to Object Storage > Bucket > Overview > Manage Domain. |
Resource Path | Unless explicitly specified otherwise for a particular API function, the resource path for media processing requests should always be /fops . |
Example URI
Each API request to the Media Processing Service must include authentication information in the request header to verify the identity of the requester. This information is provided in the Authorization
header, which consists of your AccessKey
and a generated EncodeSign
.
Authorization: <AccessKey>:<EncodeSign>
For detailed instructions on how to generate the authentication token (EncodeSign
), please refer to the Authentication documentation.
The request body is essential for instructing the Media Processing Service on which media file to process and what type of processing to perform. The request body should be formatted as application/x-www-form-urlencoded
and contain the following parameters:
bucket=[Bucket]&key=[Key]&fops=[Fops]¬ifyURL=[NotifyURL]&force=[Force]&separate=[Separate]
The following table describes each parameter in detail:
Parameter | Required | Description |
---|---|---|
bucket | Yes | Name of the bucket containing target file for processing in Object Storage. |
key | Yes | The name of the file to be processed. |
fops | Yes | The fops parameter indicates the type of media processing you wish to perform on your videos or audios. You should tailor your fops according to the specific processing required. For detailed instructions on structuring fops for different tasks, please refer to the following sections: Transcoding, Transmuxing, Video Encryption, Intelligent Transcoding and Editing. |
notifyURL | No | Also known as the callback address. When a media processing task fails or completes, a notification is sent to this address. The notifyURL should be URL safe base64 encoded when included in the request body. For more details about callbacks, refer to Callback Notification. |
force | No | Specifies whether to overwrite existing files. This is useful to avoid unnecessary processing if the file has already been processed. 0 - Not to overwrite if the target file already exists. 1 - Still process the file and overwrite even if the target file exists. The default value is 0. |
separate | No | Notification method: 0 - Sends a notification to your callback server only after all processing tasks are complete. 1 - Sends notifications to your callback server separately. The default value is 0. |
curl -v -X POST --url "http://mgrDomain/fops"
-d "bucket=aW1hZ2Vz&key=bGVodS5tcDQ==&fops=YXZ0aHVtYi9mbHYvcy80ODB4Mzg0fHNhdmVhcy9hVzFoWjJWek9tZHFhQzVtYkhZPQ=="
-H "Authorization:86622e227a50d49d858c2494a935bc2e4ac543a7:Y2JmMGY0YTNhZmQxZmVlZGM2ZTA0YTdjNTcyOWQ1NjRkNTExYjg0Yg=="