Return a Response
Upon sending an API request, you will receive a response consisting of three components: the response status code, the response message headers, and the response message body.
Response status codes
A status code is a three-digit code representing the status of the API call.
When the status code is 200, it indicates a successful call. When an issue occurs during the call, an error code will be returned. Refer to [Error Code](#Error code)
Response message headers
| Name | Types | Description |
|---|---|---|
| Content-Length | String | The HTTP request content length is defined by RFC 2616. |
| Content-Type | String | The HTTP request content type is defined by RFC 2616. |
| Content-MD5 | String | The MD5 digest of the HTTP request content, as defined in RFC 2616, verifies data consistency between the file stored in BOS and the one expected by the user. |
| Connection | String | Whether the server disconnects, with values being close or keep-alive. |
| Date | String | The GMT time specified in the HTTP 1.1 protocol, such as Wed, 06 Apr 2016 06:34:40 GMT. |
| eTag | String | The HTTP entity tag (eTag) identifies object content. Each time an object is created, an eTag is generated, which can be used to verify if the object's content has changed. |
| Server | String | The name of the server, with the value being BceBos. |
| x-bce-request-id | String | Created by BCE BOS, it is the unique identifier for requesting BceBos. |
| x-bce-debug-id | String | Created by BCE BOS, this identifier ID is used for troubleshooting. If issues arise when using BOS, you can provide this field in support tickets to speed up problem resolution. |
Response message body
The response message body is typically provided in a structured JSON format and contains content outside the response message headers. For information retrieval requests, the response message body delivers the acquired data.
Error code
If an error occurs while calling the API, the server will return the corresponding error code and information to help users identify and address the issue effectively.
The format of the error message returned is as follows:
1{
2 "code":"NoSuchKey",
3 "message":"The resource you requested does not exist",
4 "requestId":" 4db2b34d-654d-4d8a-b49b-3049ca786409"
5}
The definition of the Code field is as follows:
| Error code (code) | Message (message) | Description | HTTP status code |
|---|---|---|---|
| AccessDenied | Access denied. | Access Denied | 403 Forbidden |
| AccountOverdue | Your request is denied because there is an overdue bill of your account. | Overdue bill of your account | 403 Forbidden |
| BadDigest | The Content-MD5 you specified did not match what we received. | The Content-MD5 you specified did not match the accurately uploaded data MD5. | 400 Bad Request |
| BucketAlreadyExists | The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again. | Bucket already exists | 409 Conflict |
| BucketNotEmpty | The bucket you tried to delete is not empty. | The bucket you tried to delete is not empty | 409 Conflict |
| EntityTooLarge | Your proposed upload exceeds the maximum allowed object size. | Uploaded data size exceeds the limit | 400 Bad Request |
| EntityTooSmall | Your proposed upload is smaller than the minimum allowed object size. | Uploaded data size is under the limit | 400 Bad Request |
| InappropriateJSON | The JSON you provided was well-formed and valid, but not appropriate for this operation. | The JSON format in the request is syntactically correct but semantically invalid. For example, a required item might be missing, or the value type might be mismatched. For compatibility, all unrecognized items should be ignored, and this error should not be returned. | 400 Bad Request |
| InappropriateXML | The XML you provided was well-formed and valid, but not appropriate for this operation. | Applicable scenarios are the same as InappropriateJSON | 400 Bad Request |
| InternalError | We encountered an internal error. Please try again. | All other undefined errors. This should not be used if there are clearly corresponding errors of other types, including both general and service-specific errors. | 500 Internal Server Error |
| InvalidArgument | Invalid Argument. | Invalid argument | 400 Bad Request |
| InvalidBucketName | The specified bucket is not valid. | Invalid BucketName | 400 Bad Request |
| InvalidEncryptionAlgorithm | The specified encryption algorithm is invalid. | The specified encryption algorithm is invalid. | 400 Bad Request |
| InvalidHTTPAuthHeader | The HTTP authorization header is invalid. Consult the service documentation for details. | Invalid authorization header format | 400 Bad Request |
| InvalidHTTPRequest | There was an error in the body of your HTTP request. | The HTTP body format is invalid, e.g., non-compliant encoding. | 400 Bad Request |
| InvalidObjectName | Your object key is too long. | Object Key too long | 400 Bad Request |
| InvalidPart | One or more of the specified parts could not be found. The part might not have been uploaded, or the specified entity tag might not have matched the part's entity tag. | Invalid part: In the third step of the three-step upload, some parts are non-existent or their part eTags do not match | 400 Bad Request |
| InvalidPartOrder | The list of parts was not in ascending order.Parts list must specified in order by part number. | Uploaded parts must be uploaded in ascending order of PartNumber in the third step of the upload | 400 Bad Request |
| InvalidPolicyDocument | The content of the form does not meet the conditions specified in the policy document. | The content of the form does not meet the conditions specified in the policy document | 400 Bad Request |
| InvalidRange | The requested range cannot be satisfied. | Invalid requested range | 416 Requested Range Not Satisfiable |
| InvalidURI | Could not parse the specified URI. | Invalid URI format | 400 Bad Request |
| MalformedJSON | The JSON you provided was not well-formed. | Invalid JSON | 400 Bad Request |
| MalformedXML | The XML you provided was not well-formed or did not validate against our published schema. | Invalid XML | 400 Bad Request |
| MaxMessageLengthExceeded | Your request was too big. | Exceeding the message length limit | 400 Bad Request |
| MetadataTooLarge | Your metadata headers exceed the maximum allowed metadata size. | Metadata exceeding the limit | 400 Bad Request |
| MethodNotAllowed | he specified method is not allowed against this resource. | Requested method not allowed | 405 Method Not Allowed |
| MissingContentLength | You must provide the Content-Length HTTP header. | Missing Content-Length field | 411 Length Required |
| MissingDateHeader | Request must have a "date" or "x-bce-date" header. | Request must have a "date" or "x-bce-date" header; if both date and x-bce-date are added, the priority of x-bce-date is higher than date. For their formats, please refer to: date: Wed, 06 Apr 2016 06:34:40 GMTx-bce-date: 2016-04-06T08:23:49Z | 400 Bad Request |
| NoReplicationConfiguration | The Replication configuration does not exist. | The replication configuration does not exist | 404 Not Found |
| NoSuchBucket | The specified bucket does not exist. | No bucket | 404 Not Found |
| NoSuchBucketEncryption | The bucket is not encrypted. | The bucket is not encrypted. | 404 Not Found |
| NoSuchKey | The specified key does not exist. | This object does not exist | 404 Not Found |
| NoSuchUpload | The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed. | The three-step upload corresponding to this uploadId does not exist | 404 Not Found |
| NotImplemented | A header you provided implies functionality that is not implemented. | The system fails to implement | 501 Not Implemented |
| ObjectUnappendable | The object can not be append | AppendObject operation is forbidden on non-Appendable objects | 403 Forbidden |
| OffsetIncorrect | Offset not equal to current object length | When adding the appendable object, the |
409 Conflict |
| PreconditionFailed | The specified If-Match header doesn't match the eTag header. | Preprocessing error | 412 Precondition Failed |
| ReplicationNotEnabled | The Bucket Replication is not enabled. | Error! Cross-region synchronization is not enabled | 404 Not Found |
| ReplicationStatusError | The Bucket Replication Status is not correct. Please make sure both the source and dest bucket have no enabled replication conf and both are not the dest replication bucket of other bucket. | Either the source or target bucket for cross-region replication has already been specified in another cross-region replication rule. | 409 Conflict |
| ReplicationStatusNotEmpty | The bucket you tried to delete has an enabled replication conf or is a dest replication bucket of other bucket. | The bucket you attempted to delete has an enabled replication configuration. | 409 Conflict |
| RequestExpired | Request has expired. Timestamp date is XXX. | The request timestamp has expired. The request is overdue; the value of XXX should match x-bce-date. If the request only contains Date, it must be converted into the format specified by this standard. | 403 Forbidden |
| RequestTimeout | Your socket connection to the server was not read from or written to within the timeout period. | The request has timed out. | 408 Request Timeout |
| ServiceUnavailable | Please reduce your request rate. | Service unavailable | 503 Service Unavailable |
| SignatureDoesNotMatch | The request signature we calculated does not match the signature you provided. Check your Secret Access Key and signing method. Consult the service documentation for details. | Signature in the Authorization header doesn’t match server verification | 403 Forbidden |
| SlowDown | Please reduce your request rate. | Requests too frequent | 503 Slow Down |
| TooManyBuckets | You have attempted to create more buckets than allowed. | You have attempted to create more buckets than allowed | 400 Bad Request |
| InvalidStaticWebSiteFormat | The format of index file or 404 file are not allowed. | The format of the index file or 404 file is not allowed. For example, the file format is invalid, or the index file has the same name as the 404 file. | 400 |
| NoSuchBucketStaticWebSiteConfig | The static web site configuration does not exist. | The bucket does not have a static website configuration. | 404 |
| StaticWebSiteIsDisable | Static web site is disabled or not implemented. | Static website functionality is disabled. For example, BOS might not allow buckets in this region to enable static website hosting, or the hosting service might not be online. | 501 |
| InvalidObjectState | The object is freezed or restoring. | The object status is invalid as it is either frozen or being restored. | 403 |
| NotArchiveObject | Object is not archive storage class. | The current object is not stored as an archive storage class file. | 400 |
| RestoreAlreadyInProgress | The object is restoring.Don't restore the object again. | You have successfully called the RestoreObject API, and the BOS server is in the process of restoring. Please avoid calling RestoreObject again. | 409 |
| RestoreAlready | The object is restored. | The object is already in a restored state, so calling RestoreObject again is unnecessary. | 409 |
