Phone Field Value
A phone field value consists of its value
property which holds one or multiple phone number entries. An entry contains the phone number itself, plus its type, e.g. work
or home
.
Currently the following values are allowed as type: work
, work_fax
, home
, home_fax
, main
, mobile
, and other
. If no type is provided, phone address entries always default to work
.
Record creation
A phone field value can be created as part of a record creation. It is possible to provide either a string, an object following the phone number 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 phone" field with ID 2, type multi_phone
and external ID customer_phone
:
- 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_phone":
[
{"type": "work", "phone": "+1 444 555"},
{"type": "home", "phone": "+1 777 111"}
]
}
}'
{
"fields": {
"customer_phone": [
{ "type": "work", "phone": "+1 444 555" },
{ "type": "home", "phone": "+1 777 111" }
]
}
}
{
"record_id": 1,
"title": "Tape Technologies GmbH",
"fields": [
{
"field_id": 2,
"external_id": "customer_phone",
"label": "Customer phone",
"type": "phone",
"field_type": "multi_phone",
"values": [
{
"id": 100,
"value": "+1 444 555",
"type": "work"
},
{
"id": 101,
"value": "+1 777 111",
"type": "home"
}
]
}
]
}
Note that the individual phone number entries contain an ID. Be sure to include them in updates, to keep existing phone entries. If you omit the ID, new entries will be created instead and the respective existing ones will be removed.
Record retrieval
A phone 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_phone",
"label": "Customer phone",
"type": "phone",
"field_type": "multi_phone",
"values": [
{
"id": 100,
"value": "+1 444 555",
"type": "work"
},
{
"id": 101,
"value": "+1 777 111",
"type": "home"
}
]
}
]
}
Record update
One or more phone 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 phone entries of a phone field with external ID customer_phone
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_phone":
[
{ "id": 100, "type": "work", "phone": "+1 444 333" },
{ "type": "other", "phone": "+1 888 888" }
]
}
}'
{
"fields": {
"customer_phone": [
{ "id": 100, "type": "work", "phone": "+1 444 333" },
{ "type": "other", "phone": "+1 888 888" }
]
}
}
{
"record_id": 1,
"title": "Tape Technologies GmbH",
"fields": [
{
"field_id": 2,
"external_id": "customer_phone",
"label": "Customer phone",
"type": "phone",
"field_type": "multi_phone",
"values": [
{
"id": 100,
"value": "+1 444 333",
"type": "work"
},
{
"id": 102,
"value": "+1 888 888",
"type": "other"
}
]
}
]
}