- 25 Jul 2022
- 3 Minutes to read
- Print
- DarkLight
Field
- Updated on 25 Jul 2022
- 3 Minutes to read
- Print
- DarkLight
Field
You need the Manage Fields permission to manage Fields.
Fields
- Fields ManageGET livechat/fields
- Get the list of FieldsGET livechat/fields/{id}
- Get a single FieldPOST livechat/fields
- Create a new FieldPUT livechat/fields/{id}
- Update the FieldDELETE livechat/fields/{id}
- Remove the Field
Field Options
- Field Options ManageGET livechat/fieldOptions
- Get the list of Field OptionsGET livechat/fieldOptions/{id}
- 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[] | Reference to Field Option. |
Get the list of Fields
GET livechat/fields
Parameters:
No Parameters
Response:
An array of Field
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
}
]
}
]
Get a single Field
GET livechat/fields/{id}
Parameters:
No Parameters
Response:
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[] | body | yes | Reference to Field Option. |
Response:
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
}
]
}
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[] | body | yes | Reference to Field Option. |
Response:
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
}
]
}
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. |
Get the list of Field Options
GET livechat/fieldOptions
Parameters:
No Parameters
Response:
An array of Field Option
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
}
]
Get a single Field Option
GET livechat/fieldOptions/{id}
Parameters:
No Parameters
Response:
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
}