Skip to content

Custom Metadata

The MASV API allows Team admins to create and manage custom metadata forms on Portals. When a Portal has a form associated with it, a response to that form called “Form Data” is required before a Portal package can be created.

Metadata can be delivered in file format and in package upload notification emails. The following delivery formats are supported:

  • json
  • csv
  • xml
  • email_body

Delivery formats are set on the form and multiple formats can be selected at a time. For file format deliverables, files are placed in the root of the relevant Portal package.

  1. Team admin creates a form for a Portal.
  2. Team admin updates the form to set form fields.
  3. User creates a response to this form.
  4. User creates a package, providing the form response in the create request.
  5. User completes the upload flow.
  6. When the user finalizes the package, the metadata is delivered.
MethodRoute
POST/v1/portals/{portal_id}/form
NameTypeRequiredDescription
X-API-KEYStringYesAPI key
Content-TypeStringYesMust be application/json
NameTypeRequiredDescription
nameStringYesName of the form
delivery_formatsString[]YesArray of delivery formats
form_template_idStringNoID of the form template this form was based on
fieldsField[]NoOptional array of fields
Terminal window
curl -d '{"name": "$FORM_NAME", "delivery_formats": ["csv", "xml"]}' \
-H "X-API-KEY: $API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.massive.app/v1/portals/$PORTAL_ID/form

Returns 201 Created with the form object.

Form fields have the following properties:

PropertyTypeDescription
nameStringField name (must be unique per form, not shown to users)
labelStringLabel shown to users
typeEnumInput type: checkbox, radio, dropdown, date, short_text, long_text, number, url, email, package_name, package_description, sender_email
visibilityEnumVisibility: required, optional, readonly, hidden
default_valueStringDefault value
positionIntegerRender position (ascending order)
optionsString[]Options for checkbox, radio, dropdown types

Fields of type package_name, package_description, and sender_email are used in the package creation process. There can only be one field of each type in a form.

MethodRoute
PUT/v1/metadata/forms/{form_id}
NameTypeRequiredDescription
X-API-KEYStringYesAPI key
Content-TypeStringYesMust be application/json

Pass the full form object including modifications:

NameTypeDescription
nameStringThe form’s name
delivery_formatsString[]Delivery formats
disabledBooleanIf true, the form is disabled
fieldsFormField[]Array of form fields
Terminal window
curl -d '{"name": "$NEW_NAME", "delivery_formats": ["json", "csv"], "disabled": false, "fields": [...]}' \
-H "X-API-KEY: $API_KEY" \
-H "Content-Type: application/json" \
-X PUT https://api.massive.app/v1/metadata/forms/$FORM_ID

When submitting a form response, the only validation performed is on required fields. If a required field is missing a value, an error will be returned.

MethodRoute
POST/v1/portals/{portal_id}/form/responses
NameTypeRequiredDescription
X-API-KEYString*API key
X-Access-CodeString*The Portal’s access code
Content-TypeStringYesMust be application/json

Either X-API-KEY or X-Access-Code is required.

A JSON object containing key/value pairs for each field. The key is the field’s name, the value is an object with a value property:

{
"uploader_name": { "value": "Example uploader name" },
"description": { "value": "Example package description" },
"name": { "value": "Example package name" },
"sender_email": { "value": "[email protected]" }
}
Terminal window
curl -d '{"uploader_name": {"value": "Example name"}}' \
-H "X-API-KEY: $API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.massive.app/v1/portals/$PORTAL_ID/form/responses

Returns 201 Created with the form response object including its id.

To attach a form response to a new Portal package, add the form response’s id to the create Portal package body under the key form_data_id. See Create a Portal package.

MethodRoute
GET/v1/packages/{package_id}/metadata
NameTypeRequiredDescription
X-Package-TokenStringYesFull-access package JSON Web Token
Terminal window
curl -H "X-Package-Token: $PACKAGE_TOKEN" \
-X GET https://api.massive.app/v1/packages/$PACKAGE_ID/metadata

Returns 200 OK with the form response object including all field values.

To get the fields required to create a Portal form response, use the Get Portal endpoint. If it has a form requirement, an array of form fields will be returned under custom_metadata.

MethodRoute
GET/v1/portals/{portal_id}
NameTypeRequiredDescription
X-API-KEYString*API key
X-Access-CodeString*Portal’s access code

Either X-API-KEY or X-Access-Code is required.

MethodRoute
DELETE/v1/metadata/forms/{form_id}
Terminal window
curl -H "X-API-KEY: $API_KEY" \
-X DELETE https://api.massive.app/v1/metadata/forms/$FORM_ID

Returns 204 No Content.

MethodRoute
POST/v1/teams/{team_id}/forms/templates
NameTypeRequiredDescription
nameStringYesName of the form template
delivery_formatsString[]YesArray of delivery formats
Terminal window
curl -d '{"name": "$FORM_TEMPLATE_NAME", "delivery_formats": ["csv", "xml"]}' \
-H "X-API-KEY: $API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.massive.app/v1/teams/$TEAM_ID/forms/templates
MethodRoute
PUT/v1/metadata/forms/templates/{form_template_id}

Same body format as updating forms.

MethodRoute
DELETE/v1/metadata/forms/templates/{form_template_id}
Terminal window
curl -H "X-API-KEY: $API_KEY" \
-X DELETE https://api.massive.app/v1/metadata/forms/templates/$FORM_TEMPLATE_ID

Returns 204 No Content.