Auto Invitation
  • 28 Jul 2022
  • 5 Minutes to read
  • Dark
    Light

Auto Invitation

  • Dark
    Light

Article summary

Auto Invitation

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

Auto Invitation JSON Format

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

NameTypeDescription
idguidId of the auto invitation.
campaignIdguidId of the campaign.
namestringName of the auto invitation.
isEnabledboolWhether auto invitation is enabled or not.
isDisplayedOnceInOneSessionboolWhether only pop-up once per site visit or not.
orderintegerOrder of the auto invitation.
textstringMessage of the auto invitation.
logicalExpressionstringDetail of the logic expression.
conditionMetTypestringAllowed values are "all", "any", "logicalExpression".
stylestringAllowed values are "bubble", "chatWindow".
autoInvitationConditionsautoInvitationConditions[]Reference to Condition.

Auto Invitation Conditions JSON Format:

NameTypeDescription
idguidId of the condition.
autoInvitationIdguidId of the auto invitation.
operatorstringAllowed values are "is", "contains", "notContains", "isMoreThan", "isLessThan", "isNot", "isNotLessThan", "isNotMoreThan", "regularExpression", "isOneOf", "isNotIn".
valuestringValue of the condition.
orderintegerOrder of the condition.
fieldNamestringName of the related field.
nameoperator
{!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}isOneOf/isNotIn
{!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}isOneOf/isNotIn
{!Visitor.Browser}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

Get the list of Auto Invitations

GET livechat/autoInvitations

  • Parameters:

No Parameters

  • Response:

An array of Auto Invitation

  • Example

Sample Request:

curl https://api11.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:

No Parameters

  • Response:

Auto Invitation

  • Example

Sample Request:

curl https://api11.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:

NameTypeinRequiredDescription
campaignIdguidbodyyesId of the campaign.
namestringbodyyesName of the auto invitation.
isEnabledboolbodynoWhether auto invitation is enabled or not.
isDisplayedOnceInOneSessionboolbodynoWhether only pop-up once per site visit or not.
orderintegerbodynoOrder of the auto invitation.
textstringbodynoMessage of the auto invitation.
logicalExpressionstringbodynoDetail of the logic expression.
conditionMetTypestringbodynoAllowed values are "all", "any", "logicalExpression".
stylestringbodynoAllowed values are "bubble", "chatWindow".
autoInvitationConditionsautoInvitationConditions[]bodynoReference to Condition.
  • Response:

Auto Invitation

  • Example

Sample Request:

curl https://api11.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:

NameTypeinRequiredDescription
idguidqueryyesId of the campaign.
  • Response:

Auto Invitation

  • Example

Sample Request:

curl https://api11.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:

NameTypeinRequiredDescription
idguidqueryyesId of the campaign.
  • Response:

Auto Invitation

  • Example

Sample Request:

curl https://api11.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:

NameTypeinRequiredDescription
campaignIdguidbodynoId of the campaign.
namestringbodynoName of the auto invitation.
isEnabledboolbodynoWhether auto invitation is enabled or not.
isDisplayedOnceInOneSessionboolbodynoWhether only pop-up once per site visit or not.
orderintegerbodynoOrder of the auto invitation.
textstringbodynoMessage of the auto invitation.
logicalExpressionstringbodynoDetail of the logic expression.
conditionMetTypestringbodynoAllowed values are "all", "any", "logicalExpression".
stylestringbodynoAllowed values are "bubble", "chatWindow".
autoInvitationConditionsautoInvitationConditions[]bodynoReference to Condition.
  • Response:

Auto Invitation

  • Example

Sample Request:

curl https://api11.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:

NameTypeinRequiredDescription
idguidqueryyesId of the campaign.
  • Response:

No Content

  • Example

Sample Request:

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

Response:

HTTP/1.1 204 No Content


Was this article helpful?

What's Next