Get an upload URL for a field reference file

posthttps://api.expiryedge.com/v1/getCollectionTemplateReferenceUploadUrl
editor or admin60/minAny method
Request
curl -X POST 'https://api.expiryedge.com/v1/getCollectionTemplateReferenceUploadUrl' \
  -H "Authorization: Bearer $EXPIRYEDGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "templateId": "tpl_W9onboard",
  "fieldId": "fld_insurance",
  "filename": "sample-certificate.pdf",
  "contentType": "application/pdf",
  "sizeBytes": 120331
}'
Response
{
  "uploadUrl": "https://storage.googleapis.com/stylingsphere.appspot.com/organizations/org_northwind/collection-templates/tpl_W9onboard/fields/fld_insurance/reference-1b2c-sample-certificate.pdf?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Expires=900&X-Goog-Signature=...",
  "storagePath": "organizations/org_northwind/collection-templates/tpl_W9onboard/fields/fld_insurance/reference-1b2c-sample-certificate.pdf",
  "uploadHeaders": {
    "Content-Type": "application/pdf"
  }
}

Returns a V4 signed PUT URL valid for 15 minutes, bound to contentType. Send every header in uploadHeaders with the PUT. Max 2MB. Then put {storagePath, originalFilename} in the field's reference_file when saving the template. The handler does not check the HTTP method.

Body parameters

application/json
  • templateIdstringrequired
    Existing template id, or the client id you will pass to createCollectionTemplate.
    pattern: ^[a-zA-Z0-9_-]+$
  • fieldIdstringrequired
    pattern: ^[a-zA-Z0-9_-]+$
  • filenamestringrequired
  • contentTypestringrequired
    One of the MIME types listed in CollectionTemplateField.allowed_types.
  • sizeBytesintegerrequired
    max: 2097152

Returns

200
Signed upload URL.
  • uploadUrlstringrequired
    format: uri
  • storagePathstringrequired
  • uploadHeadersmap of stringrequired
    Send every one of these headers with the PUT.

Errors

400
The request is missing required fields or contains invalid values.
401
Missing, expired or invalid bearer token.
403
Authenticated, but your role or organization does not allow this action.
404
The record does not exist or is not in your organization.
429
Too many requests for this endpoint from your IP. Wait Retry-After seconds.