Image Field Value
An image field value consists of its value
property which holds a reference to an image. An image has the properties id
(unique ID), filename
(the filename), size
(filesize in bytes), download_url
(URL to download the file) and others. Right now, there is only a multi_image
field, where the value can hold multiple image references.
Image fields behave quite similarly to attachment fields, allowing only image files.
More details on the file object and the two-step file upload process can be found here.
Record creation
A image field value can be created as part of a record creation. Files can be specified as temporary file IDs (strings), existing file IDs of the same field (integers) and existing file IDs of different Attachment or Image fields (integers). Existing files of Attachment fields can only be used as inputs to the image field, in case the files are of type jpeg
, jpg
, png
, gif
, tiff
, svg
, bmp
or webp
.
Here is an example request body for creating a record with a value for the "Recruting Photos" field with ID 3, type multi_image
and external ID recruiting_photos
:
- 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": {
"recruiting_photos": ["temporary-file-2", "temporary-file-3"]
}
}'
{
"fields": {
"recruiting_photos": ["temporary-file-2", "temporary-file-3"]
}
}
{
"record_id": 1,
"title": "200301_recruiting_photo_1.jpeg",
"fields": [
{
"field_id": 3,
"external_id": "recruiting_photos",
"label": "Recruiting Photos",
"field_type": "multi_image",
"type": "image",
"values": [
{
"value": {
"id": 100,
"filename": "200301_recruiting_photo_1.jpeg",
"size": 12300
}
},
{
"value": {
"id": 101,
"filename": "200301_recruiting_photo_2.jpeg",
"size": 11300
}
}
]
}
]
}
Record retrieval
A image 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": "200301_recruiting_photo_1.jpeg",
"fields": [
{
"field_id": 3,
"external_id": "recruiting_photos",
"label": "Recruiting Photos",
"field_type": "multi_image",
"type": "image",
"values": [
{
"value": {
"id": 100,
"filename": "200301_recruiting_photo_1.jpeg",
"size": 12300
}
},
{
"value": {
"id": 101,
"filename": "200301_recruiting_photo_2.jpeg",
"size": 11300
}
}
]
}
]
}
Record update
One or more image field values can be updated as part of a record update. Both existing IDs (integers) as well as temporary file IDs (strings) can be provided as input. Existing IDs of the same field (integers), existing IDs of different Attachment or Image fields (integers) as well as temporary file IDs (strings) can be provided as input. Existing files of Attachment fields can only be used as inputs to the image field, in case the files are of type jpeg
, jpg
, png
, gif
, tiff
, svg
, bmp
or webp
.
Here is an example request body for updating multiple image field values 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": {
"letter_of_recommendation": "temporary-file-2",
"recruiting_photos": ["temporary-file-6", 102]
}
}'
{
"fields": {
"recruiting_photos": ["temporary-file-6", 102]
}
}
{
"record_id": 1,
"title": "200301_recruiting_photo_1.jpeg",
"fields": [
{
"field_id": 3,
"external_id": "recruiting_photos",
"label": "Recruiting Photos",
"field_type": "multi_image",
"type": "image",
"values": [
{
"value": {
"id": 100,
"filename": "200301_recruiting_photo_1.jpeg",
"size": 12300
}
},
{
"value": {
"id": 101,
"filename": "200301_recruiting_photo_2.jpeg",
"size": 11300
}
}
]
}
]
}