Skip to main content

WhatsApp Chat Api

About 13 min

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
fieldtyperequireddescription
tenant_idintytenant id
userIdstringnuser id
timestampLongycurrent timestamp 1710936559123
tokenstringytoken
  • 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
fieldtyperequireddescription
namestringnname
startTaskTimestringnstart time default time is now
endTaskTimestringnend time
sendTypeintnsend type 1 PC 2 mobile WaChat default PC
targetTypeintyobject type 1 person 2 group
sendWhatsAppstringysend whatsapp
friendWhatsAppstringyfriend whatsapp
contentlistycontent
  • content params
fieldtyperequireddescription
typeintytype 1 text 2 picture 3 audio 4 file
textstringntext
urlstringnmeta file
sortintnsort
variableFieldslistnvariables
transIdstringntransId
  • variableFields params
fieldtyperequireddescription
typeintytype 1、basic field 2、extend field (manager web add)
namestringyfield name
  • basic fields
fielddescription
whatsAppwhatsapp
friendNamename
sexsex
birthdaybirthday
addressaddress
emailemail
professionprofession
incomeincome
descdesc
sourcesource
stagestage
languageTaglanguage tag
tabNametab
followStatusfollow 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

    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    datastringydata
  • data

fieldtyperequireddescription
taskIdstringytask 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
fieldtyperequireddescription
namestringnname
startTaskTimestringnstart time
endTaskTimestringnend time
sendTypeintnsend type 1 PC 2 mobile WaChat default PC
targetTypeintyobject type 1 person 2 group
sendInfoslistysend whatsapp info list
contentlistycontent list
  • sendInfos
fieldtyperequireddescription
sendWhatsAppstringywhatsapp
friendWhatsAppstringyfriend whatsapp
  • content
fieldtyperequireddescription
typeintycontent type 1 text 2 picture 3 audio 4 file
textstringntext
urlstringnmeta file
fileNamestringnfile name
sortintnsort
variableFieldslistnvariable field list
transIdstringntransId
  • variableFields
fieldtyperequireddescription
typeintytype 1 basic fields 2 extend field
namestringyfield 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

    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    datastringydata
  • data

    fieldtyperequireddescription
    taskIdstringytask 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
fieldtyperequireddescription
namestringnname
startTaskTimestringnstart time
endTaskTimestringnend time
sendTypeintnsend type 1 PC 2 mobile WaChat default PC
targetTypeintyobject type 1 person 2 group
sendInfoslistysend info
  • sendInfos
fieldtyperequireddescription
sendWhatsAppstringywhatsapp
friendWhatsAppstringyfriend whatsapp
contentlistycontent
  • content
fieldtyperequireddescription
typeintytype 1 text 2 pic 3、audio 4、file
textstringntext
urlstringnmeta file
sortintnsort
variableFieldslistnvariable fields
transIdstringntransId
  • variableField
fieldtyperequireddescription
typeintytype 1 basic field 2 extend field
namestringyfield
  • 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

    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    datastringydata
  • data

    fieldtyperequireddescription
    taskIdstringytask 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
fieldtyperequireddescription
namestringnname
startTaskTimestringnstart time
endTaskTimestringnend time
sendTypeintnsend type 1 PC 2 mobile WaChat default PC
targetTypeintyobject type 1 person 2 group
friendWhatsAppstringyfriend whatsapp
contentlistycontent list
  • content
fieldtyperequireddescription
typeintytype 1 text 2 picture 3 audio 4 file
textstringntext
urlstringnmeta file
sortintnsort
variableFieldslistnvariableFields
transIdstringntransId
  • variableField
fieldtyperequireddescription
typeintytype 1 basic field 2 extend field
namestringyfield
  • 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

    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    datastringydata
  • data

    fieldtyperequireddescription
    taskIdstringytask 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
fieldtyperequireddescription
namestringnname
startTaskTimestringnstart time
endTaskTimestringnend time
sendTypeintnsend type 1 PC 2 mobile WaChat default PC
targetTypeintyobject type 1 person 2 group
friendWhatsApplistyfriend whatsapp
contentlistycontent list
  • content
fieldtyperequireddescription
typeintytype 1 text 2 picture 3 audio 4 file
textstringntext
urlstringnmeta file
sortintnsort
variableFieldslistnvariableFields
transIdstringntransId
  • variableField
fieldtyperequireddescription
typeintytype 1 basic field 2 extend field
namestringyfield
  • 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

    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    datastringydata
  • data

fieldtyperequireddescription
taskIdstringytask 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

fieldtyperequireddescription
namestringnname
startTaskTimestringnstart time
endTaskTimestringnend time
sendTypeintnsend type 1 PC 2 mobile WaChat default PC
targetTypeintyobject type 1 person 2 group
targetAudienceConditionlistyTarget audience condition
automatedBehaviorlistnAutomatic triggering behavior
contentlistycontent list
  • targetAudienceCondition
fieldtyperequireddescription
typestringytype 1 basic field 2 extend field
namestringyname
opsTypeintnops type 1 < 2 = 3 > 4 >= 5 <=
valuestringnvalue
rangeValueStartstringnstart value (opsType=4)
rangeValueEndstringnend value (opsType=4)
  • automatedBehavior
fieldtyperequireddescription
eventTypeintyevent type 1 send success 2 send fail
actionTypeintyaction type 1 customer phase change 2 customer tag change
opsTypeintyops type 1 add 2 del 3 update
customerTagValuelistntag value list
customerStageValueintncustomer phase
  • content
fieldtyperequireddescription
typeintytype 1 text 2 picture 3 audio 4 file
textstringntext
urlstringnmeta file
sortintnsort
variableFieldslistnvariableFields
transIdstringntransId
  • variableField
fieldtyperequireddescription
typeintytype 1 basic field 2 extend field
namestringyfield
  • 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

    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    datastringydata
  • data

fieldtyperequireddescription
taskIdstringytask 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
fieldtyperequireddescription
taskIdstringytask id
  • example:

group-dispatch-api/gsTask/queryExecuteStatus?taskId=174

  • response data

    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    dataObjectydata
  • data

    fieldtyperequireddescription
    infolistyinfo
    taskIdstringytask id
    statusintystatus 1 to start 2 to send 3 sending 4 stopped 5 completed 6 suspended
  • info

    fieldtyperequireddescription
    whatsAppstringywhatsapp
    friendWhatsAppstringyfriend whatsapp
    statusintystatus 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
    timestringytime
  • 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
fieldtyperequireddescription
taskIdstringytask id
statusintyTask 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
    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    dataObjectydata
{
  "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
fieldtyperequireddescription
groupSendInfoStatusListlistytask info list
  • request params
fieldtyperequireddescription
taskIdstringytask id
infolistytask info
  • info
fieldtyperequireddescription
senderWhatsAppstringnsend whatsapp
friendWhatsAppstringyfriend whatsapp
statusintyStatus 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
timelongytime
infoIdintyinfo id
failReasonCodeintnfail code
transIdstringntransId

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
    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    dataObjectydata
{
  "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
fieldtyperequireddescription
userIdstringyuser id
serialNumberintnnumber
whatsAppstringywhatsapp
friendWhatsAppstringyfriendWhatsApp
taskIdstringytask id
contentlistycontent
  • content
fieldtyperequireddescription
typeintytype 1 text 2 picture 3、audio 4、picture 5 video
textstringntext
urlstringnmeta url
messageIdstringymessage id
timelongytime
  • url
fieldtyperequireddescription
filenamestringy文件名称
urlstringy链接地址
mimeTypestringy媒体type
captionstringn标题
{
  "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
    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    dataObjectydata
{
  "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
fieldtyperequireddescription
targetTypeintyobject type 1 person 2 group
whatsAppstringnwhatsapp
friendWhatsAppstringyfriend whatsapp
contentlistycontent list
  • content
fieldtyperequireddescription
typeintytype 1 text 2 picture 3、audio 4、file
textstringntext
urlstringnmeta file
sortintnsort
busChatIdstringnbusiness chat id
transIdstringntransId
  • example:
{
  "targetType": 1,
  "whatsApp": "8618217331213",
  "friendWhatsApp": "8618217331211",
  "content": [
    {
      "type": 1,
      "text": "hello world",
      "url": "",
      "sort": 1,
      "busChatId": "12222233223asdasd"
    }
  ]
}
  • response data
    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    datastringydata
  • 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
fieldtyperequireddescription
messageListlistymessage list
  • messageList
fieldtyperequireddescription
userIdstringyuser id
messageIdstringymessage id
transIdstringntransId
messageTimestringymessage time
whatsAppstringywhatsapp
friendWhatsAppstringyfriend whatsapp
typeintytype
textstringytext
urlstringymeta 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
    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    dataObjectydata
{
  "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
fieldtyperequireddescription
messageStatusListlistymessage status list
  • messageStatus
fieldtyperequireddescription
userIdstringyuser id
messageIdstringymessage id
whatsAppstringywhatsapp
friendWhatsAppstringyfriend whatsapp
statusintyStatus 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
    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    dataObjectydata
{
  "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
fieldtyperequireddescription
userIdintnuser id
sourceintysource 1 pc 2 mobile
  • example:
{
  "userId": 12,
  "source": 2
}
  • response data

    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    datalistydata
  • data

    fieldtyperequireddescription
    userIdintyuser id
    userNamestringyuser name
    whatsAppListlistywhatsapp list
  • whatsAppList

    fieldtyperequireddescription
    whatsAppstringywhatsApp
    namestringnname
  • 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
fieldtyperequireddescription
userNamestringnuser name
whatsAppstringnwhatsapp
sourceintysource 1 pc 2 mobile
  • example:
{
  "userName": "",
  "whatsApp": "573125704139",
  "source": 2
}
  • response data

    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    datalistydata
  • data

    fieldtyperequireddescription
    userIdintyuser id
    userNamestringyuser name
    whatsAppListlistywhatsapp list (limit 50)
  • whatsAppList

    fieldtyperequireddescription
    whatsAppstringywhatsApp
    namestringnname
    statusintystatus 10 online 20 offline 30 offline(out) 40 blocked
    sourceintysource 1 pc 2 mobile
    countryCodestringycountry
    detailStatusintystatus
    createTimeintycreate time
  • detailStatus code

codemsg
11PC scan code for login
12PC online
13mobile online
21PC offline
22mobile offline (out)
31PC close whatsapp offline
32PC close client offline
33PC Trigger monitor offline
34mobile del offline
35mobile login out
36mobild trigger monitor offline
37mobile exception offline
41pc blocked
42mobile blocked
43forever 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
fieldtyperequireddescription
userIdintnuser id
sourceintysource 1 pc 2 mobile
  • example:
{
  "userId": 621443,
  "source": 1
}
  • response data
    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    datalistydata
  • data
    fieldtyperequireddescription
    userIdintyuser id
    userNamestringyuser name
    whatsAppListlistywhatsapp list
  • whatsAppList
    fieldtyperequireddescription
    whatsAppstringywhatsApp
    namestringnname
    statusintnstatus 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
fieldtyperequireddescription
whatsAppstringywhatsapp
  • example:
{
  "whatsApp": "8218132718231"
}
  • response data

    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    dataObjectydata
  • data参数说明

    fieldtyperequireddescription
    statusintystatus 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
fieldtyperequireddescription
whatsAppListlistywhatsapp list
  • data
fieldtyperequireddescription
avatarstringyavatar
whatsAppstringywhatsapp
namestringyname
  • example:
{
  "whatsAppList": [
    {
      "whatsApp": "861821726232",
      "name": "lee",
      "avatar": "wwww.baiux.com/1.img"
    }
  ]
}
  • response data

    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    datastringydata
  • 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
fieldtyperequireddescription
whatsAppListlistywhatsapp list
  • example:
{
  "whatsAppList": ["861821726232", "861821726231"]
}
  • response data

    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    datastringydata
  • 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
fieldtyperequireddescription
userIdintnuser id
platformintnplatform 1 pc 2 wachat
whatsAppListlistnwhatsapp list
serialNumberintnnumber
  • example:
{
  "userId": "101",
  "platform": "1",
  "serialNumber": "",
  "whatsAppList": ["861821726232", "861821726231"]
}
  • response data

    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    datastringydata
  • 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
fieldtyperequireddescription
userIdintyuser id
whatsapplistywhatsapp
namestringnname
  • example:
{
  "userId": "101",
  "name": "",
  "whatsAppList": []
}
  • response data
    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    datastringydata
  • data
    fieldtyperequireddescription
    friendWhatsApplistyfriend whatsapp
  • friendWhatsApp
    fieldtyperequireddescription
    whatsAppstringywhatsapp
    namestringyname
  • 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
fieldtyperequireddescription
userIdintnuser id
whatsAppstringywhatsapp
namestringyname
  • example:
{
  "userId": "101",
  "whatsApp": "861727172722",
  "name": "hello test"
}
  • response data
    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    datastringydata
{
  "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
fieldtyperequireddescription
userIdintnuser id
whatsAppListlistnwhatsapp list
  • example:
{
  "userId": "101",
  "whatsApp": []
}
  • response data
    fieldtyperequireddescription
    codeintycode
    messagestringymsg
    datastringydata
{
  "code": 200,
  "message": "success",
  "data": ""
}
Last update:
Contributors: kubrick,songjun