Auto Start Chat

Auto Start Chat

Auto Start Visitor Chat API autometic start chat on any action like "success payment". Before implement this API user has to first implement widget code on his website, so that after start chat agent can communicate with the visitor.

You can refer to the sample code provided on the right side of the screen and switch to your preferred language.

Access the autoStartVisitorChat endpoint to create incoming chat. To access this API endpoint, login/signup to Appy Pie Developer account and obtain the required AccessToken Key from the Authentication section.

Below is the request URL and the Method is POST:

POST https://livechat-gateway-cavg9c0h.uc.gateway.dev/api/v1/autoStartVisitorChat

Parameter NameRequiredParameter TypeParameter Description
accountKeyYesStringThis is unique(To get this key login into your Livechat account and click on My Profile icon > My Profile > Account Key)
visitorIdYesString This is unique. visitorId will get from cookie and key to find in cookie value is concatenation of text "CLIENT_" and "Bot Id". Example: "CLIENT_1XXXXXXXXXX1" is key to find in cookie (To get Bot ID login into your Livechat account and click on My Profile icon > My Profile > Bot Id)
nameYesStringName of visitor
emailYesStringEmail of visitor
phoneNoStringPhone of visitor
customNoNoYou can add other fields which you want to show in chat. These values will show in chat message. This is json object value.
Required Parameters are mandatory to access the API endpoint.

Errors

This error section displays all the errors with details.

Following are the error codes that indicate the success or failure of an API request:

Error CodeMeaning
400Bad Request -- Your request is invalid.
401Unauthorized -- Your API key is wrong.
403Forbidden -- The method requested is hidden for administrators only.
404Not Found -- The specified method could not be found.
405Method Not Allowed -- You tried to access a method with an invalid method.
406Not Acceptable -- You requested a format that is not json.
410Gone -- Request has been removed from our servers.
429Too Many Requests
500Internal Server Error -- We had a problem with our server. Try again later.
503Service Unavailable -- We are temporarily offline for maintenance. Please try again later.
2032API Key is required
2034Email is required
2036Invalid API Key
2038Provide valid API Key
2039Email already exists
2040Phone already exists
2041Email Invalid
To authorize, use this code:

1wget --no-check-certificate --quiet \
2	--method POST \
3	--timeout=0 \
4	--header "ACCESSTOKEN: Access Token Key" \
5	--header "Content-Type: application/json" \
6	--body-data
7	'{
8		"accountKey":"1XXXXXXXXXXXX1",
9		"visitorId":"CXXXXXXXXXXXX1",
10		"name":"Jon Doe",
11		"email":"t***@g***.c*m",
12		"phone":"+919XXXXXXXX0",
13		"custom":JSON.stringify({ "plan_name": "Premium", "is_trial": "yes", "app_name": "Premium", "app_id": "gXXXXXXXXXXg", "description":"This is the test data", "company_name": "My company", "etc": "etc" })}
14	 }' \
15	"https://livechat-gateway-cavg9c0h.uc.gateway.dev/api/v1/autoStartVisitorChat"

RESPONSE

{
  "status": "success",
  "message": "Chat has been created."
}