--- title: "Field" slug: "server-api-livechat-field" updated: 2024-12-03T05:47:04Z published: 2024-12-03T05:47:04Z canonical: "developer.comm100.com/server-api-livechat-field" --- > ## 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. # Field ## Field You need the Manage Fields permission to manage Fields. - `Fields` - Fields Manage - `GET livechat/fields` - [Get the list of Fields](/docs/server-api-livechat-field#get-the-list-of-fields) - `GET livechat/fields/{id}` - [Get a single Field](/docs/server-api-livechat-field#get-a-single-field) - `POST livechat/fields` - [Create a new Field](/docs/server-api-livechat-field#create-a-new-field) - `PUT livechat/fields/{id}` - [Update the Field](/docs/server-api-livechat-field#update-the-field) - `DELETE livechat/fields/{id}` - [Remove the Field](/docs/server-api-livechat-field#remove-the-field) - `Field Options` - Field Options Manage - `GET livechat/fieldOptions` - [Get the list of Field Options](/docs/server-api-livechat-field#get-the-list-of-field-options) - `GET livechat/fieldOptions/{id}` - [Get a single Field Option](/docs/server-api-livechat-field#get-a-single-field-option) ### Field JSON Format Field is represented as simple flat JSON objects with the following keys: | Name | Type | Description | | --- | --- | --- | | `id` | guid | Id of the field. | | `isSystem` | bool | Whether the field is system field or not. | | `name` | string | Name of the field. | | `type` | string | Type of the field.Allowed values are "text", "textArea", "radioBox", "checkBox", "dropdownList", "checkboxList", "nps", "attachment", "rating", "checkboxListOptionGroups", "category", "comment". | | `leftText` | string | Left text of the field, only works for post chat. | | `rightText` | string | Right text of the field, only works for post chat. | | `fieldOptions` | [fieldOptions[]](/docs/server-api-livechat-field#field-option-json-format) | Reference to Field Option. | ### Get the list of Fields `GET livechat/fields` - #### Parameters: No Parameters - #### Response: An array of [Field](/docs/server-api-livechat-field#field-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/fields \ -X 'GET' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 200 OK ``` [ { "id": "a03cce30-f892-4286-8b7e-8e6c39cb4d19", "isSystem": false, "name": "Pre-textarea", "type": "radioBox", "leftText": "Highly unlikely", "rightText": "Highly likely", "fieldOptions": [ { "id": "314a02b2-cb4c-418f-b9bc-84fb4ad84254", "fieldId": "ca092d3f-21eb-492f-9142-205101b1d08a", "parentOptionId": "fa3e2d7b-cadb-47c1-ad7e-ef387907ec41", "value": "Text 2", "order": 0, "description": "" } ] } ] ``` ### Get a single Field `GET livechat/fields/{id}` - #### Parameters: No Parameters - #### Response: [Field](/docs/server-api-livechat-field#field-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/fields/a03cce30-f892-4286-8b7e-8e6c39cb4d19 \ -X 'GET' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 200 OK ``` { "id": "a03cce30-f892-4286-8b7e-8e6c39cb4d19", "isSystem": false, "name": "Pre-textarea", "type": "radioBox", "leftText": "Highly unlikely", "rightText": "Highly likely", "fieldOptions": [ { "id": "314a02b2-cb4c-418f-b9bc-84fb4ad84254", "fieldId": "ca092d3f-21eb-492f-9142-205101b1d08a", "parentOptionId": "fa3e2d7b-cadb-47c1-ad7e-ef387907ec41", "value": "Text 2", "order": 0 } ] } ``` ### Create a new Field `POST livechat/fields` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `isSystem` | bool | body | no | Whether the field is system field or not. | | `name` | string | body | yes | Name of the field. | | `type` | string | body | no | Type of the field.Allowed values are "text", "textArea", "radioBox", "checkBox", "dropdownList", "checkboxList", "nps", "attachment", "rating", "category", "comment". | | `leftText` | string | body | no | Left text of the field, only works for post chat. | | `rightText` | string | body | no | Right text of the field, only works for post chat. | | `fieldOptions` | [fieldOptions[]](/docs/server-api-livechat-field#field-option-json-format) | body | yes | Reference to Field Option. | - #### Response: [Field](/docs/server-api-livechat-field#field-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/fields \ -X 'POST' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"isSystem":false,"name":"Pre-textarea","type":"radioBox","leftText":"Highly unlikely","rightText":"Highly likely","fieldOptions":[{"value":"Text 2","order":0}]}' ``` Response: HTTP/1.1 201 Created ``` { "id": "a03cce30-f892-4286-8b7e-8e6c39cb4d19", "isSystem": false, "name": "Pre-textarea", "type": "radioBox", "leftText": "Highly unlikely", "rightText": "Highly likely", "fieldOptions": [ { "id": "314a02b2-cb4c-418f-b9bc-84fb4ad84254", "fieldId": "ca092d3f-21eb-492f-9142-205101b1d08a", "parentOptionId": "fa3e2d7b-cadb-47c1-ad7e-ef387907ec41", "value": "Text 2", "order": 0, "description": "" } ] } ``` ### Update the Field `PUT livechat/fields/{id}` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `isSystem` | bool | body | no | Whether the field is system field or not. | | `name` | string | body | yes | Name of the field. | | `type` | string | body | no | Type of the field.Allowed values are "text", "textArea", "radioBox", "checkBox", "dropdownList", "checkboxList", "nps", "attachment", "rating", "category", "comment". | | `leftText` | string | body | no | Left text of the field, only works for post chat. | | `rightText` | string | body | no | Right text of the field, only works for post chat. | | `fieldOptions` | [fieldOptions[]](/docs/server-api-livechat-field#field-option-json-format) | body | yes | Reference to Field Option. | - #### Response: [Field](/docs/server-api-livechat-field#field-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/fields/a03cce30-f892-4286-8b7e-8e6c39cb4d19 \ -X 'PUT' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"isSystem":false,"name":"Pre-textarea","type":"radioBox","leftText":"Highly unlikely","rightText":"Highly likely","fieldOptions":[{"parentOptionId":"fa3e2d7b-cadb-47c1-ad7e-ef387907ec41","value":"Text 2","order":0}]}' ``` Response: HTTP/1.1 200 OK ``` { "id": "a03cce30-f892-4286-8b7e-8e6c39cb4d19", "isSystem": false, "name": "Pre-textarea", "type": "radioBox", "leftText": "Highly unlikely", "rightText": "Highly likely", "fieldOptions": [ { "id": "314a02b2-cb4c-418f-b9bc-84fb4ad84254", "fieldId": "ca092d3f-21eb-492f-9142-205101b1d08a", "parentOptionId": "fa3e2d7b-cadb-47c1-ad7e-ef387907ec41", "value": "Text 2", "order": 0, "description": "" } ] } ``` ### Remove the Field `DELETE livechat/fields/{id}` - #### Parameters: No Parameters - #### Response: No Content - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/fields/a03cce30-f892-4286-8b7e-8e6c39cb4d19 \ -X 'DELETE' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 204 No Content ### Field Option JSON Format Field Option is represented as simple flat JSON objects with the following keys: | Name | Type | Description | | --- | --- | --- | | `id` | guid | Id of the field option. | | `fieldId` | guid | Id of the field which the field option belongs to. | | `parentOptionId` | guid | Id of the parent field option which the field option belongs to. | | `value` | string | Value of the field option. | | `order` | integer | Order of the field option. | | `description` | string | Description of the field option. You can add a description to enhance the accuracy of the smart wrap-up feature. However, a description isn't necessary if the option's name clearly reflects its purpose. | ### Get the list of Field Options `GET livechat/fieldOptions` - #### Parameters: No Parameters - #### Response: An array of [Field Option](/docs/server-api-livechat-field#field-option-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/fieldOptions \ -X 'GET' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 200 OK ``` [ { "id": "314a02b2-cb4c-418f-b9bc-84fb4ad84254", "fieldId": "ca092d3f-21eb-492f-9142-205101b1d08a", "parentOptionId": "fa3e2d7b-cadb-47c1-ad7e-ef387907ec41", "value": "Text 2", "order": 0, "description": "" } ] ``` ### Get a single Field Option `GET livechat/fieldOptions/{id}` - #### Parameters: No Parameters - #### Response: [Field Option](/docs/server-api-livechat-field#field-option-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/fieldOptions/314a02b2-cb4c-418f-b9bc-84fb4ad84254 \ -X 'GET' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 200 OK ``` { "id": "314a02b2-cb4c-418f-b9bc-84fb4ad84254", "fieldId": "ca092d3f-21eb-492f-9142-205101b1d08a", "parentOptionId": "fa3e2d7b-cadb-47c1-ad7e-ef387907ec41", "value": "Text 2", "order": 0, "description": "" } ```