--- title: "Contact Field" slug: "contact-custome-field" updated: 2022-09-05T07:22:10Z published: 2022-09-05T07:22:10Z canonical: "developer.comm100.com/contact-custome-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. # Contact Field ## Contact field - #### `Contact fields` - Contact fields manage - `GET /contact/fields` - [Get the list of Contact Field](/docs/contact-custome-field#get-the-list-of-contact-field). - `GET /contact/fields/{id}` - [Get a single Contact Field](/docs/contact-custome-field#get-a-single-contact-field). - `POST /contact/fields` - [Create a new Contact Field](/docs/contact-custome-field#create-a-new-contact-field). - `PUT /contact/fields/{id}` - [Update a Contact Field](/docs/contact-custome-field#update-a-contact-field). - `DELETE /contact/fields/{id}` - [Delete a Contact Field](/docs/contact-custome-field#delete-a-contact-field). - `POST /contact/fields:reorder` - [Reorder Contact Fields](/docs/contact-custome-field#reorder-contact-fields). ### Contact field object | Name | Type | Description | | --- | --- | --- | | `id` | guid | The id of custom field. | | `name` | string | Unique name of the field. | | `isSystem` | bool | Whether the field is a system field or not. | | `isIdentity` | bool | Whether the field is an identity field or not. | | `identityType` | string | Allowed values are `visitor`, `Email`, `SMS`, `facebook`, `twitter`, `wechat`, `SSOID`, `externalID`, `whatsApp`, `instagram`, `telegram`, `line`, `SecureMessaging`. Available when isIdentity is true. | | `isRequired` | bool | Whether the field is required or not. | | `isVisible` | bool | Whether the field is visible in UI or not. | | `isReadOnly` | string | Whether the field is read only or not. | | `type` | string | Type of the field. Allowed values are `text`, `textArea`, `email`, `url`, `date`, `date time`, `integer`, `float`, `radio`, `checkbox`, `dropdownlist`, `checkboxlist`, `timezone`. | | `length` | integer | Field length. | | `helpText` | string | Help text of the field. | | `defaultValue` | string | Default value of the field. | | `order` | integer | Order of the field. | | `fieldOptions` | [fieldOptions](/docs/contact-custome-field#field-option-object)[] | Reference to Field Option. | ### Field option object | Name | Type | Description | | --- | --- | --- | | `id` | guid | Id of the field option. | | `fieldId` | guid | Id of the field which the option belongs to. | | `value` | string | Value of the option. | | `order` | integer | Order of the option. | | `displayText` | string | Display text of the option. | ### Get the list of contact field `GET /contact/fields` - #### Parameters: No Parameters - #### Response [Contact field](/docs/contact-custome-field#contact-field-object) - ### 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](/docs/contact-custome-field#contact-field-object) - #### 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 | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `name` | string | body | yes | Name of the field. | | `isVisible` | bool | body | no | Whether the field is visible in UI or not. | | `isRequired` | bool | body | no | Whether the field is required or not. | | `isIdentity` | bool | body | no | Whether the field is an identity field or not. | | `identityType` | string | body | no | Allowed values are `visitor`, `Email`, `SMS`, `facebook`, `twitter`, `wechat`, `SSOID`, `externalID`, `whatsApp`, `instagram`, `telegram`, `line`, `SecureMessaging`. Available when isIdentity is true. | | `isReadOnly` | string | body | no | Whether the field is read only or not. | | `type` | string | body | yes | Type of the field. Allowed values are "text", "textArea", "email", "url", "date", "integer", "float". | | `length` | integer | body | yes | Field length. | | `helpText` | string | body | no | Help text of the field. | | `defaultValue` | string | body | no | Default value of the field. | | `order` | integer | body | no | Field order. | | `fieldOptions` | [fieldOptions](/docs/contact-custome-field#field-option-object)[] | body | no | [fieldOptions](/docs/contact-custome-field#field-option-object) | - #### Response [Contact Field](/docs/contact-custome-field#contact-field-object) - #### 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 | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `name` | string | body | yes | Unique name of the field. Cannot be changed. | | `isVisible` | bool | body | no | Whether the field is visible in UI or not. | | `isRequired` | bool | body | no | Whether the field is required or not. | | `isIdentity` | bool | body | no | Whether the field is an identity field or not. | | `identityType` | string | body | no | Allowed values are `visitor`, `Email`, `SMS`, `facebook`, `twitter`, `wechat`, `SSOID`, `externalID`, `whatsApp`, `instagram`, `telegram`, `line`, `SecureMessaging`. Available when isIdentity is true. | | `isReadOnly` | string | body | no | Whether the field is read only or not. | | `type` | string | body | yes | Type of the field. Allowed values are "text", "textArea", "email", "url", "date", "integer", "float" | | `length` | integer | body | yes | Field length. | | `helpText` | string | body | no | Help text of the field. | | `defaultValue` | string | body | no | Default value of the field. | | `order` | integer | body | no | Field order. | | `fieldOptions` | [Field option](/docs/contact-custome-field#field-option-object) | body | no | [fieldOptions](/docs/contact-custome-field#field-option-object)[] | - #### Response [Contact Field](/docs/contact-custome-field#contact-field-object) - #### 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 | Name | Type | Required | Description | | --- | --- | --- | --- | | `id` | array | yes | The 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