# Common Response Format

All MoreLogin API responses follow a standard JSON format.

## Response Structure


```json
{
  "code": 0,
  "msg": null,
  "data": {},
  "requestId": "unique-request-id"
}
```

| Field | Type | Description |
|  --- | --- | --- |
| `code` | `integer` | Result code. `0` = success, other values indicate errors |
| `msg` | `string | null` | Error message. `null` when successful |
| `data` | `object | array | null` | Response payload. Structure varies by endpoint |
| `requestId` | `string` | Unique request identifier. Include this when contacting support |


## Success Response


```json
{
  "code": 0,
  "msg": null,
  "data": {
    "id": 1234567890
  },
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
```

## Error Response


```json
{
  "code": 99001,
  "msg": "Invalid parameters",
  "data": null,
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
```

## Paginated Responses

List endpoints return paginated data in this format:


```json
{
  "code": 0,
  "msg": null,
  "data": {
    "total": 100,
    "current": 1,
    "pages": 10,
    "dataList": [
      { ... },
      { ... }
    ]
  },
  "requestId": "..."
}
```

| Field | Description |
|  --- | --- |
| `total` | Total number of records |
| `current` | Current page number |
| `pages` | Total number of pages |
| `dataList` | Array of records for the current page |


## HTTP Status Codes

| Status | Description |
|  --- | --- |
| `200` | Request processed successfully (check `code` field for business result) |
| `401` | Unauthorized — invalid or expired access token |
| `403` | Forbidden — insufficient permissions |
| `429` | Too Many Requests — rate limit exceeded |
| `500` | Internal Server Error — contact support |


> **Tip**: Always check the `code` field in the response body, not just the HTTP status code. A `200` HTTP status with `code: 99001` means the request was received but failed validation.