🔖客戶標籤

搜尋

GET https://{API_DOMAIN}/api/v1/contact-tag
curl -X GET
    -H "Content-Type: application/json"
    '{"name": "vip"}'
    https://{API_HOST}/api/v1/contact-tag

Form Data

下表為可使用的過濾條件

PARAMETER

REQUIRED

DEFAULT

TYPE

DESCRIPTION

name

false

NULL

String

模糊搜尋標籤名稱

Response

PROPERTY

TYPE

DESCRIPTION

data

Array of objects

客戶標籤資料陣列

meta

Object

Pagination meta

{
    "data": [
        {
            "id": 1,
            "name": "高消費",
            "description": null,
            "contacts_count": 1
        },
        {
            "id": 2,
            "name": "已婚",
            "description": null,
            "contacts_count": 5
        }
    ],
    "links": {
        "first": "http://dev.dev.firstline.cc/api/v1/contact-tag?page=1",
        "last": "http://dev.dev.firstline.cc/api/v1/contact-tag?page=2",
        "prev": null,
        "next": "http://dev.dev.firstline.cc/api/v1/contact-tag?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 2,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "http://dev.dev.firstline.cc/api/v1/contact-tag?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "http://dev.dev.firstline.cc/api/v1/contact-tag?page=2",
                "label": "2",
                "active": false
            },
            {
                "url": "http://dev.dev.firstline.cc/api/v1/contact-tag?page=2",
                "label": "Next »",
                "active": false
            }
        ],
        "path": "http://dev.dev.firstline.cc/api/v1/contact-tag",
        "per_page": 15,
        "to": 15,
        "total": 30
    }
}

取得單筆資料

GET https://{API_DOMAIN}/api/v1/contact-tag/{id}
curl -X GET
    -H "Content-Type: application/json"
    https://{API_HOST}/api/v1/contact-tag/1

URL Parameters

PARAMETER

REQUIRED

DEFAULT

TYPE

DESCRIPTION

contact_tag_id

true

NULL

Number

客戶標籤系統 ID

Response

PROPERTY

TYPE

DESCRIPTION

data

Object

客戶標籤

{
    "data": {
        "id": 1,
        //標籤名稱
        "name": "高消費",
        //標籤描述
        "description": null,
        //擁有此標籤客戶數
        "contacts_count": 1
    }
}

新增

POST https://{API_DOMAIN}/api/v1/contact-tag
    '{"name": "高級會員", "description": "年繳" }'
    https://{API_HOST}/api/v1/contact-tag

Form Data

PARAMETER

REQUIRED

DEFAULT

TYPE

DESCRIPTION

name

true

NULL

String

標籤名稱

description

false

NULL

String

標籤描述

回傳 json 格式

{
    "data": {
        "id": 1,
        "name": "高級會員",
        "description": "年繳會員",
        "contacts_count": 0
    }
}

更新

PUT https://{API_DOMAIN}/api/v1/contact-tag/{id}
curl -X PUT
    -H "Content-Type: application/json"
    '{"name": "月費會員" }'
    https://{API_HOST}/api/v1/contact-tag/1

URL Parameters

PARAMETER

REQUIRED

DEFAULT

TYPE

DESCRIPTION

name

true

null

String

標籤名稱

description

false

null

String

標籤名數

Response

{
    "data": {
        "id": 1,
        "name": "高消費",
        "description": null,
        "contacts_count": 1
    }
}

刪除

DELETE https://{API_HOST}/api/v1/contact-tag/{id}

URL Parameters

PARAMETER

DESCRIPTION

id

客戶標籤的系統編號
 #ID

curl -X DELETE
    -H "Content-Type: application/json"
    https://{API_HOST}/api/v1/contact-tag/22

通用資料

Last updated