Page tree
Skip to end of metadata
Go to start of metadata

REST - Attach

The EWAttach REST operation:

  • Attaches the file passed in the body of the request to the specified field of the record identified by the supplied primary key. 
  • Accepts the URL with parameters as per general URL conventions which can be viewed in the REST Interface Overview. Additionally, the URL must contain the identifier of the record, the name of the field to attach the file to and the file name to use. The file content is passed in the body of the request. 
  • Supported Content-Type: multipart/form-data
  • Returns the current number of files attached to the specified field. 
  • All parameters must be properly URL-encoded.
  • At present browsers do not support sending PUT requests. This REST operation is intended for the use of application clients. If you need to attach a file from a browser, use the regular POST requests with EWCreate or EWUpdate operations, and specify enctype="multipart/form-data" in the browser HTML form.


Assume an instance of  Agiloft is available on localhost, port 8080 and is called "Demo". Attach a file to the field "someField" in record 1234 of table "someTable" with a file name as

The request has to be issued via the PUT HTTP method where the body contains the content of the file to be attached. 


The following result will be returned when the file is attached: 

Example code
<form method="post" action="" enctype="multipart/form-data">
<input name="$KB" value="Demo" />
<input name="$table" value="case" />
<input name="$lang" value="en" />
<input name="$login" value="admin" />
<input name="$password" value="qwerty" />
<input type="file" name="inbound_attachments"/>
<input type="submit" value="submit" />