WhatsApp Chat Api
WhatsApp Chat Api
developing ❗❗❗
Precautions for interface interconnection
Different from the previous encryption logic. the parameters involved in encryption are placed in the request header. and the original request body is no longer used.❗❗❗
- common request header params
field | type | required | description |
---|---|---|---|
tenant_id | int | y | tenant id |
userId | string | n | user id |
timestamp | Long | y | current timestamp 1710936559123 |
token | string | y | token |
- token generation rule!
token = md5(tenant_id + timestamp + ApiKey). 32 bit lowercase.
timestamp is api request timestamp(ex: 1710936559123).
🌟🌟🌟 tenant_id ApiKey userId How to get Contact customer service
api request limit 1s 500 count.
webhook fail request retry infomation.
retry times: 6
retry interval: 10s 30s 3m 5m 30m 2h
- The criteria for a successful webhook request are http status code is 200. and response body data code is 200 or 0 it's mean ok.
Group send task
group send task friend limit is 5000. A single message cannot be larger than 1024.
specify whatsapp,single object
- type
API
- URI
/group-dispatch-api/gsTask/assign/soCreate
- request mode
POST、Content-Type: application/json
- Interface description
Create a group task and specify a sending destination. Multiple or single items are supported.
- request params
field | type | required | description |
---|---|---|---|
name | string | n | name |
startTaskTime | string | n | start time default time is now |
endTaskTime | string | n | end time |
sendType | int | n | send type 1 PC 2 mobile WaChat default PC |
targetType | int | y | object type 1 person 2 group |
sendWhatsApp | string | y | send whatsapp |
friendWhatsApp | string | y | friend whatsapp |
content | list | y | content |
- content params
field | type | required | description |
---|---|---|---|
type | int | y | type 1 text 2 picture 3 audio 4 file |
text | string | n | text |
url | string | n | meta file |
sort | int | n | sort |
variableFields | list | n | variables |
transId | string | n | transId |
- variableFields params
field | type | required | description |
---|---|---|---|
type | int | y | type 1、basic field 2、extend field (manager web add) |
name | string | y | field name |
- basic fields
field | description |
---|---|
friendName | name |
sex | sex |
birthday | birthday |
address | address |
profession | profession |
income | income |
desc | desc |
source | source |
stage | stage |
languageTag | language tag |
tabName | tab |
followStatus | follow status |
- example-1:
{
"name": "task-202403201653119191",
"sendType": 1,
"startTaskTime": "2024-04-21 17:01:27",
"targetType": 1,
"sendWhatsApp": "8618217331213",
"friendWhatsApp": "8618217331211",
"content": [
{
"type": 1,
"text": "hello world",
"url": "",
"sort": 0,
"variableFields": [],
"transId": ""
}
]
}
- example-2:
{
"name": "task-202403201653119191",
"sendType": 1,
"startTaskTime": "2024-04-21 17:01:27",
"targetType": 1,
"sendWhatsApp": "8618217331213",
"friendWhatsApp": "8618217331211",
"content": [
{
"type": 1,
"text": "hello {friendName}.",
"url": "",
"sort": 0,
"variableFields": [
{
"type": 1,
"name": "friendName",
}
],
"transId": ""
}
]
}
response data
field type required description code int y code message string y msg data string y data data
field | type | required | description |
---|---|---|---|
taskId | string | y | task id |
- response example
{
"code": 200,
"message": "Success",
"data": {
"taskId": "6a2724fa2b7055971f960cc162632595"
}
}
specify customer service number & multiple targets, same content
- type
API
- URI
/group-dispatch-api/gsTask/assign/moscCreate
- request mode
POST、Content-Type: application/json
- Interface description
Create a group task. multiple customer service numbers. multiple sending targets. support multiple and single content.
- request params
field | type | required | description |
---|---|---|---|
name | string | n | name |
startTaskTime | string | n | start time |
endTaskTime | string | n | end time |
sendType | int | n | send type 1 PC 2 mobile WaChat default PC |
targetType | int | y | object type 1 person 2 group |
sendInfos | list | y | send whatsapp info list |
content | list | y | content list |
- sendInfos
field | type | required | description |
---|---|---|---|
sendWhatsApp | string | y | |
friendWhatsApp | string | y | friend whatsapp |
- content
field | type | required | description |
---|---|---|---|
type | int | y | content type 1 text 2 picture 3 audio 4 file |
text | string | n | text |
url | string | n | meta file |
fileName | string | n | file name |
sort | int | n | sort |
variableFields | list | n | variable field list |
transId | string | n | transId |
- variableFields
field | type | required | description |
---|---|---|---|
type | int | y | type 1 basic fields 2 extend field |
name | string | y | field name |
- example-1:
{
"name": "task-202403201653119191",
"sendType": 1,
"startTaskTime": "2024-04-21 17:01:27",
"targetType": 1,
"sendInfos": [
{
"sendWhatsApp": "8618217331213",
"friendWhatsApp": "8618217331211"
}
],
"content": [
{
"type": 1,
"text": "hello world",
"url": "",
"sort": 0,
"variableFields": []
}
]
}
- example-2:
{
"name": "task-202403201653119191",
"sendType": 1,
"startTaskTime": "2024-04-21 17:01:27",
"targetType": 1,
"sendInfos": [
{
"sendWhatsApp": "8618217331213",
"friendWhatsApp": "8618217331211"
}
],
"content": [
{
"type": 1,
"text": "hello {friendName}. aye you ok!",
"url": "",
"sort": 0,
"variableFields": [
{
"type": 1,
"name": "friendName",
}
]
}
]
}
response data
field type required description code int y code message string y msg data string y data data
field type required description taskId string y task id example
{
"code": 200,
"message": "Success",
"data": {
"taskId": "6a2724fa2b7055971f960cc162632595"
}
}
specify customer service number & multiple goals, different content
- type
API
- URI
/group-dispatch-api/gsTask/assign/modcCreate
- request mode
POST、Content-Type: application/json
- request params
field | type | required | description |
---|---|---|---|
name | string | n | name |
startTaskTime | string | n | start time |
endTaskTime | string | n | end time |
sendType | int | n | send type 1 PC 2 mobile WaChat default PC |
targetType | int | y | object type 1 person 2 group |
sendInfos | list | y | send info |
- sendInfos
field | type | required | description |
---|---|---|---|
sendWhatsApp | string | y | |
friendWhatsApp | string | y | friend whatsapp |
content | list | y | content |
- content
field | type | required | description |
---|---|---|---|
type | int | y | type 1 text 2 pic 3、audio 4、file |
text | string | n | text |
url | string | n | meta file |
sort | int | n | sort |
variableFields | list | n | variable fields |
transId | string | n | transId |
- variableField
field | type | required | description |
---|---|---|---|
type | int | y | type 1 basic field 2 extend field |
name | string | y | field |
- example-1:
{
"name": "task-202403201653119191",
"targetType": 1,
"startTaskTime": "2024-04-22 10:29:55",
"endTaskTime": null,
"sendType": 2,
"sendInfos": [
{
"sendWhatsApp": "8618217331213",
"friendWhatsApp": "8618217331211",
"content": [
{
"type": 1,
"text": "hello world",
"url": "",
"sort": 0,
"variableFields": []
}
]
}
]
}
response data
field type required description code int y code message string y msg data string y data data
field type required description taskId string y task id response example
{
"code": 200,
"message": "Success",
"data": {
"taskId": "6a2724fa2b7055971f960cc162632595"
}
}
no customer service number specified, single target
- type
API
- URI
/group-dispatch-api/gsTask/noAssign/soCreate
- request mode
POST、Content-Type: application/json
- Interface description
Create a group task and specify a sending destination. Multiple or single items are supported.
- request params
field | type | required | description |
---|---|---|---|
name | string | n | name |
startTaskTime | string | n | start time |
endTaskTime | string | n | end time |
sendType | int | n | send type 1 PC 2 mobile WaChat default PC |
targetType | int | y | object type 1 person 2 group |
friendWhatsApp | string | y | friend whatsapp |
content | list | y | content list |
- content
field | type | required | description |
---|---|---|---|
type | int | y | type 1 text 2 picture 3 audio 4 file |
text | string | n | text |
url | string | n | meta file |
sort | int | n | sort |
variableFields | list | n | variableFields |
transId | string | n | transId |
- variableField
field | type | required | description |
---|---|---|---|
type | int | y | type 1 basic field 2 extend field |
name | string | y | field |
- example-1:
{
"name": "task-202403201653119191",
"startTaskTime": "2024-04-22 10:29:55",
"endTaskTime": null,
"sendType": 2,
"targetType": 1,
"friendWhatsApp": "8618217331211",
"content": [
{
"type": 1,
"text": "hello world",
"url": "",
"sort": 0,
"variableFields": []
}
]
}
- example-2:
{
"name": "task-202403201653119191",
"targetType": 1,
"startTaskTime": "2024-04-22 10:29:55",
"endTaskTime": null,
"sendType": 2,
"friendWhatsApp": "8618217331211",
"content": [
{
"type": 1,
"text": "hello {friendName}",
"url": "",
"sort": 0,
"variableFields": [
{
"type": 1,
"name": "friendName"
}
]
}
]
}
response data
field type required description code int y code message string y msg data string y data data
field type required description taskId string y task id response example
{
"code": 200,
"message": "Success",
"data": {
"taskId": "6a2724fa2b7055971f960cc162632595"
}
}
no customer service number specified, multiple goals
- type
API
- URI
/group-dispatch-api/gsTask/noAssign/moCreate
- request mode
POST、Content-Type: application/json
- Interface description
Create a group task and specify a sending destination. Multiple or single items are supported.
- request params
field | type | required | description |
---|---|---|---|
name | string | n | name |
startTaskTime | string | n | start time |
endTaskTime | string | n | end time |
sendType | int | n | send type 1 PC 2 mobile WaChat default PC |
targetType | int | y | object type 1 person 2 group |
friendWhatsApp | list | y | friend whatsapp |
content | list | y | content list |
- content
field | type | required | description |
---|---|---|---|
type | int | y | type 1 text 2 picture 3 audio 4 file |
text | string | n | text |
url | string | n | meta file |
sort | int | n | sort |
variableFields | list | n | variableFields |
transId | string | n | transId |
- variableField
field | type | required | description |
---|---|---|---|
type | int | y | type 1 basic field 2 extend field |
name | string | y | field |
- example-1:
{
"name": "task-202403201653119191",
"startTaskTime": "2024-04-22 10:29:55",
"endTaskTime": null,
"sendType": 2,
"targetType": 1,
"friendWhatsApp": ["8618217331211"],
"content": [
{
"type": 1,
"text": "hello world",
"url": "",
"sort": 0,
"variableFields": []
}
]
}
- example-2:
{
"targetType": 1,
"startTaskTime": "2024-04-22 10:29:55",
"endTaskTime": null,
"sendType": 2,
"friendWhatsApp": ["8618217331211"],
"content": [
{
"type": 1,
"text": "hello {friendName}",
"url": "",
"sort": 0,
"variableFields": [
{
"type": 1,
"name": "friendName"
}
]
}
]
}
response data
field type required description code int y code message string y msg data string y data data
field | type | required | description |
---|---|---|---|
taskId | string | y | task id |
- response example
{
"code": 200,
"message": "Success",
"data": {
"taskId": "6a2724fa2b7055971f960cc162632595"
}
}
⭐ no customer service number specified, conditional target
type
API
URI
/group-dispatch-api/gsTask/noAssign/comoCreate
request mode
POST、Content-Type: application/json
Interface description
Create a group task, do not specify a customer service number, search and send targets according to conditions, and support automated behavior.
request params
field | type | required | description |
---|---|---|---|
name | string | n | name |
startTaskTime | string | n | start time |
endTaskTime | string | n | end time |
sendType | int | n | send type 1 PC 2 mobile WaChat default PC |
targetType | int | y | object type 1 person 2 group |
targetAudienceCondition | list | y | Target audience condition |
automatedBehavior | list | n | Automatic triggering behavior |
content | list | y | content list |
- targetAudienceCondition
field | type | required | description |
---|---|---|---|
type | string | y | type 1 basic field 2 extend field |
name | string | y | name |
opsType | int | n | ops type 1 < 2 = 3 > 4 >= 5 <= |
value | string | n | value |
rangeValueStart | string | n | start value (opsType=4) |
rangeValueEnd | string | n | end value (opsType=4) |
- automatedBehavior
field | type | required | description |
---|---|---|---|
eventType | int | y | event type 1 send success 2 send fail |
actionType | int | y | action type 1 customer phase change 2 customer tag change |
opsType | int | y | ops type 1 add 2 del 3 update |
customerTagValue | list | n | tag value list |
customerStageValue | int | n | customer phase |
- content
field | type | required | description |
---|---|---|---|
type | int | y | type 1 text 2 picture 3 audio 4 file |
text | string | n | text |
url | string | n | meta file |
sort | int | n | sort |
variableFields | list | n | variableFields |
transId | string | n | transId |
- variableField
field | type | required | description |
---|---|---|---|
type | int | y | type 1 basic field 2 extend field |
name | string | y | field |
- example-1:
{
"name": "task-20240320175301",
"targetType": 1,
"startTaskTime": "2024-04-22 10:29:55",
"endTaskTime": null,
"sendType": 2,
"targetAudienceCondition": [
{
"type": "1",
"name": "Age",
"opsType": "1",
"value": "20"
},
{
"type": "1",
"name": "money",
"opsType": "4",
"rangeValueStart": "5000",
"rangeValueEnd": "10000"
}
],
"automatedBehavior": [
{
"eventType": "1",
"actionType": "1",
"opsType": "3",
"customerTagValue": "ok"
}
],
"content": [
{
"type": 1,
"text": "hello world",
"url": "",
"sort": 0,
"variableFields": []
}
]
}
- example-2:
{
"name": "task-20240320175301",
"targetType": 1,
"startTaskTime": "2024-04-22 10:29:55",
"endTaskTime": null,
"sendType": 2,
"content": [
{
"type": 1,
"text": "hello {friendName}",
"url": "",
"sort": 0,
"variableFields": [
{
"type": 1,
"name": "friendName"
}
]
}
],
"targetAudienceCondition": [
{
"type": "1",
"name": "Age",
"opsType": "1",
"value": "20"
},
{
"type": "1",
"name": "money",
"opsType": "4",
"rangeValueStart": "5000",
"rangeValueEnd": "10000"
}
],
"automatedBehavior": [
{
"eventType": "1",
"actionType": "1",
"opsType": "3",
"customerTagValue": "ok"
}
]
}
response data
field type required description code int y code message string y msg data string y data data
field | type | required | description |
---|---|---|---|
taskId | string | y | task id |
- response example
{
"code": 200,
"message": "Success",
"data": {
"taskId": "6a2724fa2b7055971f960cc162632595"
}
}
Example Query the execution status of a group task
- type
API
- URI
/group-dispatch-api/gsTask/queryExecuteStatus
- request mode
Get、Content-Type: application/json
- Interface description
Example Query the execution status of a group task
- request params
field | type | required | description |
---|---|---|---|
taskId | string | y | task id |
- example:
group-dispatch-api/gsTask/queryExecuteStatus?taskId=174
response data
field type required description code int y code message string y msg data Object y data data
field type required description info list y info taskId string y task id status int y status 1 to start 2 to send 3 sending 4 stopped 5 completed 6 suspended info
field type required description whatsApp string y whatsapp friendWhatsApp string y friend whatsapp status int y status 0 to be delivered 1 to be sent 2 sending 3 sent 4 arrived 5 read 6 read back 7 read not returned -1 sending failed time string y time response example
{
"data": {
"taskId": "7ecb410f496db67f549aac211cf2be7d",
"status": 1,
"info": [
{
"whatsApp": "86172162521",
"friendWhatsApp": "86172162521",
"time": "2023-07-12 10:43:00",
"status": 1
},
{
"whatsApp": "86172162522",
"friendWhatsApp": "86172162522",
"time": "2023-07-12 10:43:00",
"status": 2
}
]
},
"code": 200,
"message": "success"
}
Asynchronous notification group task execution status
- type
WebHook
- URI
/callback/gsTask/syncTaskStatus
- request mode
POST、Content-Type: application/json
- Interface description
Asynchronous notification of order execution status
- request params
field | type | required | description |
---|---|---|---|
taskId | string | y | task id |
status | int | y | Task status 1 Waiting to start 2 Waiting to send 3 group sending 4 stopped 5 completed 6 suspended |
example:
{
"taskd": "6a2724fa2b7055971f960cc162632595",
"status": 1
}
- response data
field type required description code int y code message string y msg data Object y data
{
"data": "",
"code": 200,
"message": "success"
}
Asynchronous notification group task info execution status
- type
WebHook
- URI
/callback/gsTask/syncGsTaskInfoStatus
- request mode
POST、Content-Type: application/json
- Interface description
Asynchronous notification group task info execution status
- request params
field | type | required | description |
---|---|---|---|
groupSendInfoStatusList | list | y | task info list |
- request params
field | type | required | description |
---|---|---|---|
taskId | string | y | task id |
info | list | y | task info |
- info
field | type | required | description |
---|---|---|---|
senderWhatsApp | string | n | send whatsapp |
friendWhatsApp | string | y | friend whatsapp |
status | int | y | Status 0 to be delivered 1 to be sent 2 Sending 3 sent 4 arrived 5 read 6 read back 7 read not returned -1 sending failed |
time | long | y | time |
infoId | int | y | info id |
failReasonCode | int | n | fail code |
transId | string | n | transId |
failReasonCode Explanation: 4001 Customer service number blocked or offline. 4004 failed to send content static resource download. 4005 client exit unexpectedly.
- example:
{
"groupSendInfoStatusList": [
{
"taskId": "6a2724fa2b7055971f960cc162632595",
"info": [
{
"senderWhatsApp": "861271625212",
"friendWhatsApp": "911827121626",
"time": 1721358108467,
"status": 1,
"infoId": 95,
"failReasonCode": null,
"transId": null
},
{
"senderWhatsApp": "861271625212",
"friendWhatsApp": "911827121621",
"time": 1721358108467,
"status": 1,
"infoId": 96,
"failReasonCode": null,
"transId": null
}
]
}
]
}
- response data
field type required description code int y code message string y msg data Object y data
{
"data": "",
"code": 200,
"message": "success"
}
Asynchronous notification group task - Reply message callback
- type
WebHook
- URI
/callback/gsTask/syncGsTaskInfoReplyMessage
- request mode
POST、Content-Type: application/json
- Interface description
Asynchronous notification group task - Reply message callback
- request params
field | type | required | description |
---|---|---|---|
userId | string | y | user id |
serialNumber | int | n | number |
string | y | ||
friendWhatsApp | string | y | friendWhatsApp |
taskId | string | y | task id |
content | list | y | content |
- content
field | type | required | description |
---|---|---|---|
type | int | y | type 1 text 2 picture 3、audio 4、picture 5 video |
text | string | n | text |
url | string | n | meta url |
messageId | string | y | message id |
time | long | y | time |
- url
field | type | required | description |
---|---|---|---|
filename | string | y | 文件名称 |
url | string | y | 链接地址 |
mimeType | string | y | 媒体type |
caption | string | n | 标题 |
example:
{
"userId": "101",
"serialNumber": "",
"whatsApp": "86172272727",
"friendWhatsApp": "61191828282",
"taskId": "6a2724fa2b7055971f960cc162632595",
"content": [
{
"type": 1,
"text": "hello",
"messageId": "19282dskdasldjl21",
"time": 1689129792000
},
{
"type": 2,
"url": {
"filename": "e70faa31-62dc-4d00-a42a-8a07735aa350",
"url": "https://id-wscrm.oss-accelerate.aliyuncs.com/client/d584b8cfb9185cc999389f17b4236b3b/61733005-dfdb-4704-9c5d-944423c70dd1",
"mimeType": "image/jpeg",
"caption": ""
},
"messageId": "1282190210219082198",
"time": 1689129792000
}
]
}
- response data
field type required description code int y code message string y msg data Object y data
{
"data": "",
"code": 200,
"message": "success"
}
Message sending
Message sending interface
- type
API
- URI
/wscrm-bus-api/chat/message
- request mode
POST、Content-Type: application/json
- Interface description
You can send a message with multiple or single contents.
- request params
field | type | required | description |
---|---|---|---|
targetType | int | y | object type 1 person 2 group |
string | n | ||
friendWhatsApp | string | y | friend whatsapp |
content | list | y | content list |
- content
field | type | required | description |
---|---|---|---|
type | int | y | type 1 text 2 picture 3、audio 4、file |
text | string | n | text |
url | string | n | meta file |
sort | int | n | sort |
busChatId | string | n | business chat id |
transId | string | n | transId |
- example:
{
"targetType": 1,
"whatsApp": "8618217331213",
"friendWhatsApp": "8618217331211",
"content": [
{
"type": 1,
"text": "hello world",
"url": "",
"sort": 1,
"busChatId": "12222233223asdasd"
}
]
}
- response data
field type required description code int y code message string y msg data string y data - response example
{
"code": 200,
"message": "Success",
"data": {}
}
Message synchronization interface
- type
WebHook
- URI
/callback/message/sync
- request mode
POST、Content-Type: application/json
- Interface description
Chat message synchronization
- request params
field | type | required | description |
---|---|---|---|
messageList | list | y | message list |
- messageList
field | type | required | description |
---|---|---|---|
userId | string | y | user id |
messageId | string | y | message id |
transId | string | n | transId |
messageTime | string | y | message time |
string | y | ||
friendWhatsApp | string | y | friend whatsapp |
type | int | y | type |
text | string | y | text |
url | string | y | meta url |
message type 1 text 2 picture 3、audio 4、file 5、video
- example:
{
"messageList": [
{
"userId": "101",
"whatsApp": "912929292222",
"friendWhatsApp": "919229292992",
"messageId": "6a2724fa2b7055971f960cc162632595",
"type": "1",
"text": "hello boy",
"url": "",
"messageTime": "2021-07-12 11:04:01"
}
]
}
- response data
field type required description code int y code message string y msg data Object y data
{
"data": "",
"code": 200,
"message": "success"
}
Message status synchronization interface
- type
WebHook
- URI
/callback/message/statusSync
- request mode
POST、Content-Type: application/json
- Interface description
Chat message synchronization
- request params
field | type | required | description |
---|---|---|---|
messageStatusList | list | y | message status list |
- messageStatus
field | type | required | description |
---|---|---|---|
userId | string | y | user id |
messageId | string | y | message id |
string | y | ||
friendWhatsApp | string | y | friend whatsapp |
status | int | y | Status 0 to be delivered 1 to be sent 2 Sending 3 sent 4 arrived 5 read 6 read not returned 7 read back -1 sending failed |
- example:
{
"messageStatusList": [
{
"userId": "1222",
"whatsApp": "912929292222",
"friendWhatsApp": "919229292992",
"messageId": "6a2724fa2b7055971f960cc162632595",
"status": 1
},
{
"userId": "121211",
"whatsApp": "912929292222",
"friendWhatsApp": "919229292992",
"messageId": "6a2724fa2b7055971f960cc162632595",
"status": 1
}
]
}
- response data
field type required description code int y code message string y msg data Object y data
{
"data": "",
"code": 200,
"message": "success"
}
User & Customer service number
Search online agent (customer service number)
- type
API
- URI
/group-dispatch-api/user/queryUserStatus
- request mode
POST、Content-Type: application/json
- Interface description
Search online agent (customer service number)
- request params
field | type | required | description |
---|---|---|---|
userId | int | n | user id |
source | int | y | source 1 pc 2 mobile |
- example:
{
"userId": 12,
"source": 2
}
response data
field type required description code int y code message string y msg data list y data data
field type required description userId int y user id userName string y user name whatsAppList list y whatsapp list whatsAppList
field type required description whatsApp string y whatsApp name string n name response example
{
"data": [
{
"userId": 12,
"userName": "u1",
"whatsAppList": [
{
"whatsApp": "861821371272",
"name": "jack"
}
]
}
],
"code": 200,
"message": "success"
}
Example Query online status logs of an agent (customer service number)
- type
API
- URI
/group-dispatch-api/user/queryUserStatusLog
- request mode
POST、Content-Type: application/json
- Interface description
Querying Agent (customer service number) Online status logs (Latest 50 logs)
- request params
field | type | required | description |
---|---|---|---|
userName | string | n | user name |
string | n | ||
source | int | y | source 1 pc 2 mobile |
- example:
{
"userName": "",
"whatsApp": "573125704139",
"source": 2
}
response data
field type required description code int y code message string y msg data list y data data
field type required description userId int y user id userName string y user name whatsAppList list y whatsapp list (limit 50) whatsAppList
field type required description whatsApp string y whatsApp name string n name status int y status 10 online 20 offline 30 offline(out) 40 blocked source int y source 1 pc 2 mobile countryCode string y country detailStatus int y status createTime int y create time detailStatus code
code | msg |
---|---|
11 | PC scan code for login |
12 | PC online |
13 | mobile online |
21 | PC offline |
22 | mobile offline (out) |
31 | PC close whatsapp offline |
32 | PC close client offline |
33 | PC Trigger monitor offline |
34 | mobile del offline |
35 | mobile login out |
36 | mobild trigger monitor offline |
37 | mobile exception offline |
41 | pc blocked |
42 | mobile blocked |
43 | forever blocked |
- response example
{
"code": 200,
"message": "Success",
"data": [
{
"userId": 621443,
"userName": "lsl001",
"whatsAppList": [
{
"whatsApp": "573125704139",
"name": "",
"status": 20,
"source": 2,
"countryCode": "Colombia",
"detailStatus": 42,
"createTime": "2024-07-08 19:25:31"
}
]
}
]
}
Query the status of the agent's recently online customer service number (last 10)
- type
API
- URI
/group-dispatch-api/user/getLatestOnlineWhatsAccount
- request mode
POST、Content-Type: application/json
- Interface description
Query the status of the agent's recently online customer service number (last 10)
- request params
field | type | required | description |
---|---|---|---|
userId | int | n | user id |
source | int | y | source 1 pc 2 mobile |
- example:
{
"userId": 621443,
"source": 1
}
- response data
field type required description code int y code message string y msg data list y data - data
field type required description userId int y user id userName string y user name whatsAppList list y whatsapp list - whatsAppList
field type required description whatsApp string y whatsApp name string n name status int n status 10 online 20 offline 30 offline(out) 40 blocked - response example
{
"code": 200,
"message": "Success ",
"data": [
{
"userName": "lsl001",
"whatsAppList": [
{
"whatsApp": "234567892",
"name": "zhang",
"status": 10
}
],
"userId": 621443
}
]
}
Query the latest status of customer service number
- type
API
- URI
/wscrm-bus-api/whatsapp/queryWhatsappStatus
- request mode
POST、Content-Type: application/json
- Interface description
Query the latest status of customer service number
- request params
field | type | required | description |
---|---|---|---|
string | y |
- example:
{
"whatsApp": "8218132718231"
}
response data
field type required description code int y code message string y msg data Object y data data参数说明
field type required description status int y status 0 offline 1 online 2 blocked response example
{
"data": {
"status": 1
},
"code": 200,
"message": "success"
}
Batch update customer service number information
- type
API
- URI
/wscrm-bus-api/whatsapp/batchUpdate
- request mode
POST、Content-Type: application/json
- Interface description
Batch update customer service number information
- request params
field | type | required | description |
---|---|---|---|
whatsAppList | list | y | whatsapp list |
- data
field | type | required | description |
---|---|---|---|
avatar | string | y | avatar |
string | y | ||
name | string | y | name |
- example:
{
"whatsAppList": [
{
"whatsApp": "861821726232",
"name": "lee",
"avatar": "wwww.baiux.com/1.img"
}
]
}
response data
field type required description code int y code message string y msg data string y data response example
{
"data": "",
"code": 200,
"message": "success"
}
Batch online customer service number
- type
API
- URI
/wscrm-bus-api/whatsapp/batchOnline
- request mode
POST、Content-Type: application/json
- Interface description
Batch online customer service number
- request params
field | type | required | description |
---|---|---|---|
whatsAppList | list | y | whatsapp list |
- example:
{
"whatsAppList": ["861821726232", "861821726231"]
}
response data
field type required description code int y code message string y msg data string y data response example
{
"data": "",
"code": 200,
"message": "success"
}
Batch recovery customer service number
- type
API
- URI
/wscrm-bus-api/whatsapp/recycle
- request mode
POST、Content-Type: application/json
- Interface description
Batch recovery customer service number
- request params
field | type | required | description |
---|---|---|---|
userId | int | n | user id |
platform | int | n | platform 1 pc 2 wachat |
whatsAppList | list | n | whatsapp list |
serialNumber | int | n | number |
- example:
{
"userId": "101",
"platform": "1",
"serialNumber": "",
"whatsAppList": ["861821726232", "861821726231"]
}
response data
field type required description code int y code message string y msg data string y data response example
{
"data": "",
"code": 200,
"message": "success"
}
Contact person
Contact query
- type
API
- URI
/wscrm-bus-api/friend/search
- request mode
POST、Content-Type: application/json
- Interface description
Contact query
- request params
field | type | required | description |
---|---|---|---|
userId | int | y | user id |
list | y | ||
name | string | n | name |
- example:
{
"userId": "101",
"name": "",
"whatsAppList": []
}
- response data
field type required description code int y code message string y msg data string y data - data
field type required description friendWhatsApp list y friend whatsapp - friendWhatsApp
field type required description whatsApp string y whatsapp name string y name - response example
{
"code": 200,
"message": "success",
"data": {
"friendWhatsApp": [
{
"whatsApp": "8618282182828",
"name": "mike"
}
]
}
}
Update contact info
- type
API
- URI
/wscrm-bus-api/friend/update
- request mode
POST、Content-Type: application/json
- Interface description
Update contact info
- request params
field | type | required | description |
---|---|---|---|
userId | int | n | user id |
string | y | ||
name | string | y | name |
- example:
{
"userId": "101",
"whatsApp": "861727172722",
"name": "hello test"
}
- response data
field type required description code int y code message string y msg data string y data
{
"code": 200,
"message": "success",
"data": ""
}
del contact
- type
API
- URI
/wscrm-bus-api/friend/del
- request mode
POST、Content-Type: application/json
- Interface description
del contact
- request params
field | type | required | description |
---|---|---|---|
userId | int | n | user id |
whatsAppList | list | n | whatsapp list |
- example:
{
"userId": "101",
"whatsApp": []
}
- response data
field type required description code int y code message string y msg data string y data
{
"code": 200,
"message": "success",
"data": ""
}