Get information about available custom fields for communication customization orders, used to provide form fields when creating communication customization orders.
Precautions
- This interface uses the GET method and does not require the submission of request body data
- Access is available without logging in.
- Return all available communication customization order field configurations
- Include field name, type, whether mandatory, and other information
Request address
{域名地址}/api/communication/fields
Description:{域名地址}Need to replace it with your domain address, such ashttps://en.anqicms.com/api/communication/fields
Request syntax
GET {域名地址}/api/communication/fields
Request header
This interface also involves common request headers. For more information, please seeCommon Request Headers (Common Request Headers).
Request Parameters
None
Response Headers
This interface only involves public response headers. More information, please refer toCommon Request Headers (Common Request Headers).
Return parameters
| Field Name | Type | Description |
|---|---|---|
| code | integer | Error code |
| message | string | Error Description |
| data | object[] | Field list data |
data result item parameter
| Field Name | Type | Description |
|---|---|---|
| name | string | Form field display name |
| Field Name | string | Form field calling name |
| type | string | Form type: text(English), number(English), textarea(English), radio(English), checkbox(English), select(English), image(English), file(English) |
| required | boolean | Is it required, true means required, false means optional |
| content | string | Default value of the form |
Example Usage
Request Example
GET /api/communication/fields HTTP/1.1
Host: www.anqicms.com
Content-Type: application/json
Response Example
{
"code": 0,
"msg": "",
"data": [
{
"name": "交付时间",
"field_name": "delivery_time",
"type": "text",
"required": true,
"content": ""
},
{
"name": "特殊要求",
"field_name": "special_requirement",
"type": "textarea",
"required": false,
"content": "请详细描述您的特殊要求"
},
{
"name": "预算范围",
"field_name": "budget_range",
"type": "select",
"required": true,
"content": "5000-10000,10000-20000,20000-50000"
},
{
"name": "是否需要后期维护",
"field_name": "maintenance_required",
"type": "radio",
"required": false,
"content": "是,否"
}
]
}
Error Code
| Error code | Description |
|---|---|
| 0 | OK |
| -1 | Error, the reason is indicated in msg |
| 1001 | Not logged in |
| 1002 | Unauthorized |
| 200 | API request OK |