Auto Invitation

You need the Manage Campaigns Form permission to manage Auto Invitation.

Auto Invitations
- Auto Invitations Manage
GET livechat/autoInvitations
GET livechat/autoInvitations/{id}
POST livechat/autoInvitations
POST livechat/autoInvitations/{id}:disable
POST livechat/autoInvitations/{id}:enable
PUT livechat/autoInvitations/{id}
DELETE livechat/autoInvitations/{id}
Model
Auto Invitation JSON Format

Auto Invitation is represented as simple flat JSON objects with the following keys:

Name Type Description
id guid Id of the auto invitation.
campaignId guid Id of the campaign.
name string Name of the auto invitation.
isEnabled bool Whether auto invitation is enabled or not.
isDisplayedOnceInOneSession bool Whether only pop-up once per site visit or not.
order integer Order of the auto invitation.
text string Message of the auto invitation.
logicalExpression string Detail of the logic expression.
conditionMetType string Allowed values are "all", "any", "logicalExpression".
style string Allowed values are "bubble", "chatWindow".
autoInvitationConditions autoInvitationConditions[] Reference to Condition.

Condition JSON Format:

Name Type Description
id guid Id of the condition.
autoInvitationId guid Id of the auto invitation.
operator string Allowed values are "is", "contains", "notContains", "isMoreThan", "isLessThan", "isNot", "isNotLessThan", "isNotMoreThan", "regularExpression", "isOneOf", "isNotIn", "dateNotEqualTo", "before", "after", "dateEqualTo".
value string Value of the condition.
order integer Order of the condition.
fieldName string Name of the related field.
name operator
{!Visitor.Number of visits} is/isNot/isMoreThan/isLessThan
{!Visitor.Number of chats} is/isNot/isMoreThan/isLessThan
{!Visitor.Time on current page} is/isNot/isMoreThan/isLessThan
{!Visitor.Time on website} is/isNot/isMoreThan/isLessThan
{!Visitor.# of pages} is/isNot/isMoreThan/isLessThan
{!Visitor.IP} is/isNot/contains/notContains/regularExpression
{!Visitor.Current Page URL} is/isNot/contains/notContains/regularExpression
{!Visitor.Referrer URL} is/isNot/contains/notContains/regularExpression
{!Visitor.Landing Page URL} is/isNot/contains/notContains/regularExpression
{!Visitor.Search Engine} is/isNot/contains/notContains/regularExpression
{!Visitor.Search Keywords} is/isNot/contains/notContains/regularExpression
{!Visitor.Country/Region} is/isNot/contains/notContains/regularExpression
{!Visitor.State/Province} is/isNot/contains/notContains/regularExpression
{!Visitor.City} is/isNot/contains/notContains/regularExpression
{!Visitor.Operating System} is/isNot/contains/notContains/regularExpression
{!Visitor.Time Zone} isOneOf/isNotIn
{!Visitor.Language} is/isNot/contains/notContains/regularExpression
{!Visitor.Segmentation} isOneOf/isNotIn
{!Custom Variable.Custom Variable Name}
When type is text:is/isNot/contains/notContains/regularExpression

When type is integer or decimal:is/isNot/isMoreThan/isLessThan
Endpoint
Get the list of Auto Invitations

GET livechat/autoInvitations

Parameters:
Name Type In Required Description
campaignId string query no Id of the campaign.
include string query no Allowed value is "campaignAutoInvitationCondition".
Response:

An array of   Auto Invitation

Example

Sample Request:

curl https://api15.comm100.io/v4/livechat/autoInvitations \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

[{"id":"d5c5e6f5-8167-4406-8d31-e50ef878d926","campaignId":"760571e6-e7b9-4bc3-8f97-55fc5483e439","name":"is","isEnabled":false,"isDisplayedOnceInOneSession":false,"order":1,"text":"Hello, how may I help you?","logicalExpression":"(1 or 2)","conditionMetType":"all","style":"bubble","autoInvitationConditions":[{"id":"52B05329-7C46-EB11-8100-00155D081D0B","autoInvitationId":"760571e6-e7b9-4bc3-8f97-55fc5483e439","operator":"is","value":"test","order":1,"fieldName":"{!Visitor.Number of visits}"}]}]
Get a single Auto Invitation

GET livechat/autoInvitations/{id}

Parameters:
Name Type In Required Description
include string query no Allowed value is "campaignAutoInvitationCondition".
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/livechat/autoInvitations/d5c5e6f5-8167-4406-8d31-e50ef878d926 \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

{"id":"d5c5e6f5-8167-4406-8d31-e50ef878d926","campaignId":"760571e6-e7b9-4bc3-8f97-55fc5483e439","name":"is","isEnabled":false,"isDisplayedOnceInOneSession":false,"order":1,"text":"Hello, how may I help you?","logicalExpression":"(1 or 2)","conditionMetType":"all","style":"bubble","autoInvitationConditions":[{"id":"52B05329-7C46-EB11-8100-00155D081D0B","autoInvitationId":"760571e6-e7b9-4bc3-8f97-55fc5483e439","operator":"is","value":"test","order":1,"fieldName":"{!Visitor.Number of visits}"}]}
Create a new Auto Invitation

POST livechat/autoInvitations

Parameters:
Name Type In Required Description
campaignId guid body no Id of the campaign.
name string body yes Name of the auto invitation.
isEnabled bool body no Whether auto invitation is enabled or not.
isDisplayedOnceInOneSession bool body no Whether only pop-up once per site visit or not.
order integer body no Order of the auto invitation.
text string body no Message of the auto invitation.
logicalExpression string body no Detail of the logic expression.
conditionMetType string body no Allowed values are "all", "any", "logicalExpression".
style string body no Allowed values are "bubble", "chatWindow".
autoInvitationConditions autoInvitationConditions[] body no Reference to Condition.
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/livechat/autoInvitations \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"campaignId":"760571e6-e7b9-4bc3-8f97-55fc5483e439","name":"is","isEnabled":false,"isDisplayedOnceInOneSession":false,"order":1,"text":"Hello, how may I help you?","logicalExpression":"(1 or 2)","conditionMetType":"all","style":"bubble","autoInvitationConditions":[{"operator":"is","value":"test","order":1,"fieldName":"{!Visitor.Number of visits}"}]}'

Response:

 HTTP/1.1 201 Created

{"id":"d5c5e6f5-8167-4406-8d31-e50ef878d926","campaignId":"760571e6-e7b9-4bc3-8f97-55fc5483e439","name":"is","isEnabled":false,"isDisplayedOnceInOneSession":false,"order":1,"text":"Hello, how may I help you?","logicalExpression":"(1 or 2)","conditionMetType":"all","style":"bubble","autoInvitationConditions":[{"id":"52B05329-7C46-EB11-8100-00155D081D0B","autoInvitationId":"760571e6-e7b9-4bc3-8f97-55fc5483e439","operator":"is","value":"test","order":1,"fieldName":"{!Visitor.Number of visits}"}]}
Disable the Auto Invitation

POST livechat/autoInvitations/{id}:disable

Parameters:
No Parameters
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/livechat/autoInvitations/d5c5e6f5-8167-4406-8d31-e50ef878d926:disable \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

{"id":"d5c5e6f5-8167-4406-8d31-e50ef878d926","campaignId":"760571e6-e7b9-4bc3-8f97-55fc5483e439","name":"is","isEnabled":false,"isDisplayedOnceInOneSession":false,"order":1,"text":"Hello, how may I help you?","logicalExpression":"(1 or 2)","conditionMetType":"all","style":"bubble","autoInvitationConditions":[{"id":"52B05329-7C46-EB11-8100-00155D081D0B","autoInvitationId":"760571e6-e7b9-4bc3-8f97-55fc5483e439","operator":"is","value":"test","order":1,"fieldName":"{!Visitor.Number of visits}"}]}
Enable the Auto Invitation

POST livechat/autoInvitations/{id}:enable

Parameters:
No Parameters
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/livechat/autoInvitations/d5c5e6f5-8167-4406-8d31-e50ef878d926:enable \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

{"id":"d5c5e6f5-8167-4406-8d31-e50ef878d926","campaignId":"760571e6-e7b9-4bc3-8f97-55fc5483e439","name":"is","isEnabled":true,"isDisplayedOnceInOneSession":false,"order":1,"text":"Hello, how may I help you?","logicalExpression":"(1 or 2)","conditionMetType":"all","style":"bubble","autoInvitationConditions":[{"id":"52B05329-7C46-EB11-8100-00155D081D0B","autoInvitationId":"760571e6-e7b9-4bc3-8f97-55fc5483e439","operator":"is","value":"test","order":1,"fieldName":"{!Visitor.Number of visits}"}]}
Update the Auto Invitation

PUT livechat/autoInvitations/{id}

Parameters:
Name Type In Required Description
campaignId guid body no Id of the campaign.
name string body yes Name of the auto invitation.
isEnabled bool body no Whether auto invitation is enabled or not.
isDisplayedOnceInOneSession bool body no Whether only pop-up once per site visit or not.
order integer body no Order of the auto invitation.
text string body no Message of the auto invitation.
logicalExpression string body no Detail of the logic expression.
conditionMetType string body no Allowed values are "all", "any", "logicalExpression".
style string body no Allowed values are "bubble", "chatWindow".
autoInvitationConditions autoInvitationConditions[] body no Reference to Condition.
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/livechat/autoInvitations/d5c5e6f5-8167-4406-8d31-e50ef878d926 \
-X 'PUT' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"campaignId":"760571e6-e7b9-4bc3-8f97-55fc5483e439","name":"is","isEnabled":false,"isDisplayedOnceInOneSession":false,"order":1,"text":"Hello, how may I help you?","logicalExpression":"(1 or 2)","conditionMetType":"all","style":"bubble","autoInvitationConditions":[{"operator":"is","value":"test","order":1,"fieldName":"{!Visitor.Number of visits}"}]}'

Response:

 HTTP/1.1 200 OK

{"id":"d5c5e6f5-8167-4406-8d31-e50ef878d926","campaignId":"760571e6-e7b9-4bc3-8f97-55fc5483e439","name":"is","isEnabled":false,"isDisplayedOnceInOneSession":false,"order":1,"text":"Hello, how may I help you?","logicalExpression":"(1 or 2)","conditionMetType":"all","style":"bubble","autoInvitationConditions":[{"id":"52B05329-7C46-EB11-8100-00155D081D0B","autoInvitationId":"760571e6-e7b9-4bc3-8f97-55fc5483e439","operator":"is","value":"test","order":1,"fieldName":"{!Visitor.Number of visits}"}]}
Remove the Auto Invitation

DELETE livechat/autoInvitations/{id}

Parameters:
No Parameters
Response:

No Content

Example

Sample Request:

curl https://api15.comm100.io/v4/livechat/autoInvitations/d5c5e6f5-8167-4406-8d31-e50ef878d926 \
-X 'DELETE' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 204 No Content