Gorgias Upload File
Gorgias Upload File
Uploads files from URLs to Gorgias' file storage
This action downloads one or more files from public URLs and uploads them to Gorgias' file storage. It returns the hosted Gorgias URL and details of each uploaded file. It's useful when media from offline handovers needs to be kept for longer than DigitalGenius' default 30-day retention period.
This action can help you attach files to a ticketThe files will be stored in Gorgias. To attach them to a ticket, pass the Attachments output into the
attachmentsfield of an action that sends a Gorgias message (e.g. an email reply or internal note).
- Each file is downloaded and then uploaded, one file at a time, in the order of File URLs.
- All URLs and file names are checked before anything is uploaded. If any entry is invalid, no files are uploaded.
- If a download or upload fails, the action stops at that file and the remaining files are not uploaded. With Safe Mode on, Attachments still contains the files that were uploaded before the failure.
- If Gorgias rate-limits the upload or returns a temporary server error, the action tries the upload up to 3 times in total before failing.
- Authentication uses your Gorgias connection in DigitalGenius, so you don't need to provide an API key.
File requirements
- Up to 10 files per action.
- Each file can be up to 20 MB.
- Each URL must be an absolute HTTPS URL (
http://links are rejected).- Each URL must be publicly accessible. URLs that point to private or internal network addresses are rejected, and so are URLs with login details in them (e.g.
https://user:password@...).- Redirects are followed (up to 5), as long as every redirect also meets these rules.
Inputs
In order to use the action in your flow you need to provide it with the following inputs:
| Input | Type | Description |
|---|---|---|
| File URLs | List | The public HTTPS URLs of the files to upload, e.g. ["https://example.com/label.pdf"]. Must contain between 1 and 10 URLs. |
| File Names | Optional List | The names to give the uploaded files, matched to File URLs by position (the first name goes with the first URL, and so on). If a name isn't provided for a URL, the file name is taken from the end of the URL (e.g. label.pdf). If the URL has no file name, attachment is used.Can't contain more entries than File URLs. Include the file extension (e.g. invoice.pdf), because it's used to work out the file type when the hosting server doesn't provide one. |
| Safe Mode | Optional Boolean | If set to True, errors are returned in the Error Message output and the flow keeps running. If False, an error stops the flow. Defaults to False. |
Outputs
| Output | Type | Description |
|---|---|---|
| Success | Boolean | True if all files were uploaded; False if any file failed. |
| Attachments | List | The uploaded files, as Gorgias file objects. Each object contains url (the file's hosted Gorgias URL), name, content_type and size (in bytes). This is the format expected by the attachments field of a Gorgias ticket message. |
| Error Message | String | The error details when the action fails and Safe Mode is enabled (e.g. file too large, non-HTTPS URL, download failed, Gorgias upload failed). Empty on a successful call. |
Example Attachments output:
[
{
"url": "https://uploads.gorgias.io/.../label.pdf",
"name": "label.pdf",
"content_type": "application/pdf",
"size": 48213
}
]
File typeThe file type is taken from the server that hosts the file. If the server sends no type, or only a generic one (e.g.
binary/octet-stream, which is common for S3), the type is worked out from the file name instead.
This action uses the following Gorgias endpoint:
POST /api/upload
We're using the query parametertype = attachment
Updated about 1 hour ago
