2chat-contacts
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese2Chat — Contacts
2Chat — 联系人
Authentication
身份验证
All requests require the header:
X-User-API-Key: <api_key>API keys are generated at app.2chat.io/developers. Base URL:
https://api.p.2chat.io/open所有请求均需包含以下请求头:
X-User-API-Key: <api_key>API密钥可在app.2chat.io/developers生成。基础URL:
https://api.p.2chat.io/openList contacts
列出联系人
http
GET /contactsQuery params: , (1-100), (filter by connected number).
page_numberresults_per_pagechannel_uuidReturns contacts with , , , , , and (phone numbers, emails).
uuidfirst_namelast_namechannel_uuidprofile_pic_urldetailshttp
GET /contacts查询参数:(页码)、(每页结果数,范围1-100)、(按关联号码筛选)。
page_numberresults_per_pagechannel_uuid返回包含、、、、以及(电话号码、邮箱)的联系人信息。
uuidfirst_namelast_namechannel_uuidprofile_pic_urldetailsGet a contact
获取单个联系人
http
GET /contacts/{contact_uuid}Returns contact details by UUID. Obtain UUIDs via list or search.
http
GET /contacts/{contact_uuid}通过UUID返回联系人详细信息。可通过列出或搜索操作获取UUID。
Search contacts
搜索联系人
http
GET /contacts/search?q={phone_or_name}Query params: (required — phone number or name), (filter by number), , (1-100).
qchannel_uuidpage_numberresults_per_pageReturns matching contacts with linked details.
http
GET /contacts/search?q={phone_or_name}查询参数:(必填——电话号码或姓名)、(按号码筛选)、、(1-100)。
qchannel_uuidpage_numberresults_per_page返回匹配的联系人及其关联详情。
Create a contact
创建联系人
http
POST /contactsjson
{
"first_name": "John",
"last_name": "Doe",
"profile_pic_url": "https://example.com/photo.jpg",
"channel_uuid": "WPN-uuid",
"contact_detail": [
{ "type": "WAPH", "value": "+15551234567" },
{ "type": "E", "value": "john@example.com" }
]
}Detail types:
| Type | Description |
|---|---|
| Phone number |
| WhatsApp phone number |
| |
| Address |
Setting syncs the contact to that WhatsApp number.
channel_uuidhttp
POST /contactsjson
{
"first_name": "John",
"last_name": "Doe",
"profile_pic_url": "https://example.com/photo.jpg",
"channel_uuid": "WPN-uuid",
"contact_detail": [
{ "type": "WAPH", "value": "+15551234567" },
{ "type": "E", "value": "john@example.com" }
]
}详情类型:
| 类型 | 描述 |
|---|---|
| 电话号码 |
| WhatsApp电话号码 |
| 邮箱 |
| 地址 |
设置会将联系人同步至对应的WhatsApp号码。
channel_uuidUpdate a contact
更新联系人
http
PUT /contacts/{contact_uuid}json
{
"first_name": "John",
"last_name": "Smith",
"profile_pic_url": "https://example.com/new-photo.jpg",
"channel_uuid": "WPN-uuid",
"contact_details": {}
}Changing syncs the contact to the new WhatsApp number.
channel_uuidhttp
PUT /contacts/{contact_uuid}json
{
"first_name": "John",
"last_name": "Smith",
"profile_pic_url": "https://example.com/new-photo.jpg",
"channel_uuid": "WPN-uuid",
"contact_details": {}
}修改会将联系人同步至新的WhatsApp号码。
channel_uuidDelete a contact
删除联系人
http
DELETE /contacts/{contact_uuid}http
DELETE /contacts/{contact_uuid}