NAV
curl

Send chat message

Update the chat with a new message or end the chat. Please see the cURL tab to the right for an example.

PUT /api/v1/chat

Request Parameters

Data Type Description
caseId Sting Required. Unique identifier of chat session. (Obtained from Start New Chat API response: POST /api/v1/chat)
messageType Integer Use 1 for normal message, 2 to close chat session.
messageBody String Text of chat message. (utf-8 URL encoded is recommended)

Sample Request

Please see the cURL tab to the right for an example.

// NOTE: Make sure to replace the "{api_key}" below with your API key!

curl -X PUT \
  'https://www.snapengage.com/api/v1/chat?caseId=a26503d8-4495-4147-acb4-d1a95ae744d5&messageType=1&messageBody=I%20need%20help%20finding%20shoes%21' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'x-api-key: {api_key}'

Response Parameters

Data Type Description
caseId String Unique identifier of chat session. (Obtained from Start New Chat API response: POST /api/v1/chat)
messageType Integer Use 1 for normal message, 2 to close chat session.
messageBody String Text of chat message. (utf-8 URL encoded is recommended)

Success Response

200 OK

Please see the json tab to the right for an example.

{
    "caseId": "a26503d8-4495-4147-acb4-d1a95ae744d5",
    "messageBody": "I need help finding shoes!",
    "messageType": "1"
}