⬇️Customer custom form import schedule

You can add a related schedule by specifying an existing "customer custom field import template". The schedule will import based on the specified time, file, and other information. To avoid data conflicts at the same time slot, if there are schedules with the same time, they will be executed according to the import execution order.

Create

POST https://{API_HOST}/api/v1/relation-import-task

curl -X POST
    '{"recipe_id":5,"has_header":0,"description":"test upload"}'
    -H "Content-Type: application/json"
    -F file=@/home/user/import.csv
    "https://{API_HOST}/api/v1/relation-import-task"

Request params

Parameter

Required

Default

Type

Description

recipe_id

true

NULL

Number

ID of the custom table import template to use

has_header

false

false

Boolean

Whether to ignore the first row header

description

false

NULL

String

Task description

file

true

NULL

binary

Upload file for import (under 100MB)

Response

Property

Type

Description

{
    "data": {
        "id": 4,
        "has_header": 0,
        "file": "relation-import/1629345399-ct import.csv",
        "size": 44,
        "total_amount": 3,
        "description": "dddd",
        "status": 2,
        "current_sheet_index": 1,
        "current_row_index": 3,
        "job_turns": 1,
        "executed_start_at": "2021-08-19 11:56:39",
        "executed_end_at": "2021-08-19 11:56:40",
        "recipe_id": 1,
        "creater_id": 1,
        "error": null,
        "created_at": "2021-08-19T03:56:39.000000Z",
        "updated_at": "2021-08-19T03:56:40.000000Z",
        "restart_at": null,
        "recipe": {
            "id": 1,
            "name": "Customer ct detection import",
            "description": null,
            "headers": [
                {
                    "value": "contacts.membership_no"
                },
                {
                    "id": 11,
                    "type": 0,
                    "value": "cz_relation_information.11",
                    "text": "measurement number",
                    "isMatchField": true,
                    "category_id": 5
                }
            ],
            "unique_columns": [
                "contacts.membership_no"
            ],
            "relation_unique_column": "-1",
            "creater_id": 1,
            "cz_col_category_id": 5,
            "created_at": "2021-08-18T05:56:20.000000Z",
            "updated_at": "2021-08-18T05:56:20.000000Z",
            "importable_type": "App\\Contact",
            "cz_col_category": {
                "id": 5,
                "name": "ct value",
                "description": null,
                "creater_id": null,
                "created_at": "2021-08-18T05:51:16.000000Z",
                "updated_at": "2021-08-18T05:51:16.000000Z",
                "type": 1
            }
        }
    }
}

List

Http Request

GET https://{API_HOST}/api/v1/relation-import-task

Parameter

Required

Default

Type

Description

page

false

1

Number

Which page is currently on

per_page

false

15

Number

How many items to display per page

Response

Property

Type

Description

data

Array of objects

meta

Object

Pagination meta

View

Http Request

GET https://{API_HOST}/api/v1/relation-import-task/{id}

Response

Property

Type

Description

Template list

You can find the matching template ID for the schedule via the API, or check related information through the system interface.

Http Request

GET https://{API_HOST}/api/v1/relation-import-recipe?importable_type=App\Contact

Query Parameters

Parameter

Required

Default

Type

Description

page

false

1

Number

Which page is currently on

per_page

false

15

Number

How many items to display per page

importable_type

true

NULL

String

Template type, here you need to pass App\Contact

Response

Template view

Http Request

GET https://{API_HOST}/api/v1/relation-import-recipe/{id}

URL Parameters

Parameter

Description

id

Custom table batch import template id

Response

Last updated