Download Attachment
This REST call allows you to download file from attachment field.
URL
api/v1/attachments/attachmentId
Method
GET
URL parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| attachmentId | String | Yes | The ID of the attachment in the attachment field that you want to fetch. |
Header parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| X-User-Id | String | Yes | The ID of the user who wants to trigger the REST action. This ID is returned by the authentication call. |
| X-Auth-Token | String | Yes | The authentication token that the authentication call returned. |
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
| environmentId | String | Yes | The ID of the environment. |
| ddId | String | No | The ID of the document definition. Either the __id_ or name of the document definition should be supplied. |
| ddName | String | No | The name of the document definition. Either the __id_ or name of the document definition should be supplied. |
| documentId | String | No | The internal ID of the document. Either the __id_ or externalId field should be supplied. |
| externalId | String | No | The external ID of the source document. Either the __id_ or externalId field should be supplied. |
| fieldName | String | Yes | The name of the field from which the attachment should be downloaded. |
| lineName | String | No | If the attachment field is part of a line, enter the name of the line here. |
| lineId | String | No | The ID of the line from which the attachments should be copied. |
| lineExternalId | String | No | The external ID of the line from which the attachment should be downloaded. If the lineName field has a value, either the lineId or lineExternalId should be entered. |
Response
Success
In case of success response - the requested file will be downloaded.
Fail
In case of any error JSON response will be provided:
{
"status": "error",
"error": "The message of error will go here"
}
An example:
curl -X GET '/api/v1/attachments/2a301795b96a9b4d68bf2d16?ddName=menuItem&documentId=3DKKq68tvhpu9bk24&fieldName=preparationInstructions&lineName=ingredients&lineId=74240700f347e0b8063b940d&environmentId=maxedy_pizza' \
-H "X-Auth-Token: SRl19O4MjI1i4L59ekCeEHvkWHY4J2Cb9T6cBuaH8df" \
-H "X-User-Id: a6gA9rYaGTFKPrT5P"