Start New Chat
(Last Updated On: April 4, 2017)
Overview

Create a new Chat session


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

Sample Request
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
caseId Unique identifier of chat session.
widgetId Unique identifier of chat widget.

Success Response

200 OK

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

Error Responses

Please see the Error Responses document.