Skip to main content
Apps and views

Image field

Request

curl -X POST https://api.tapeapp.com/v1/app/ \
-H "Authorization: Bearer $TAPE_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"workspace_id": 1,
"name": "Properties",
"item_name": "Property",
"fields": [
{
"field_type": "multi_image",
"config": {
"label": "Photos",
"description": "Photos of the property.",
"required": false
}
}
]
}'
Response
{
"app_id": 1,
"workspace_id": 1,
"slug": "properties",
"external_id": "properties",
"name": "Properties",
"record_name": "Property",
"item_name": "Property",
"type": "database",
"config": {
"item_name": "Property",
"name": "Properties"
},
"fields": [
{
"field_id": 1,
"external_id": "photos",
"slug": "photos",
"label": "Photos",
"type": "file",
"field_type": "multi_image",
"config": {
"label": "Photos",
"slug": "photos",
"external_id": "photos",
"description": "Photos of the property.",
"show_description": false,
"required": false,
"always_hidden": false,
"hidden_if_empty": false,
"primary": true,
"settings": {
"multiple": true
}
}
}
]
}
Request

curl -X PUT https://api.tapeapp.com/v1/app/1 \
-H "Authorization: Bearer $TAPE_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"fields": [
{
"field_id": 1,
"config": {
"label": "Photos",
"description": "Interior and exterior photos of the property.",
"required": false
}
}
]
}'
Response
{
"app_id": 1,
"workspace_id": 1,
"slug": "properties",
"external_id": "properties",
"name": "Properties",
"record_name": "Property",
"item_name": "Property",
"type": "database",
"config": {
"item_name": "Property",
"name": "Properties"
},
"fields": [
{
"field_id": 1,
"external_id": "photos",
"slug": "photos",
"label": "Photos",
"type": "file",
"field_type": "multi_image",
"config": {
"label": "Photos",
"slug": "photos",
"external_id": "photos",
"description": "Interior and exterior photos of the property.",
"show_description": true,
"required": false,
"always_hidden": false,
"hidden_if_empty": false,
"primary": true,
"settings": {
"multiple": true
}
}
}
]
}

Use an image field to store photos and other images in a record.

Tape has one image field type: multi_image is the Image field. It holds one or more images.

An image field has the common field properties and read-only settings. To read and write the images of a record, see Image field value.

Image field object
{
"field_id": 1,
"external_id": "photos",
"slug": "photos",
"label": "Photos",
"type": "file",
"field_type": "multi_image",
"config": {
"label": "Photos",
"slug": "photos",
"external_id": "photos",
"description": "Photos of the property.",
"show_description": true,
"required": false,
"always_hidden": false,
"hidden_if_empty": false,
"primary": false,
"settings": {
"multiple": true
}
}
}

typestring

"file" for the image field.

Example value "file"

field_typestring

"multi_image".

Example value "multi_image"

config.settings.multiple (read-only)boolean

true.

Example value true

You can't set settings through the API.

App creation​

Use the create app endpoint to create image fields together with a new app.

POST/v1/appapi.tapeapp.com
Request

curl -X POST https://api.tapeapp.com/v1/app/ \
-H "Authorization: Bearer $TAPE_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"workspace_id": 1,
"name": "Properties",
"item_name": "Property",
"fields": [
{
"field_type": "multi_image",
"config": {
"label": "Photos",
"description": "Photos of the property.",
"required": false
}
}
]
}'
Response
{
"app_id": 1,
"workspace_id": 1,
"slug": "properties",
"external_id": "properties",
"name": "Properties",
"record_name": "Property",
"item_name": "Property",
"type": "database",
"config": {
"item_name": "Property",
"name": "Properties"
},
"fields": [
{
"field_id": 1,
"external_id": "photos",
"slug": "photos",
"label": "Photos",
"type": "file",
"field_type": "multi_image",
"config": {
"label": "Photos",
"slug": "photos",
"external_id": "photos",
"description": "Photos of the property.",
"show_description": false,
"required": false,
"always_hidden": false,
"hidden_if_empty": false,
"primary": true,
"settings": {
"multiple": true
}
}
}
]
}

The example creates a properties app in the workspace with ID 1. The app gets a multi_image field "Photos". The example leaves out other fields of a properties app, like "Name", "Address" or "Price".

Find the workspace ID with Retrieve workspaces.

General behavior

  • Without primary, Tape makes the first field of the request the primary field. Here, that's "Photos".
  • A new image field doesn't show its description as help text yet (show_description is false). To show it, send the description again in a field update.

Requirements: apps:edit, and a workspace role that may edit apps in the workspace. Works with a personal access token, an OAuth access token or a user API key.

App update​

Use the update app endpoint to create new image fields in an app or to change existing ones.

PUT/v1/app/{appId}api.tapeapp.com
Request

curl -X PUT https://api.tapeapp.com/v1/app/1 \
-H "Authorization: Bearer $TAPE_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"fields": [
{
"field_id": 1,
"config": {
"label": "Photos",
"description": "Interior and exterior photos of the property.",
"required": false
}
}
]
}'
Response
{
"app_id": 1,
"workspace_id": 1,
"slug": "properties",
"external_id": "properties",
"name": "Properties",
"record_name": "Property",
"item_name": "Property",
"type": "database",
"config": {
"item_name": "Property",
"name": "Properties"
},
"fields": [
{
"field_id": 1,
"external_id": "photos",
"slug": "photos",
"label": "Photos",
"type": "file",
"field_type": "multi_image",
"config": {
"label": "Photos",
"slug": "photos",
"external_id": "photos",
"description": "Interior and exterior photos of the property.",
"show_description": true,
"required": false,
"always_hidden": false,
"hidden_if_empty": false,
"primary": true,
"settings": {
"multiple": true
}
}
}
]
}

The example changes the description of the "Photos" field (ID 1) of the properties app.

Find the app ID and the field IDs in the Developer view of the app.

General behavior

  • A field with field_id updates that field. A field without field_id creates a new field and needs a field_type.
  • Send required, always_hidden, hidden_if_empty and description with every field you update. Tape sets left-out switches to false and hides the help text without description. See Create and update fields.
  • Fields that aren't in the request stay unchanged.

Requirements: apps:edit, and Full access to the app. Works with a personal access token, an OAuth access token or a user API key.

Errors

  • Every field you update needs config.label, even if the label stays the same. Without it, Tape rejects the request with 400 and input_validation. The message reads, for example, Invalid input: data/fields/0/config must have required property 'label'.

Next steps​