Get the message form field interface

API call address

{域名地址}/api/guestbook/fields

illustrate:{域名地址}You need to replace it with your domain address, such as/api/guestbook/fields

Calling methods

GET

Request parameters

none

Return parameters

Field name type illustrate
code int Error code
msg string Error Cause Description
data object[] Results content
data result item information
Field name type illustrate
name string Form name
field_name string Form field call name
type string Form type, possible types include: text type text, number type number, multi-line text type textarea, single-choice type radio, multi-choice type checkbox, drop-down selection type select, image type image, file type file.
required boolean Whether it is required, if the required value is false, it means that it can be ignored.
content string Form default value

Request data example

none

Return to the data example

{
    "code": 0,
    "data": [
        {
            "name": "用户名",
            "field_name": "user_name",
            "type": "text",
            "required": true,
            "content": ""
        },
        {
            "name": "联系电话",
            "field_name": "contact",
            "type": "text",
            "required": true,
            "content": ""
        },
        {
            "name": "留言内容",
            "field_name": "content",
            "type": "textarea",
            "required": true,
            "content": ""
        },
        {
            "name": "性别",
            "field_name": "gender",
            "type": "radio",
            "required": false,
            "content": "男\n女\n保密"
        },
    ],
    "msg": ""
}

Error code

Error code illustrate
0 OK
-1 Error, the cause of the error is pointed out in msg
1001 Not logged in
1002 Unauthorized
200 API request OK