Custom fields

Custom fields allow you to attach the field types to a contact. You can attach the field types according to your needs. This API enables you to create, update and delete the custom field.

It also allows you to view custom field resources and define the scope of data easily.

Creating

You can create any custom fields similar to the type's mentioned below.

Type Description
text128 The text types represent a short string, not more than 128 characters.
text256 The text types represent a short string, not more than 256 characters.
text1024 The text types represent a long string, not more than 1,024 characters.

You can use the value of TEXT(1024) field for dynamic text in email content only. It can’t be used as segmentation criteria.
integer The float types represent approximate numeric data values.
float The float types represent approximate numeric data values with decimal.
enum The enum types represent select values.
boolean The boolean types represent possible values.
date The date types represent when you need only date information.
time The time types represent when you need only time information.
datetime The date time types represent when you need values containing both date and time information.
  • This API endpoint allows you to create a new custom field.
  • You can POST the object data such as field_name , field_key,field_type to list/{list_id}/custom_fields API.
  • When successfully created, Taximail API will return the new custom_field_id.

POST https://api.taximail.com/v2/list/{list_id}/custom_fields

Parameter Type Description Required
field_name string The custom field's name. Yes
field_key string The custom field's key. Yes
field_type string The custom field's type. Yes
field_value string The optional value of enum type. Yes

Example Request

POST v2/list/314/custom_fields HTTP/1.1
Host: api.taximail.com
Authorization: "Bearer YOUR_SESSION_ID"

field_name=Address&field_key=ADDRESS&field_type=Paragraph+text&validation_method=Disabled

Example Result

{
   "status": "success",
   "code": 201,
   "data": {
              "custom_field_id": 338
       }
}

Fields

Name Type Description
status enum {success, error} Returns the status of the result.
code integer Returns the response code of the result.
err_msg string When error occur, returns the error's detail of the result.
data.custom_field_id integer The custom_filed_id of the newly created custom field.

Response Code

Code Result Description
201 success The new resource was created successfully.
400 error The request is malformed or missing some required parameters.
Custom field key should not have special char.
Invalid custom field type.
401 error Unauthorized or the session_id expired.
404 error The list not found.
409 error Duplicate custom field key in list.

Showing

  • This API endpoint allows you to get all custom fields.
  • You need to send GET request and list_id to list/{list_id}/custom_fields API.
  • On a successful request, Taximail API will return the array of the custom field list.

GET https://api.taximail.com/v2/list/{list_id}/custom_fields

Parameter Type Description Required
order_by enum {custom_field_id,
custom_field_name}
Specify the column which is used to sort the result-set.

Default to custom_field_id.
order_type enum {asc, desc} To sort the records in a ascending or descending order.

Default to desc.

Example Request

GET v2/list/314/custom_fields?order_by=custom_field_id&order_type=desc HTTP/1.1
Host: api.taximail.com
Authorization: "Bearer YOUR_SESSION_ID"

Example Result

{
  "status": "success",
  "code": 200,
  "data": {
            "custom_fields_count": 3,
            "custom_fields": [
                  {
                        "custom_field_id": 205,
                        "show_custom_name": "Nickname",
                        "custom_field_key": "CF_nickname",
                        "field_type": "text",
                  },
                  {
                        "custom_field_id": 204,
                        "show_custom_name": "Nickname",
                        "custom_field_key": "CF_nickname",
                        "field_type": "longtext",
                  },
                  {
                        "custom_field_id": 203,
                        "show_custom_name": "Gender",
                        "custom_field_key": "CF_gender",
                        "field_type": "enum",
                        "field_value": "male,female"
                  }
            ]
      }
}

Fields

Name Type Description
status enum {success, error} Returns the status of the result.
code integer Returns the response code of the result.
err_msg string When error occur, returns the error's detail of the result.
data.custom_fields_count integer Returns the summary of custom fields in list.
data.custom_fields array Returns array of all custom fields in the list.

Response Code

Code Result Description
200 success Response to a successful request.
400 error The request is malformed or missing some required parameters.
401 error Unauthorized or the session_id expired.
404 error The list not found.

Custom field’s detail

  • This API endpoint allows you to get the custom field's detail.
  • You can send GET request and custom_field_id to list/{list_id}/custom_fields/{custom_field_id} API.
  • If the request is successful, Taximail API will return the object of custom field's details such as custom filed id, custom field name and etc.

GET https://api.taximail.com/v2/list/{list_id}/custom_fields/{custom_field_id}

Example Request

GET /v2/list/314/custom_fields/205 HTTP/1.1
Host: api.taximail.com
Authorization: "Bearer YOUR_SESSION_ID"

Example Result

{
  "status": "success",
  "code": 200,
  "data": {
              "custom_field_id": 205,
              "show_custom_name": "Nickname",
              "custom_field_key": "CF_nickname",
              "field_type": "text",
       }
}

Fields

Name Type Description
status enum {success, error} Returns the status of the result.
code integer Returns the response code of the result.
err_msg string When error occur, returns the error's detail of the result.
data.custom_field_id string Returns the custom field id.
data.show_custom_name string Returns the custom filed's name.
data.custom_field_key string Returns the generated custom field key.
data.field_type string Returns the custom field type.
data.field_value string Return the option value of enum type.

Response Code

Code Result Description
200 success Response to a successful request.
400 error The request is malformed or missing some required parameters.
401 error Unauthorized or the session_id expired.
404 error The list not found.
The custom field not found.

Updating

  • This API endpoint allows you to update the custom field.
  • You can PUT the object data such as field_name , field_key , field_type to list/{list_id}/custom_fields/{custom_field_id} API.

PUT https://api.taximail.com/v2/list/{list_id}/custom_fields/{custom_field_id}

Parameter Type Description Required
field_name string The custom field's name. Yes
field_key string The custom field's key. Yes
field_type string The custom field's type. Yes
field_value string The optional value of enum type. Yes

Example Request

PUT v2/list/314/custom_fields/205 HTTP/1.1
Host: api.taximail.com
Authorization: "Bearer YOUR_SESSION_ID"

field_name=Address&field_key=ADDRESS&field_type=Paragraph+text&validation_method=Disabled

Example Result

{
    "status": "success",
    "code": 200
}

Fields

Name Type Description
status enum {success, error} Returns the status of the result.
code integer Returns the response code of the result.
err_msg string When error occur, returns the error's detail of the result.

Response Code

Code Result Description
200 success Response to a successful request.
400 error The request is malformed or missing some required parameters.
Custom field key should not have special char.
Invalid custom field type.
This field is not match for custom field key.
401 error Unauthorized or the session_id expired.
404 error The list not found.
The custom field not found.
409 error Duplicate custom field key in list.

Deleting

  • This API endpoint allows you to delete a custom field.
  • You can send a DELETE request to list/{list_id}/custom_fields/{custom_field_id} API.
  • You can delete that one by one.

DELETE https://api.taximail.com/v2/list/{list_id}/custom_fields/{custom_field_id}

Example Request

DELETE v2/list/314/custom_fields/205 HTTP/1.1
Host: api.taximail.com
Authorization: "Bearer YOUR_SESSION_ID"

Example Result

{
  "status": "success",
  "code": 200
}

Fields

Name Type Description
status enum {success, error} Returns the status of the result.
code integer Returns the response code of the result.
err_msg string When error occur, returns the error's detail of the result.

Response Code

Code Result Description
200 success Response to a successful request.
400 error The request is malformed or missing some required parameters.
401 error Unauthorized or the session_id expired.
404 error The list not found.
The custom field not found.
Title
Title SEO [Optional]
Description SEO [Optional]
Friendly URL [Optional]
IFRAME Content [Optional]
Priority
Markdown
We use cookies
This website uses cookies to enhance your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from. You can manage your preferences by clicking Change Preferences. Learn more about this on Cookie policy
Change Preferences
Accept All