Sparse spatial maps APIs error code description
Response format
All API responses use a unified JSON format. Here is an example:
{
"statusCode": 119,
"msg": "Parameter has errors",
"date": "2022-06-15T09:56:30.000Z",
"result": //result exists only when statusCode is 0. If an error occurs, the result field is empty
}
| Field | Type | Description |
|---|---|---|
| statusCode | integer | Business status code. 0 indicates success, non-0 indicates an error |
| msg | string | Message |
| result | object | Return content. When the status code is 0, it responds with the target map object structure; otherwise, it is empty |
| date | string | Server time |
Important
Only when statusCode == 0, result includes the response content. In other states, result is empty
When statusCode != 0, please pay attention to the error message msg
Error code classification
HTTP status code description
| HTTP Status Code | Description |
|---|---|
| 200 | Request successful (may contain business errors) |
| 400 | Request parameter error |
| 401 | APIKey authentication failed |
| 403 | Insufficient permissions or resource access forbidden |
| 404 | Requested URL interface path does not exist |
| 500 | Internal server error |
| 502 | Application exception caught, possibly data error |
Note: Business errors are usually returned through HTTP 200 responses, identified by the statusCode field.
Business status code list
| Status Code | Message |
|---|---|
| 0 | Success |
| 101 | Uploaded file is empty |
| 102 | File size is too large |
| 106 | Missing parameter or parameter is empty |
| 110 | Call server API errors |
| 111 | Resource not found |
| 401 | Authentication token expired |
| 401 | Authentication parameter is missing |
| 401 | Unknown appId or appKey |
| 401 | Account is locked |
| 401 | Authentication failed, invalid signature or token |
Common error scenarios
Timeout with no response
- Request Timeout: Network is slow. It is recommended to check the client's network environment
Authentication-related errors
- Http 401 Unauthorized: APIKey authentication failed. Check if appId/appKey is correct
- Status code 401: Invalid application key or application does not exist. Check application configuration
Parameter errors
- 400 Bad Request: Request parameter format error
Resource operation errors
- Status code 10x: Target resource for query does not exist, or parameter error
System errors
- Http 50x Internal Server Error: Internal server exception or application exception caught. It is recommended to test on the website or with a sample
Best practice recommendations
- Client-side handling: It is recommended to determine business success based on the
statusCodefield, rather than relying solely on the HTTP status code - Error retry: Retry appropriately for 5xx errors; check request parameters for 4xx errors
- Logging: It is recommended to log complete error responses for troubleshooting
- Timeout handling: Set a reasonable request timeout period to avoid long waits