Field
  • 25 Jul 2022
  • 3 Minutes to read
  • Dark
    Light

Field

  • Dark
    Light

Article Summary

Field

You need the Manage Fields permission to manage Fields.

Field JSON Format

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

NameTypeDescription
idguidId of the field.
isSystemboolWhether the field is system field or not.
namestringName of the field.
typestringType of the field.Allowed values are "text", "textArea", "radioBox", "checkBox", "dropdownList", "checkboxList", "nps", "attachment", "rating", "checkboxListOptionGroups", "category", "comment".
leftTextstringLeft text of the field, only works for post chat.
rightTextstringRight text of the field, only works for post chat.
fieldOptionsfieldOptions[]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:

Field

  • 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:

NameTypeinRequiredDescription
isSystemboolbodynoWhether the field is system field or not.
namestringbodyyesName of the field.
typestringbodynoType of the field.Allowed values are "text", "textArea", "radioBox", "checkBox", "dropdownList", "checkboxList", "nps", "attachment", "rating", "category", "comment".
leftTextstringbodynoLeft text of the field, only works for post chat.
rightTextstringbodynoRight text of the field, only works for post chat.
fieldOptionsfieldOptions[]bodyyesReference to Field Option.
  • Response:

Field

  • 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:

NameTypeinRequiredDescription
isSystemboolbodynoWhether the field is system field or not.
namestringbodyyesName of the field.
typestringbodynoType of the field.Allowed values are "text", "textArea", "radioBox", "checkBox", "dropdownList", "checkboxList", "nps", "attachment", "rating", "category", "comment".
leftTextstringbodynoLeft text of the field, only works for post chat.
rightTextstringbodynoRight text of the field, only works for post chat.
fieldOptionsfieldOptions[]bodyyesReference to Field Option.
  • Response:

Field

  • 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:

NameTypeDescription
idguidId of the field option.
fieldIdguidId of the field which the field option belongs to.
parentOptionIdguidId of the parent field option which the field option belongs to.
valuestringValue of the field option.
orderintegerOrder 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:

Field Option

  • 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
} 

Was this article helpful?

What's Next