πŸ“„Custom forms

List custom forms for the specified contact

GET https://{API_HOST}/api/v1/contact/{contact}/contact-cz-relation
curl -X GET
    -H "Content-Type: application/json:Authorization: Bearer eyJhbGciOiJIUzI1NiI..." https://{API_HOST}/api/v1/contact/1/contact-cz-relation?cz_col_category_id=5

Parameters

Parameter

Required

Default

Type

DESCRIPTION

contact

true

Number

Customer ID of

cz_col_category_id

false

Number

ID of the custom field category

relation_search_cz_col_id

false

Number

Used to specify the single custom form field ID to search for.

relation_search_cz_col_op

false

String

Input like Indicates performing a fuzzy match search.

relation_search_cz_col_value

false

String

Specify the field content value to search for, matched according to relation_search_cz_col_id the corresponding field.

Please refer to Customer custom related forms Response format


{
    "data": [
        {
            "id": 1,
            "relation_id": 1, // CzColCategory (custom field category) id
            "relation_name": "Health Check",
            "information": [
                {
                    "id": 1,
                    "value": 70,
                    "col_id": 1,
                    "col_name": "Weight"
                },
                {
                    "id": 2,
                    "value": "A",
                    "col_id": 2,
                    "col_name": "Blood Type"
                },
                {
                    "id": 3,
                    "value": [0,1],
                    "col_id": 3,
                    "col_name": "Check Items"
                }
            ],
            "created_at": "2019-11-24 22:58:21",
            "updated_at": "2019-11-24 22:58:21"
        }
    ],
    "links": {
        "first": "https://firstline.localhost/api/contact/2197607/contact-cz-relation?page=1",
        "last": "https://firstline.localhost/api/contact/2197607/contact-cz-relation?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://firstline.localhost/api/contact/2197607/contact-cz-relation",
        "per_page": 15,
        "to": 1,
        "total": 1
    }
}

Add a custom form record for the specified contact

URL Parameters

PARAMETER

REQUIRED

DEFAULT

TYPE

DESCRIPTION

contact

true

NULL

Number

Customer id of

cz_col_category

true

NULL

Number

Form Data

PARAMETER

REQUIRED

DEFAULT

TYPE

DESCRIPTION

cz_cols

false

NULL

Array or Objects

Dynamic fields, parameter type reference CzCol Form description

Cz_Col

This field is an array containing the following format

PARAMETER

REQUIRED

DEFAULT

TYPE

DESCRIPTION

id

true

NULL

Number

ID of the dynamic field

value

true

NULL

String

Value of the dynamic field

Response

Please refer to Customer custom form and Customer custom form content Response format

Example

  • id=1, type=1 (string), name='Weight'

  • id=2, type=6 (single choice), name='Blood Type', options=[{"text": "Type A", "value":"A"},{"text": "Type B", "value":"B"},{"text": "Type O", "value":"O"},{"text": "Type AB", "value":"AB"}]

  • id=3, type=7 (multiple choice), name='Check Items', options=[{"text": "X-ray", "value": 0}, {"text": "Blood Test", "value": 1}, {"text": "Measure Height", "value": 2}]

Example parameters are as follows: (Note that whether it issingle choiceormultiple choice, you always send the value; sending text incorrectly will cause frontend display issues)

Form Data cz_cols

Update a custom form record for the specified contact

URL Parameters

PARAMETER

REQUIRED

DEFAULT

TYPE

DESCRIPTION

contact

true

NULL

Number

Customer id of

contact_cz_relation

true

NULL

Number

Form Data

PARAMETER

REQUIRED

DEFAULT

TYPE

DESCRIPTION

cz_cols

false

NULL

Array

Dynamic fields, parameter type reference CzCol Form description

Cz_Col

This field is an array containing the following format

PARAMETER

REQUIRED

DEFAULT

TYPE

DESCRIPTION

id

true

NULL

Number

ID of the dynamic field

value

true

NULL

String

Value of the dynamic field

Response

Please refer to Customer dynamic related form Response format

Example

  • id=1, type=1 (string), name='Weight'

  • id=2, type=6 (single choice), name='Blood Type', options=[{"text": "Type A", "value":"A"},{"text": "Type B", "value":"B"},{"text": "Type O", "value":"O"},{"text": "Type AB", "value":"AB"}]

  • id=3, type=7 (multiple choice), name='Exercise', options=[{"text": "Basketball", "value": 0}, {"text": "Running", "value": 1}, {"text": "Swimming", "value": 2}]

Example parameters are as follows: (Note that whether it issingle choiceormultiple choice, you always send the value; sending text incorrectly will cause frontend display issues)

Form Data cz_cols

Delete a custom form record for the specified contact

URL Parameters

PARAMETER

REQUIRED

DEFAULT

TYPE

DESCRIPTION

contact

true

NULL

Number

Customer id of

contact_cz_relation

true

NULL

Number

Responds with 204 http status

Delete custom form records of a specified category for the specified contact

URL Parameters

PARAMETER

REQUIRED

DEFAULT

TYPE

DESCRIPTION

contact

true

NULL

Number

Customer id of

cz_col_category

true

NULL

Number

Responds with 204 http status

Last updated