联系人
联系人 – 创建新联系人
POST
/api/v2/contact
权限:contact
Header
字段 | 类型 | 描述 |
---|---|---|
Content-Type | 字符串 | 应用或JSON |
参数
字段 | 类型 | 描述 |
---|---|---|
name | 字符串 | |
numbers | 对象数组 | 类似:[{“type”:String,”number”:String},…] |
emails | 对象 | 类似 [{“type”:String,”email”:String},…] |
tag_ids | 字符串数组 | [tagId,tagId…] |
请求样例
{
“name”: “Cai”,
“numbers”: [
{
“type”: “Company”,
“number”: “17314141431”
},
{
“type”: “School”,
“number”: “16213131313”
}
],
“emails”: [
{
“type”: “Company”,
“email”: “[email protected]”
}
],
“tag_ids”: [
“d3ccb1b893d0352124555151ddac05a6”
]
}
成功 200
字段 | 类型 | 描述 |
---|---|---|
id | 字符串 |
成功响应
HTTP/1.1 200 OK
{
“ok”: true,
“id”: “d3ccb1b893d0352124555151ddc5a923”,
“rev”: “1-99a8bf4969373534f23ff63e9981e009”
}
联系人 – 获取全部联系人
GET
/api/v2/contacts
权限:联系人
Header
字段 | 类型 | 描述 |
---|---|---|
Content-Type | 字符串 | 应用或JSON |
参数
字段 | 类型 | 描述 |
---|---|---|
keyword | 字符串 | 搜索关键字(名字、号码、邮箱或tagid) |
items | 数字 | 返回项的数量 |
currentpage | 数字 | 返回项内容的页码 |
请求样例
/api/v2/contacts?items=100¤tpage=1&keyword=16
成功 200
字段 | 类型 | 描述 |
---|---|---|
totalRows | 数字 | 根据关键字筛选的联系人总数量 |
rows | 对象数组 | 联系人列表 |
成功响应
HTTP/1.1 200 OK
{ “totalRows”:4},
“rows”:[{“name”:”tom”,”numbers”:[{“type”:”Company”,”number”:”164832443241″},{“type”:”School”,”number”:”16234234241″}],”emails”:[{“type”:”School”,”email”:”[email protected]”},{“type”:”Company”,”email”:”[email protected]”}],”tag_ids”:[],”doc_type”:”contact”,”created_date”:1539246059086},
{“name”:”Alen”,”number”:”144732443242″,”numbers”:[{“type”:”Company”,”number”:”163732443242″},{“type”:”China”,”number”:”154284375822″}],”emails”:[],”tag_ids”:[],”doc_type”:”contact”,”created_date”:1538987721552,”modified_date”:1539245821489},
{“name”:”carter”,”numbers”:[{“type”:”Home”,”number”:”16473243224″}],”emails”:[],”tag_ids”:[],”doc_type”:”contact”,”created_date”:1539246138091},
{“name”:”haiyan”,”numbers”:[{“type”:”Company”,”number”:”164732443242″},{“type”:”Home”,”number”:”154732443242″}],”emails”:[{“type”:”Company”,”email”:”[email protected]”}],”doc_type”:”contact”,”created_date”:1538987702715,”modified_date”:1539245821489}]
}
联系人 – 更新联系人
PUT
/api/v2/contact/:id
权限:联系人
字段 | 类型 | 描述 |
---|---|---|
Content-Type | 字符串 | 应用或JSON |
参数
字段 | 类型 | 描述 |
---|---|---|
name | 字符串 | |
numbers | 对象数组 | 类似: [{“type”:String,”number”:String},…] |
emails | 对象数组 | 类似: [{“type”:String,”email”:String},…] |
tag_ids | 字符串数组 | [tagId,tagId…] |
请求样例
/api/v2/contact/d3ccb1b893d0352124555151ddc5a923
{
“name”:”Caiwei”,
“numbers”:[{“type”:”Company”,”number”:”17314141431″}],
“emails”:[{“type”:”Home”,”email”:”[email protected]”}],
“tag_ids”:[“d3ccb1b893d0352124555151ddac05a6”]
}
成功 200
字段 | 类型 | 描述 |
---|---|---|
id | 字符串 |
成功响应
HTTP/1.1 200 OK
{
“_id”: “d3ccb1b893d0352124555151ddc5a923”,
“_rev”: “2-b09912e678341a2a79c4c1c3129e5bb0”,
“name”: “Caiwei”,
“numbers”: [
{
“type”: “Company”,
“number”: “17314141431”
}
],
“emails”: [
{
“type”: “Home”,
“email”: “[email protected]”
}
],
“tag_ids”: [
“d3ccb1b893d0352124555151ddac05a6”
],
“doc_type”: “contact”,
“created_date”: 1539248841297,
“modified_date”: 1539249790186
}