Email Field Value
An email field value consists of its value
property which holds one or multiple email address entries. An entry contains the email address itself, plus its type, e.g. work
or home
. Currently the following values are allowed as type: work
, home
and other
. If no type is provided, email address entries always default to work
.
Record creation
An email field value can be created as part of a record creation. It is possible to provide either a string, an object following the email address entry structure or an array of those two. It is advised to use an array of objects for the best accuracy of the provided data.
Here is an example request body for creating a record with a value for the "Customer email" field with ID 2, type multi_email
and external ID customer_email
:
- cURL
- JSON
curl -X POST https://api.tapeapp.com/v1/record/app/1 \
-u user_key_replace_with_your_api_key: \
-H "Content-Type: application/json" \
--data '{
"fields": {
"customer_email":
[
{"type": "work", "email": "[email protected]"},
{"type": "home", "email": "[email protected]"}
]
}
}'
{
"fields": {
"customer_email": [
{ "type": "work", "email": "[email protected]" },
{ "type": "home", "email": "[email protected]" }
]
}
}
{
"record_id": 1,
"title": "Tape Technologies GmbH",
"fields": [
{
"field_id": 2,
"external_id": "customer_email",
"label": "Customer email",
"type": "email",
"field_type": "multi_email",
"values": [
{
"id": 100,
"value": "[email protected]",
"type": "work"
},
{
"id": 101,
"value": "[email protected]",
"type": "home"
}
]
}
]
}
Note that the individual email address entries contain an ID. Be sure to include them in updates, to keep existing email entries. If you omit the ID, new entries will be created instead and the respective existing ones will be removed.
Record retrieval
An email field value can be retrieved as part of a record retrieval:
curl https://api.tapeapp.com/v1/record/1 \
-u user_key_replace_with_your_api_key:
{
"record_id": 1,
"title": "Tape Technologies GmbH",
"fields": [
{
"field_id": 2,
"external_id": "customer_email",
"label": "Customer email",
"type": "email",
"field_type": "multi_email",
"values": [
{
"id": 100,
"value": "[email protected]",
"type": "work"
},
{
"id": 101,
"value": "[email protected]",
"type": "home"
}
]
}
]
}
Record update
One or more email field values can be updated as part of a record update, and individual entries can be updated via their ID. Here is an example request body for updating the email entries of an email field with external ID customer_email
of a record:
- cURL
- JSON
curl -X PUT https://api.tapeapp.com/v1/record/1 \
-u user_key_replace_with_your_api_key: \
-H "Content-Type: application/json" \
--data '{
"fields": {
"customer_email":
[
{ "id": 100, "type": "work", "email": "[email protected]" },
{ "type": "other", "email": "[email protected]" }
]
}
}'
{
"fields": {
"customer_email": [
{ "id": 100, "type": "work", "email": "[email protected]" },
{ "type": "other", "email": "[email protected]" }
]
}
}
{
"record_id": 1,
"title": "Tape Technologies GmbH",
"fields": [
{
"field_id": 2,
"external_id": "customer_email",
"label": "Customer email",
"type": "email",
"field_type": "multi_email",
"values": [
{
"id": 100,
"value": "[email protected]",
"type": "work"
},
{
"id": 102,
"value": "[email protected]",
"type": "other"
}
]
}
]
}