2chat-contacts

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

2Chat — Contacts

2Chat — 联系人

Manage your contact directory via the 2Chat API.
通过2Chat API管理您的联系人目录。

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/open

List contacts

列出联系人

http
GET /contacts
Query params:
page_number
,
results_per_page
(1-100),
channel_uuid
(filter by connected number).
Returns contacts with
uuid
,
first_name
,
last_name
,
channel_uuid
,
profile_pic_url
, and
details
(phone numbers, emails).
http
GET /contacts
查询参数:
page_number
(页码)、
results_per_page
(每页结果数,范围1-100)、
channel_uuid
(按关联号码筛选)。
返回包含
uuid
first_name
last_name
channel_uuid
profile_pic_url
以及
details
(电话号码、邮箱)的联系人信息。

Get 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:
q
(required — phone number or name),
channel_uuid
(filter by number),
page_number
,
results_per_page
(1-100).
Returns matching contacts with linked details.
http
GET /contacts/search?q={phone_or_name}
查询参数:
q
(必填——电话号码或姓名)、
channel_uuid
(按号码筛选)、
page_number
results_per_page
(1-100)。
返回匹配的联系人及其关联详情。

Create a contact

创建联系人

http
POST /contacts
json
{
  "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:
TypeDescription
PH
Phone number
WAPH
WhatsApp phone number
E
Email
A
Address
Setting
channel_uuid
syncs the contact to that WhatsApp number.
http
POST /contacts
json
{
  "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" }
  ]
}
详情类型:
类型描述
PH
电话号码
WAPH
WhatsApp电话号码
E
邮箱
A
地址
设置
channel_uuid
会将联系人同步至对应的WhatsApp号码。

Update 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
channel_uuid
syncs the contact to the new WhatsApp number.
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": {}
}
修改
channel_uuid
会将联系人同步至新的WhatsApp号码。

Delete a contact

删除联系人

http
DELETE /contacts/{contact_uuid}
http
DELETE /contacts/{contact_uuid}