NAV Navbar
curl

Start new chat

Overview

Create a new Chat session. Please see the cURL tab to the right for an example.

POST /api/v1/chat

Request Parameters

Data Type Description
widgetId String Unique identifier of chat widget.
email String (Required if emailRequired is true for chat widget) Visitor’s email address.
phone String (Optional) Visitor’s phone number.
userAgent String (Optional) Similar to web browser user agent string.
locale String (Optional) Locale of this chat session. Example could be “en” or “en-GB”.
isOffline Boolean (Optional, default false) true/false – Open chat session or send message directly to email (offline).
appVersionName String (Optional) Name/Version of your application.
visitorMessage String (Required if messageRequired is true for chat widget) Initial visitor chat message.

Sample Request

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

curl -i -H 'X-Api-Key:4a9fecdd4c344f279a59d9446157636e' -X POST \
-d "widgetId=204557b4-f777-46be-b31b-e660d721364d&email=user@example.com&phone=(555) 867-5309&userAgent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1309.0 Safari/537.17&locale=en-US&isOffline=false&appVersionName=My Mobile App v0.1&visitorMessage=Hello" \
https://www.snapengage.com/api/v1/chat

Response Parameters

Data Type Description
caseId String Unique identifier of chat session.
widgetId String Unique identifier of chat widget.

Success Response

200 OK

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

{
    "caseId":"44843c55-527c-4f03-a779-e0ce655219f7",
    "widgetId":"204557b4-f777-46be-b31b-e660d721364d"
}