--- title: "Auto Invitation" slug: "server-api-livechat-auto-invitation" updated: 2022-07-28T09:24:20Z published: 2022-07-28T09:24:20Z canonical: "developer.comm100.com/server-api-livechat-auto-invitation" --- > ## Documentation Index > Fetch the complete documentation index at: https://developer.comm100.com/llms.txt > Use this file to discover all available pages before exploring further. # Auto Invitation ## Auto Invitation You need the Manage Campaigns Form permission to manage Auto Invitation. - `Auto Invitations` - Auto Invitations Manage - `GET livechat/autoInvitations` - [Get the list of Auto Invitations](/docs/server-api-livechat-auto-invitation#get-the-list-of-auto-invitations) - `GET livechat/autoInvitations/{id}` - [Get a single Auto Invitation](/docs/server-api-livechat-auto-invitation#get-a-single-auto-invitation) - `POST livechat/autoInvitations` - [Create a new Auto Invitation](/docs/server-api-livechat-auto-invitation#create-a-new-auto-invitation) - `POST livechat/autoInvitations/{id}:disable` - [Disable the Auto Invitation](/docs/server-api-livechat-auto-invitation#disable-the-auto-invitation) - `POST livechat/autoInvitations/{id}:enable` - [Enable the Auto Invitation](/docs/server-api-livechat-auto-invitation#enable-the-auto-invitation) - `PUT livechat/autoInvitations/{id}` - [Update the Auto Invitation](/docs/server-api-livechat-auto-invitation#update-the-auto-invitation) - `DELETE livechat/autoInvitations/{id}` - [Remove the Auto Invitation](/docs/server-api-livechat-auto-invitation#remove-the-auto-invitation) ### 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[]](/docs/server-api-livechat-auto-invitation#auto-invitation-conditions-json-format) | Reference to Condition. | ### Auto Invitation Conditions 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". | | `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} \| 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 \| | | 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} | 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](/docs/server-api-livechat-auto-invitation#auto-invitation-json-format) - #### 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](/docs/server-api-livechat-auto-invitation#auto-invitation-json-format) - #### 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: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `campaignId` | guid | body | yes | 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[]](/docs/server-api-livechat-auto-invitation#auto-invitation-conditions-json-format) | body | no | Reference to Condition. | - #### Response: [Auto Invitation](/docs/server-api-livechat-auto-invitation#auto-invitation-json-format) - #### 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: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | id | guid | query | yes | Id of the campaign. | - #### Response: [Auto Invitation](/docs/server-api-livechat-auto-invitation#auto-invitation-json-format) - #### 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: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | id | guid | query | yes | Id of the campaign. | - #### Response: [Auto Invitation](/docs/server-api-livechat-auto-invitation#auto-invitation-json-format) - #### 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: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `campaignId` | guid | body | no | Id of the campaign. | | `name` | string | body | no | 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[]](/docs/server-api-livechat-auto-invitation#auto-invitation-conditions-json-format) | body | no | Reference to Condition. | - #### Response: [Auto Invitation](/docs/server-api-livechat-auto-invitation#auto-invitation-json-format) - #### 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: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | id | guid | query | yes | Id 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