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

REST - Read

The EWRead REST operation:

  • Implements the Read operation of the REST interface.
  • Accepts the URL with parameters as per general URL conventions which can be viewed in the REST Interface Overview
  • Supported Content-Type: application/x-www-form-urlencoded
  • Returns the encoded data of the record.
  • The URL must contain the identifier of the record.
  • All parameters must be properly URL-encoded.

Example

Assume an instance of  Agiloft is available on localhost, port 8080 and is called "Demo". The updated record can be seen in the Update example.

The following request is issued: 

 http://localhost:8080/ewws/EWRead?$KB=Demo&$table=Contacts.Employees&$login=admin&$password=qwerty&$lang=en&id=358 

The following result will be returned: 

EWREST_full_name='John Doe';
EWREST_first_name='John';
EWREST__1576_company_name0='IBM';
EWREST_f_group_0='Service Manager';
EWREST_id='358';
EWREST__106_sw_description='Service Management Team';
EWREST__login='jdoe';
EWREST_date_updated='Dec 27 2017 04:40:24';
EWREST_type='employees';
EWREST_date_created='Dec 27 2017 04:34:38';
EWREST_rep_email='example23@example.com';
EWREST_default_approval_title='Document Approval';
EWREST_last_name='Doe';


Here is an example for 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 {
                netscape.security.PrivilegeManager.
enablePrivilege("UniversalBrowserRead");
            } catch (e) {
                alert("Permission UniversalBrowserRead denied.");
            }
            self.xmlHttpReq=new XMLHttpRequest();
        }// IE
        else if (window.ActiveXObject) {
            self.xmlHttpReq=new ActiveXObject("Microsoft.xmlHTTP");
        }
        self.xmlHttpReq.open('GET', strURL, true);
        self.xmlHttpReq.onreadystatechange=requestComplete;
        self.xmlHttpReq.send(null);
    }
    function requestComplete() {
        if (xmlHttpReq.readyState==4||xmlHttpReq.readyState=="complete") {
            eval (self.xmlHttpReq.responseText);
            alert ("Opportunity"+EWREST_opportunity_name_0);        }
    }
    function main() {
        xmlhttpGet('http://localhost:8080/ewws/EWRead?$KB=Demo&$table=Contacts.Employees&$login=admin&$password=qwerty&$lang=en&id=358');
    }

CONTENTS