FRAMES | NO FRAMES Description | Parameters | Examples | Response
Add Attachment (Operation)
URL http://<attachments-url>/add
Parent Resource Attachments

Description

Adds a file or URL attachment to a job. The attachment can be a linked file, an embedded file, or a linked URL. A linked file attachment consists of a file path that points to a location on a local disk drive or a shared folder. An embedded file attachment stores the actual data of the file within the Workflow Manager database. A linked URL attachment stores a URL that can be opened in a web browser.

Linked URL attachments are supported from version 10.1 onwards.

When adding an embedded attachment to a job, a special HTTP POST request must be made in order to properly upload a file. The request must be a multi-part request as per IETF RFC1867.

Parameters

Parameter Details
f Description: The response format. The default response format is html.

Values: html | json
user Required
Description: The username of the client.
storageType Description: Determines whether the attachment is a linked file (1), an embedded file (2), or a linked URL (3). The default storage type is 2 (embedded file).

Values: 1 | 2 | 3
filePath Required (for linked attachments)
Description: File path or URL that is to be linked. This can be either a local file path (e.g. C:\Documents\MyFile.pdf), a shared folder (e.g. \\server\WorkflowDocs\MyFile.pdf), or a URL (e.g. http://www.arcgis.com/).

Example Usage

Example 1: URL for adding a linked file attachment to job ID 5 in the "Workflow" service on sampleserver.

http://sampleserver/arcgis/rest/services/Workflow/WMServer/jobs/5/attachments/add?user=cjones&storageType=1&filePath=C:\Documents\Job_Guidelines.pdf

Example 2: URL for uploading a file as an embedded attachment to job ID 5 in the "Workflow" service on sampleserver.

http://sampleserver/arcgis/rest/services/Workflow/WMServer/jobs/5/attachments/add?user=cjones&storageType=2

Example 3: URL for adding a linked URL attachment to job ID 5 in the "Workflow" service on sampleserver.

http://sampleserver/arcgis/rest/services/Workflow/WMServer/jobs/5/attachments/add?user=cjones&storageType=3&filePath=http%3A%2F%2Fwww.arcgis.com

JSON Response Syntax

{
  "attachmentId": <attachmentId>
}

JSON Response Example

{
  "attachmentId": 21
}