Number field value
- cURL
- JSON
curl -X POST https://api.tapeapp.com/v1/record/app/1 \
-H "Authorization: Bearer $TAPE_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"fields": {
"deal_name": "Solar roof for Acme Inc.",
"closing_amount": 85000
}
}'
{
"fields": {
"deal_name": "Solar roof for Acme Inc.",
"closing_amount": 85000
}
}
{
"record_id": 1,
"title": "Solar roof for Acme Inc.",
"fields": [
{
"field_id": 1,
"external_id": "deal_name",
"label": "Deal Name",
"type": "text",
"field_type": "single_text",
"values": [{ "value": "Solar roof for Acme Inc." }]
},
{
"field_id": 2,
"external_id": "closing_amount",
"label": "Closing Amount",
"type": "number",
"field_type": "number",
"values": [{ "value": 85000, "formatted": "85,000.00€" }]
}
]
}
curl https://api.tapeapp.com/v1/record/1 \
-H "Authorization: Bearer $TAPE_TOKEN"
{
"record_id": 1,
"title": "Solar roof for Acme Inc.",
"fields": [
{
"field_id": 1,
"external_id": "deal_name",
"label": "Deal Name",
"type": "text",
"field_type": "single_text",
"values": [{ "value": "Solar roof for Acme Inc." }]
},
{
"field_id": 2,
"external_id": "closing_amount",
"label": "Closing Amount",
"type": "number",
"field_type": "number",
"values": [{ "value": 85000, "formatted": "85,000.00€" }]
}
]
}
- cURL
- JSON
curl -X PUT https://api.tapeapp.com/v1/record/1 \
-H "Authorization: Bearer $TAPE_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"fields": {
"closing_amount": 92500.5
}
}'
{
"fields": {
"closing_amount": 92500.5
}
}
{
"record_id": 1,
"title": "Solar roof for Acme Inc.",
"fields": [
{
"field_id": 1,
"external_id": "deal_name",
"label": "Deal Name",
"type": "text",
"field_type": "single_text",
"values": [{ "value": "Solar roof for Acme Inc." }]
},
{
"field_id": 2,
"external_id": "closing_amount",
"label": "Closing Amount",
"type": "number",
"field_type": "number",
"values": [{ "value": 92500.5, "formatted": "92,500.50€" }]
}
]
}
Use a number field value to read and write the number of a record.
The value of a number field is a number, like 1, 1.0 or 1.5. A number field holds at most one value.
{
"field_id": 2,
"external_id": "closing_amount",
"label": "Closing Amount",
"type": "number",
"field_type": "number",
"values": [{ "value": 85000, "formatted": "85,000.00€" }]
}
typestring
"number".
field_typestring
"number".
values[].valuenumber
The number.
values[].formattedstring
The number with the decimal places and the unit from the field settings.
| Property | Type | Description | Example value |
|---|---|---|---|
type | string | "number". | "number" |
field_type | string | "number". | "number" |
values[].value | number | The number. | 85000 |
values[].formatted | string | The number with the decimal places and the unit from the field settings. | "85,000.00€" |
Each field in a record response also contains the field's config. The examples on this page leave it out.
Record creation
Use the create record endpoint to set number values on a new record.
/v1/record/app/{app_id}api.tapeapp.com- cURL
- JSON
curl -X POST https://api.tapeapp.com/v1/record/app/1 \
-H "Authorization: Bearer $TAPE_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"fields": {
"deal_name": "Solar roof for Acme Inc.",
"closing_amount": 85000
}
}'
{
"fields": {
"deal_name": "Solar roof for Acme Inc.",
"closing_amount": 85000
}
}
{
"record_id": 1,
"title": "Solar roof for Acme Inc.",
"fields": [
{
"field_id": 1,
"external_id": "deal_name",
"label": "Deal Name",
"type": "text",
"field_type": "single_text",
"values": [{ "value": "Solar roof for Acme Inc." }]
},
{
"field_id": 2,
"external_id": "closing_amount",
"label": "Closing Amount",
"type": "number",
"field_type": "number",
"values": [{ "value": 85000, "formatted": "85,000.00€" }]
}
]
}
The example creates a deal with the "Deal Name" field (ID 1, type single_text, slug deal_name) and the "Closing Amount" field (ID 2, type number, slug closing_amount). The "Closing Amount" field has two decimal places and the unit "€" after the value.
General behavior
- Use the field ID or the field's slug (returned as
external_idin records) as the key infields. - Send the number as a number or as a string, for example
85000or"85000.50". Tape also accepts{ "value": 85000 }or an array with one of these. - Tape removes spaces at the start and the end of a string.
Requirements: records:edit. Works with a personal access token, an OAuth access token or a user API key.
Errors
- A value that isn't a number returns
400withvalidationand the messageInvalid input for number field with ID …. - A number outside the allowed range returns
400withvalidation.
See Errors for all error codes.
Record retrieval
Use the retrieve record endpoint to read the number values of a record.
/v1/record/{record_id}api.tapeapp.comcurl https://api.tapeapp.com/v1/record/1 \
-H "Authorization: Bearer $TAPE_TOKEN"
{
"record_id": 1,
"title": "Solar roof for Acme Inc.",
"fields": [
{
"field_id": 1,
"external_id": "deal_name",
"label": "Deal Name",
"type": "text",
"field_type": "single_text",
"values": [{ "value": "Solar roof for Acme Inc." }]
},
{
"field_id": 2,
"external_id": "closing_amount",
"label": "Closing Amount",
"type": "number",
"field_type": "number",
"values": [{ "value": 85000, "formatted": "85,000.00€" }]
}
]
}
Requirements: records:read. Works with a personal access token, an OAuth access token or a user API key.
Record update
Use the update record endpoint to change the number values of a record.
/v1/record/{record_id}api.tapeapp.com- cURL
- JSON
curl -X PUT https://api.tapeapp.com/v1/record/1 \
-H "Authorization: Bearer $TAPE_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"fields": {
"closing_amount": 92500.5
}
}'
{
"fields": {
"closing_amount": 92500.5
}
}
{
"record_id": 1,
"title": "Solar roof for Acme Inc.",
"fields": [
{
"field_id": 1,
"external_id": "deal_name",
"label": "Deal Name",
"type": "text",
"field_type": "single_text",
"values": [{ "value": "Solar roof for Acme Inc." }]
},
{
"field_id": 2,
"external_id": "closing_amount",
"label": "Closing Amount",
"type": "number",
"field_type": "number",
"values": [{ "value": 92500.5, "formatted": "92,500.50€" }]
}
]
}
The example changes the "Closing Amount" field (slug closing_amount) of the record with ID 1.
General behavior
- The new number replaces the old number.
- To clear the field, send
nullor an empty string"". - Tape doesn't stop you from clearing a required number field through the API. Send a value instead.
- Fields that aren't in the request keep their values.
{
"fields": {
"closing_amount": null
}
}
A cleared field isn't in the fields of the response.
Requirements: records:edit. Works with a personal access token, an OAuth access token or a user API key.
Errors
Same errors as under Record creation.
See Errors for all error codes.