Generate attachment upload URL
https://api.light.inc/v1/attachments/upload-url
Generates a secure upload URL for attachment files
Permissions checked: vendors/portal-forms:update (COMPANY_ADMIN, VENDOR_MANAGEMENT) and whatever editing the record it belongs to needs, such as a bill. What a call needs depends on the caller, the record and the request.
Authorization
Send one of these on every request. See Authentication for how to get credentials.
- API key
Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.
- Bearer token
Request body
application/json;charset=UTF-8
-
resourceIdstring · uuid -
fileNamestring -
contentTypestring
Response
-
uploadUrlstring · url -
keystringNote
Pass this as
documentKeytoPOST /v1/attachmentsonce the upload is done. -
metadataobjectNote
Send every entry as a request header on the
PUTtouploadUrl, exactly as returned. They are signed into the URL; the upload is rejected without them.