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

REST - Retrieve Attachment

The EWRetrieve REST operation:

  • Returns the attached file specified by position from the named field in the record identified by the supplied key. 
  • Accepts the URL with parameters as per general URL conventions which can be viewed in the REST Interface Overview
  • Returns the Content-Type used when attaching the original file.
  • Returns the file content in the body of the response via a GET or POST HTTP method. 
  • The URL must contain the identifier of the record, the name of the field to retrieve the file from and the position of the file in the field.
  • All parameters must be properly URL-encoded. 

Here is an example of a JavaScript-based client that invokes the REST interface via AJAX: 

     function xmlhttpGet (strURL) {
        var xmlHttpReq=false;
        var self=this;
        // Mozilla/Safari
        if (window.XMLHttpRequest) {
            try {
            } catch (e) {
                alert("Permission UniversalBrowserRead denied.");
            self.xmlHttpReq=new XMLHttpRequest();
        }// IE
        else if (window.ActiveXObject) {
            self.xmlHttpReq=new ActiveXObject("Microsoft.xmlHTTP");
        }'GET', strURL, true);
    function requestComplete() {
        if (xmlHttpReq.readyState==4||xmlHttpReq.readyState=="complete") {
            alert ("A file has been returned");
    function main() {