Combine multiple API calls into a single request to improve efficiency.
Try it now
Test
RAM authorization
Request syntax
POST /v2/batch HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| domain_id |
string |
Yes |
||
| body |
object |
No |
Contains the request body parameters. |
|
| resource |
string |
Yes |
The resource type of the subrequests. Supported resource types include:
Valid values:
|
file |
| requests |
array<object> |
Yes |
A collection of subrequests. A batch request can contain 1 to 100 subrequests. |
|
|
array<object> |
No |
A subrequest object. |
||
| id |
string |
Yes |
The unique ID of the subrequest. This ID is used to correlate the subrequest with its response. IDs must be unique within a batch request. |
93433894994ad2e1 |
| method |
string |
Yes |
The HTTP method of the subrequest. Supported methods include:
Valid values:
|
POST |
| url |
string |
Yes |
The API path of the subrequest. Supported paths include:
Valid values:
|
/file/get |
| body |
object |
No |
The request body for the subrequest. For details, refer to the documentation for the specific API operation. If you specify the |
|
|
any |
No |
The request body of the subrequest. |
{"domain_id":"1","drive_id":"1"} |
|
| headers |
object |
No |
The request headers for the subrequest. |
|
|
string |
No |
The request headers of the subrequest. |
{"Content-Type":"application/json"} |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| responses |
array<object> |
A collection of responses to the subrequests. |
|
|
array<object> |
A response object for a single subrequest. |
||
| id |
string |
The ID of the subrequest that this response corresponds to. |
93433894994ad2e1 |
| status |
integer |
The HTTP status code of the subrequest. For details, refer to the documentation for the specific API operation. |
200 |
| body |
object |
The response body of the subrequest. For details, refer to the documentation for the specific API operation. |
|
|
any |
The response body of the subrequest. |
{"domain_id":"1","drive_id":"1","file_id":"9520943DC264"} |
Examples
Success response
JSON format
{
"responses": [
{
"id": "93433894994ad2e1",
"status": 200,
"body": {
"key": "{\"domain_id\":\"1\",\"drive_id\":\"1\",\"file_id\":\"9520943DC264\"}"
}
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.