Extracting Attachments
Introduction
Attachments can be extracted from payloads and saved before the payload is saved. This is highly recommended as it saves from storing the attachment itself in the payload on the HTTP Request record.
Attachment data should be extracted, saved as an attachment, and replaced with the attachment sys_id in the format <x-attachment-data sys_id="...">
. Unifi will automatically collect the attachment ids, create Bonded Attachments for each of them, and finally move the attachments to the target record.
We strongly recommend streaming attachments when possible. Attachments can be streamed into Unifi which bypasses the need for extraction, supports binary file sharing, and also allows for sizes up to 50MB (providing your instance and integration configuration supports this).
This is available for all new integrations from Unifi 3.0.
For more information on configuring inbound streaming, please see our How to Handle Attachments guide.
Variables
Variable | Type | Description |
---|---|---|
| String,Stream | The raw inbound payload object to process. Attachment data should be removed and replaced with the attachment sys_id in the format "<x-attachment-data sys_id=> |
| Object | An object containing the request headers. |
| Object | A key-value pair object of URL parameters. |
| GlideRecord | The record of the |
| Object | An object containing specific properties for processing. |
| Boolean | True if the inbound payload is a stream. |
| Object | Object containing several functions that can be used for logging. |
| String | The error message to return from the script. Alternatively you can simply throw a |
XML Example
JSON Example
Last updated