Previous Topic: ca_pam_postRESTDataAuth(url, userName, password, body, contentType, doNotValidateCert, headers, callBack)Next Topic: SOAP Methods


Example: REST POST Method

To retrieve all the start request forms in the CA Process Automation library, call the PAM REST API contained in the CA Catalyst Container.

  1. Create an interaction request form and design it as the following illustration shows:

    An interactive request form to o retrieve all the start request forms in the CA Process Automation library by calling the PAM REST API contained in the CA Catalyst Container.

  2. Add the Keyword field to the interaction request form.
  3. Add the following text in the Script section of the interaction request form:
    { 
      sample : function() 
      { 
    	var callBack = new Object();
    	callBack.onSuccess = function(result)
    	  {
    		alert(result);
    	  }
    	  
    	  callBack.onFailure = function(caught)
    		{
    		  alert(caught);
    		}
    		
    var headers = new Object();
    var contentType="application/xml";
    ca_pam_getDataFromRESTPostHTTPAuthentication('https://<hostName>:<PortNumber>/node/rest/CA:00074:01/_ops/QueryStartRequests',useName password,<requestBody>,contentType,true,headers,callBack);
      }
    }
    The Request body is as follows:
    
    <QueryStartRequestFormsRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                                   xsi:type="p1:QueryStartRequestFormsRequest"
                                   xmlns:p1="http://ns.ca.com/2011/09/pam-ops" >
      <Filter>
        <LookUpPath>/</LookUpPath>
        <IsRecursive>true</IsRecursive>
      </Filter>
    </QueryStartRequestFormsRequest>
    
  4. Provide the ca_fd.js.sample() value in the Keyword field onBlur event.
  5. Click Save.

    The script runs according to the Keyword field onBlur event. The start request form is retrieved according to the specified query body and the REST request made.