Get all custom fields

To get all custom fields, use: 

GET /api/v2/customfields

 with the parameters:

NameRequired?ExampleDescription
pageNo3Fetch the specified results page. The default is 1.
limitNo25The number of results per page. The default is 10.

You will receive the standard paginated response:

ParameterExampleDescription
page3The current fetched page.
limit25The number of results per page.
pageCount150The total number of pages.
resourcesArray of customfields.See next section for customfields format response details.

Get the details of a specific custom field

To get a single custom field, use: 

GET /api/v2/customfields/{id}

where id is a custom field ID. Note, this command has no parameters.

You will receive a response in the following format:

ParameterExampleDescription
id31Custom field ID.
nameDOBCustom field name.
createdAt2015-02-11T07:33:19+0000Custom field creation time.

Add a new custom field

To add a new custom field, use: 

POST /api/v2/customfields

with the following parameters:

NameRequired?ExamplesDescription
nameYes DOBCustom field name.

If successful, you will receive this response:

ParameterExampleDescription
id31Custom field ID.
href/api/v2/customfields/31Link to Custom field.

Edit a custom field

To modify a custom field name, use:

PUT /api/v2/customfields/{id}

where id is the custom field ID.  Use the command with the same parameters as those used when creating it:

NameRequired?ExamplesDescription
nameYes DOBCustom field name.

If successful, you’ll receive this response:

ParameterExampleDescription
id31Custom field ID.
href/api/v2/customfields/31Link to Custom field.

Delete a custom field

To delete a custom field, use:

DELETE /api/v2/customfields/{id}

 where  id is a custom field ID. Note, this command has no parameters. If successful, this command will return the standard delete response (204 No Content), otherwise the standard error response will be returned.

When a custom field is deleted, all the information that was added to contacts under this custom field will also be lost.

Edit the custom field value of a specified contact

To modify the custom field value of a specified contact, use:

PUT /api/v2/customfields/{id}/update

where id is the custom field ID. Use the following parameters:

NameRequired?ExampleDescription
contactIdYes50315Contact ID.
valueYes1983-08-31Custom field value. Note that this value is not parsed in any way. It is stored and used in tags exactly as you send it.

If successful, you will receive this response:

ParameterExampleDescription
id31Custom field ID.
href/api/v2/contacts/50315Link to Contact.

The next step

You’ve now learned how to manage custom fields via the TextMagic API. Please continue to the next section to learn how to manage your Account via the TextMagic API.