Company Fields

Here you can manage via API the fields data collected from your visitors

The Field Object

Attribute

Description

*id string required

The id of the field. Text and Dropdown field id is used to save the data under customFields in the visit object.

*type string required

The type of the field. It can be one value of: [Phone, Email, Address, CPF, RG, Document, Company, Position, Sector, Text, Dropdown]

name string

The label displayed to the visitor. It's required if the type is Text or Dropdown

required bool

It indicates if the field is required or not. Default false

sort number

The order that this field will be visible to the visitor. Default: it will be added to the end

options [string]

An array of strings that is only used when the type is Dropdown

Endpoints

Get Fields

GET https://api.w3lcome.com/v1/company/fields

This endpoint allows you to get the company fields

Headers

NameTypeDescription

Content-Type

string

application/json

Authentication

string

Basic token

{
  "fields": [
    {
      "id": "LcKjSsT1",    
      "type": "Email",
      "name": "Email",
      "required": true,
      "sort": 0
    }, {
      "id": "dI8GcykL",
      "type": "Text",
      "name": "Favorite sound",
      "required": false,
      "sort": 1
    }, {
      "id": "bffep3ZVa",
      "type": "Dropdown",
      "name": "Gender",
      "required": false,
      "sort": 2
      "options": ["Male", "Female"]
    }
  ]  
}

Post Field

POST https://api.w3lcome.com/v1/company/fields

Create a new field

Headers

NameTypeDescription

Content-Type

string

application/json

Authentication

string

Basic token

Request Body

NameTypeDescription

id

string

If not provided will be automatically generated

type

string

The type of the field. See the list above

name

string

The label name displayed to the visitor. Required when the type is Text or Dropdown

required

boolean

Whether the field is required or not

sort

number

It has to be a number greater than 0. If not provided it will be added to the end of the fields list

options

array

An array of string. Required if the type is Dropdown

{
    "field": {
      "id": "uniqueId",
      "type": "Phone",
      "name": "Your phone number",
      "required": true,
      "sort": 0
    }
}

Update a field

PATCH https://api.w3lcome.com/v1/company/fields/:id

Update a field

Path Parameters

NameTypeDescription

id

string

The field id

Headers

NameTypeDescription

Content-Type

string

application/json

Authorization

string

Basic token

Request Body

NameTypeDescription

type

string

The type of the field

name

string

The label name displayed to the visitor. Required when the type is Text or Dropdown

required

boolean

Whether the field is required or not

sort

number

It has to be a number greater than 0. If not provided it will be added to the end of the fields list

options

array

An array of string. Required if the type is Dropdown

{
    "field": {
      "id": "uniqueId",
      "type": "Phone",
      "name": "Your BEST phone number",
      "required": true,
      "sort": 0
    }
}

Delete a field

DELETE https://api.w3lcome.com/v1/company/fields/:id

Delete a field

Path Parameters

NameTypeDescription

id

string

The field id

Headers

NameTypeDescription

Content-Type

string

application/json

Authorization

string

Basic token

{
    "field": {
      "id": "uniqueId",
      "type": "Phone",
      "name": "Your BEST phone number",
      "required": true,
      "sort": 0
    }
}

Table of errors

Method

Type

GET PATCH DELETE

NOT_FOUND

PATCH POST

INVALID_TYPE

PATCH POST

MISSING_OPTIONS

POST

MISSING_NAME

POST

FIELD_ID_ALREADY_EXISTS

POST

TYPE_ALREADY_USED

GET PATCH POST DELETE

INTERNAL

Last updated