Common Headers and Error Responses
Updated at:2025-11-11
Common header specifications
Common request headers
| Common header | Description |
|---|---|
| Authorization | Include both the Access Key and the request signature. |
| Content-Type | application/json; charset=utf-8。 |
| x-bce-date | A string representing the date that complies with API specifications. |
The standard HTTP protocol header fields are not included here. Common header fields are mandatory and will appear in every CSN API. For POST, PUT, DELETE, or other request types, include the request data in the request body.
Common response header
| Common header | Description |
|---|---|
| Content-Type | application/json; charset=utf-8。 |
| x-bce-request-id | These are generated by the CSN backend and automatically added to the response header fields. |
Error response
If an error occurs during CSN access, the corresponding error code and error details will be returned by CSN to assist users in identifying and addressing the issue. For request errors, detailed error information is provided in the Response Body using the format below:
| Parameter name | Type | Description |
|---|---|---|
| code | String | Error code |
| message | String | Error description |
| requestId | String | Request ID of this request |
Example:
Plain Text
1{
2 "code": "NoSuchObject",
3 "message": "account not exist",
4 "requestId": "c4abab14-ebc4-4eb0-85d2-03c4d51eed18"
5}
BCE global error codes
| Error return code | Error message | Status code | Description |
|---|---|---|---|
| AccessDenied | Access denied. | 403Forbidden | You do not have permission to access this resource. |
| QualifyNotPass | The User has not pass qualify. | 403 | The account has not passed certification |
| InappropriateJSON | The JSON you provided was well-formed and valid, but not appropriate for this operation. | 400 Bad Request | The JSON format in the request is correct but contains semantic errors. For example, a required field might be missing, or the value type is incorrect. To ensure compatibility, unrecognized items will be ignored, and this type of error will not be returned. |
| InternalError | We encountered an internal error Please try again. | 500 Internal Server Error | 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. |
| InvalidAccessKeyId | The Access Key ID you provided does not exist in our records. | 403Forbidden | The Access Key ID does not exist. |
| InvalidHTTPAuthHeader | The Access Key ID you provided does not exist in our records. | 400 BadRequest | The authorization header format is invalid. |
| InvalidHTTPRequest | There was an error in the body of your HTTP request. | 400 Bad Request | The HTTP body format is invalid, for example, it could be due to incompatible Encoding. |
| InvalidURI | Could not parse the specified URI. | 400 Bad Request | The URI format is invalid. For instance, specific service keywords do not match. For problems like ID mismatches, more specific error codes, such as NoSuchKey, should be provided. |
| MalformedJSON | The JSON you provided was not well-formed. | 400 BadRequest | The JSON format is invalid. |
| InvalidVersion | The API version specified was invalid. | 404 NotFound | The URI version number is invalid. |
| OptInRequired | A subscription for the service is required. | 403Forbidden | The corresponding service has not been activated. |
| PreconditionFailed | The specified If-Match header doesn’tmatch the ETag header. | 412PreconditionFailed | Please refer to the Etag for more information. |
| RequestExpired | Request has expired. Timestamp date is . | 400 BadRequest | Request timeout. Replace with x-bce-date. If the request contains only the Date header, convert it to datetime. |
| IdempotentParameterMismatch | The request uses the same client token asa previous, but non-identical request. | 403Forbidden | The API parameters do not match for the same clientToken. |
| SignatureDoesNotMatch | The request signature we calculated does not match the signature you provided. Check yourSecret Access Key and signing method. Consultthe service documentation for details. | 400 Bad Request | The signature in the Authorization header does not match the server's verification. |
CSN error return codes
| Error code | Error description | HTTP status code | Chinese explanation |
|---|---|---|---|
| CsnIdInvalidException | The csnId is invalid | 400 | Invalid Cloud Smart Network ID |
| CsnNotFoundException | The csn instance is not exist | 404 | Cloud Smart Network does not exist |
| InstanceIdInvalidException | The instanceId is invalid | 400 | Invalid network instance ID |
| GrantNotFoundException | The grant instance is not exist | 404 | Authorization rule for the network instance does not exist |
| RegionInvalidException | The region is not exist | 400 | Invalid region |
| GrantStatusNotAllowDeleteException | The status of grant is not allow to delete | 400 | Authorization rule cannot be deleted |
| CsnNotAllowDeleteException | The csn has bound csnBp | 400 | Cloud Smart Network bound to a bandwidth package cannot be deleted |
| DbException | The db has error | 400 | DB anomaly |
| DuplicateException | The resource has exist | 400 | Resource already exists |
| DetachInstanceException | The instance status is not allow detach | 400 | The current status of the instance does not support detachment |
| CsnRouteRuleNotFoundException | The csn route rule is not exist | 404 | Cloud Smart Network routing rule does not exist |
| CsnRouteRuleIdBlankException | The routeRuleId is not allow empty | 400 | Routing rule ID cannot be empty |
| RouteTableIdInvalid | The csnRouteTableId is invalid | 400 | Invalid route table ID |
| CsnPropagationDuplicate | The csnRouteTable propagation is already exist | 400 | Route table learning relationship already exists |
| CsnDynamicRuleNotAllowOperate | The csnRouteRule is dynamic,not allow operate | 400 | Operation on dynamic routes is not supported |
| NotAllowRevokeGrant | The instance has attached a csn,not allow revoke grant | 400 | The network instance has been loaded into Cloud Smart Network; the authorization rule cannot be deleted |
