😀客戶
列表
透過 GET 請求取得ㄎ清單,並可依據下列查詢參數進行過濾、排序與分頁。
GET https://{API_HOST}/api/v1/contact
根據下方的 Query Parameters 參數進行過濾篩選。
curl -X GET
-H "Content-Type: application/json"
https://{API_HOST}/api/v1/contact
Query Parameters
page
integer
否
當前頁碼(從 1 開始)
page=2
search
string
否
名字關鍵字搜尋
search=John
created_at__start
string (datetime)
否
建立時間(起)
created_at__start=2023-01-01
created_at__end
string (datetime)
否
建立時間(迄)
created_at__end=2023-12-31
birth_months
array<integer>
否
出生月份(1–12)
birth_months=1,2
membership_no
string
否
會員編號
membership_no=123456
sponsor_id
string
否
業主 ID
sponsor_id=999
company_ids
array<integer>
否
公司 ID
company_ids=1,2,3
tag_ids
array<integer>
否
標籤 ID 清單
tag_ids=101,102
identity_no
string
否
身份證號碼
identity_no=A123456789
phone_number
string
否
電話號碼
phone_number=0912345678
age__start
integer
否
年齡(起)
age__start=20
age__end
integer
否
年齡(迄)
age__end=40
has_duplicate_number
boolean (0/1)
否
是否有重複號碼
has_duplicate_number=1
has_number
boolean (0/1)
否
是否有電話號碼
has_number=1
has_fb_optin
boolean (0/1)
否
是否有 FB 授權
has_fb_optin=1
has_valid_fb_optin
boolean (0/1)
否
是否有有效 FB 授權
has_valid_fb_optin=1
has_disturb
boolean (0/1)
否
是否有勿擾資料
has_disturb=1
Response
PROPERTY
TYPE
DESCRIPTION
data
Array of objects
知識庫文章陣列
meta
Object
頁籤資訊
取得
GET https://{API_DOMAIN}/api/v1/contact/{contact}
URL Parameters
PARAMETER
REQUIRED
DEFAULT
TYPE
DESCRIPTION
contact
True
NULL
Number
客戶的 ID
curl -X get
-H "Content-Type: application/json"
https://{API_HOST}/api/v1/contact/1
Response
請參考客戶回應格式。
PROPERTY
TYPE
DESCRIPTION
{
"data": {
"id": 1,
"name": "Angelita D'Amore",
"first_name": "Angelita",
"last_name": "D'Amore",
"membership_no": "8771639",
"identity_no": "418099",
"gender": 0,
"birth_at": "1985-08-27",
"profile_id": 1,
"profile": {
"id": 1,
"phones": []
},
"email_contacts": [],
"cz_cols": [
{
"id": 1,
"value": "19999",
"category_id": 1
},
{
"id": 4,
"value": "51",
"category_id": 1
},
{
"id": 5,
"value": null,
"category_id": 1
}
]
}
}
新增
POST https://{API_HOST}/api/v1/contact
根據下方的 Query Parameters 表單的參數進行建立。
curl -X POST
-H "Content-Type: application/json"
'{"first_name":"abc","last_name":"cde"}'
https://{API_HOST}/api/v1/contact?xxxx
Query Parameters
PARAMETER
REQUIRED
DEFAULT
TYPE
DESCRIPTION
membership_no
false
NULL
String
會員編號
identity_no
false
NULL
String
身分證
gender
false
NULL
Number
性別 0: 女 1: 男
first_name
true
NULL
String
姓
last_name
false
NULL
String
名
birth_at
false
NULL
Date
出生日期
cz_cols
false
NULL
Array
自訂欄位,參數型態參考下方 CzCol 表格說明
company_ids
false
NULL
Array
公司系統編號
Response
請參考客戶回應格式
{
"data": {
"id": 2,
"name": "abc cde",
"first_name": "abc",
"last_name": "cde",
"membership_no": null,
"identity_no": null,
"gender": null,
"birth_at": null,
"profile_id": 1,
"profile": {
"id": 1,
"phones": []
},
"cz_cols": [
{
id: 4,
value: "123456"
},
{
id: 7,
value: "apple"
}
],
}
}
更新
PUT https://{API_HOST}/api/v1/contact/{id}
URL Parameters
PARAMETER
DESCRIPTION
id
客戶的 ID
curl -X PUT
-H "Content-Type: application/json"
'{"first_name":"First","last_name":"Line"}'
https://{API_HOST}/api/v1/contact/2
Query Parameters
PARAMETER
REQUIRED
DEFAULT
TYPE
DESCRIPTION
membership_no
false
NULL
String
會員編號
identity_no
false
NULL
String
身分證
gender
false
NULL
Number
性別 0: 女 1: 男
first_name
false
NULL
String
姓
last_name
false
NULL
String
名
birth_at
false
NULL
Date
出生日期
cz_cols
false
NULL
Array
自訂欄位,參數型態參考下方 CzCol 表格說明
tag_ids
false
NULL
Array
客戶標籤,傳入客戶標籤 ID
company_ids
false
NULL
Array
公司系統編號
Response
請參考客戶回應格式
{
"data": {
"id": 2,
"name": "First Line",
"first_name": "First",
"last_name": "Line",
"membership_no": null,
"identity_no": null,
"gender": null,
"birth_at": null,
"profile_id": 1,
"profile": {
"id": 1,
"phones": []
},
"cz_cols": [
{
id: 4,
value: "123456"
},
{
id: 7,
value: "apple"
},
{
id: 18,
value: ["A", "B", "C"]
}
],
"tag_id": [4, 6]
}
}
刪除
DELETE https://{API_HOST}/api/v1/contact/{id}
URL Parameters
PARAMETER
DESCRIPTION
id
客戶的系統編號 #ID
curl -X DELETE
-H "Content-Type: application/json"
https://{API_HOST}/api/v1/contact/2
Last updated