分类

联系人

联系人 – 创建新联系人

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&currentpage=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
}

上一页 短信
下一页 订阅
Table of Contents