Contact Field
  • 05 Sep 2022
  • 4 Minutes to read
  • Dark
    Light

Contact Field

  • Dark
    Light

Article Summary

Contact field

Contact field object

NameTypeDescription
idguidThe id of custom field.
namestringUnique name of the field.
isSystemboolWhether the field is a system field or not.
isIdentityboolWhether the field is an identity field or not.
identityTypestringAllowed values are visitor, Email, SMS, facebook, twitter, wechat, SSOID, externalID, whatsApp, instagram, telegram, line, SecureMessaging. Available when isIdentity is true.
isRequiredboolWhether the field is required or not.
isVisibleboolWhether the field is visible in UI or not.
isReadOnlystringWhether the field is read only or not.
typestringType of the field. Allowed values are text, textArea, email, url, date, date time, integer, float, radio, checkbox, dropdownlist, checkboxlist, timezone.
lengthintegerField length.
helpTextstringHelp text of the field.
defaultValuestringDefault value of the field.
orderintegerOrder of the field.
fieldOptionsfieldOptions[]Reference to Field Option.

Field option object

NameTypeDescription
idguidId of the field option.
fieldIdguidId of the field which the option belongs to.
valuestringValue of the option.
orderintegerOrder of the option.
displayTextstringDisplay text of the option.

Get the list of contact field

GET /contact/fields

  • Parameters:

No Parameters

  • Response

Contact field

  • Example

Sample Request:

curl https://api11.comm100.io/v4/contact/fields \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

[
  {
      "id": "c5cfcb28-3ce8-496a-8782-b90946aa549e",
      "siteId": 70000687,
      "isSystem": false,
      "type": "text",
      "name": "testField",
      "isRequired": true,
      "isIdentity": false,
      "identityType": "",
      "isVisible": true,
      "isReadOnly": false,
      "length": 256,
      "helpText": "help",
      "defaultValue": "",
      "order": 30,
      "fieldOptions": []
  }
]

Get a single contact field

GET /contact/fields/{id}

  • Parameters

No Parameters

  • Response

Contact field

  • Example

Sample Request:

curl https://api11.comm100.io/v4/contact/fields/c5cfcb28-3ce8-496a-8782-b90946aa549e \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

{
  "id": "c5cfcb28-3ce8-496a-8782-b90946aa549e",
  "siteId": 70000687,
  "isSystem": false,
  "type": "text",
  "name": "testField",
  "isRequired": true,
  "isIdentity": false,
  "identityType": "",
  "isVisible": true,
  "isReadOnly": false,
  "length": 256,
  "helpText": "help",
  "defaultValue": "",
  "order": 30,
  "fieldOptions": []
}

Create a new contact field

POST /contact/fields

  • Parameters

    NameTypeinRequiredDescription
    namestringbodyyesName of the field.
    isVisibleboolbodynoWhether the field is visible in UI or not.
    isRequiredboolbodynoWhether the field is required or not.
    isIdentityboolbodynoWhether the field is an identity field or not.
    identityTypestringbodynoAllowed values are visitor, Email, SMS, facebook, twitter, wechat, SSOID, externalID, whatsApp, instagram, telegram, line, SecureMessaging. Available when isIdentity is true.
    isReadOnlystringbodynoWhether the field is read only or not.
    typestringbodyyesType of the field. Allowed values are "text", "textArea", "email", "url", "date", "integer", "float".
    lengthintegerbodyyesField length.
    helpTextstringbodynoHelp text of the field.
    defaultValuestringbodynoDefault value of the field.
    orderintegerbodynoField order.
    fieldOptionsfieldOptions[]bodynofieldOptions
  • Response

Contact Field

  • Example

Sample Request:

curl https://api11.comm100.io/v4/contact/fields \ 
    -X 'POST' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \
    -D '{"name":"testfield01","isVisible":true,"isRequired":false,"isReadOnly":false,"type":"text","length":256,"helpText":"","defaultValue":"","order": 33,"fieldOptions": []}'

Response:

HTTP/1.1 201 OK

{
  "id": "9aa1027e-e5e1-4db9-87d9-92fd2731ed32",
  "siteId": 70000687,
  "isSystem": false,
  "type": "text",
  "name": "testfield01",
  "isRequired": false,
  "isIdentity": false,
  "identityType": "",
  "isVisible": true,
  "isReadOnly": false,
  "length": 256,
  "helpText": "",
  "defaultValue": "",
  "order": 33,
  "fieldOptions": []
}

Update a Contact Field

PUT /contact/fields/{id}

  • Parameters

    NameTypeinRequiredDescription
    namestringbodyyesUnique name of the field. Cannot be changed.
    isVisibleboolbodynoWhether the field is visible in UI or not.
    isRequiredboolbodynoWhether the field is required or not.
    isIdentityboolbodynoWhether the field is an identity field or not.
    identityTypestringbodynoAllowed values are visitor, Email, SMS, facebook, twitter, wechat, SSOID, externalID, whatsApp, instagram, telegram, line, SecureMessaging. Available when isIdentity is true.
    isReadOnlystringbodynoWhether the field is read only or not.
    typestringbodyyesType of the field. Allowed values are "text", "textArea", "email", "url", "date", "integer", "float"
    lengthintegerbodyyesField length.
    helpTextstringbodynoHelp text of the field.
    defaultValuestringbodynoDefault value of the field.
    orderintegerbodynoField order.
    fieldOptionsField optionbodynofieldOptions[]
  • Response

Contact Field

  • Example

Sample Request:

curl https://api11.comm100.io/v4/contact/fields/9aa1027e-e5e1-4db9-87d9-92fd2731ed32 \ 
    -X 'PUT' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \
    -D '{"type": "text","name": "testfield01","isRequired": false,"isIdentity": false,"identityType": "","isVisible": true,"isReadOnly": false,"length": 300,"helpText": "","defaultValue": "","order": 33,"fieldOptions": []}'

Response:

HTTP/1.1 200 OK

{
  "id": "9aa1027e-e5e1-4db9-87d9-92fd2731ed32",
  "siteId": 70000687,
  "isSystem": false,
  "type": "text",
  "name": "testfield01",
  "isRequired": false,
  "isIdentity": false,
  "identityType": "",
  "isVisible": true,
  "isReadOnly": false,
  "length": 300,
  "helpText": "",
  "defaultValue": "",
  "order": 33,
  "fieldOptions": []
}

Delete a Contact Field

Delete /contact/fields/{id}

  • Parameters

No Parameters

  • Response

No Content

  • Example

Sample Request:

curl https://api11.comm100.io/v4/contact/fields/9aa1027e-e5e1-4db9-87d9-92fd2731ed32 \ 
    -X 'DELETE' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 204 No Content

Reorder Contact Fields

POST /contact/fields:reorder

  • Parameters

    NameTypeRequiredDescription
    idarrayyesThe array of contact field id.
  • Response

No Content

  • Example

Sample Request:

curl https://api11.comm100.io/v4/contact/fields:reorder \ 
    -X 'POST' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -D '["ba896ca7-d4d6-4b7f-b3c5-1b3e43509b97","e92686d4-5eee-414d-a2c5-40a595f2b324"]'

Response:

HTTP/1.1 200 OK


Was this article helpful?