Previous Topic: ca_pam_postRESTData(url, body, contentType, doNotValidateCert, headers, callBack)Next Topic: Example: REST POST Method


ca_pam_postRESTDataAuth(url, userName, password, body, contentType, doNotValidateCert, headers, callBack)

Starts the REST service at a specified URL that requires authentication. The server calls the REST Methods asynchronously.

The onSuccess(result) or the onFailure(caught) function of the callback object runs as appropriate after the data is retrieved from the server. The result can be any data format that the REST service returns. The method supports only Basic HTTP authentication. You can use this method with the following signatures:

ca_pam_postRESTDataAuth(url, userName, password, callBack)
ca_pam_postRESTDataAuth(url, userName, password, body, callBack)
ca_pam_postRESTDataAuth(url, userName, password, body, contentType, callBack)
ca_pam_postRESTDataAuth(url, userName, password, body, contentType, doNotValidateCert, callBack)
Input Parameters
url (string)

Defines the URL of the HTTP request. The URL starts with http:// or https://.

username (string)

Defines the user name for which to authenticate the specified URL.

password (string)

Defines the password that is associated with the specified user name.

body (string)

Defines the data to send in the HTTP request.

contentType (string)

Defines the type of content that comprises the HTTP request body. This value is sent as a header (content-type) in the HTTP request.

doNotValidateCert (boolean)

Specifies whether a valid SSL certificate is found. This field is relevant when querying an HTTPS URL.

  • false - Validates the SSL certificate and fails the operation if the certificate is invalid.
  • true - Accepts the SSL certificate even if it is invalid and continues to make the HTTP call.
headers (object)

Defines a list of key/value pairs that sets headers in the request.

callBack (object)

Defines a reference to the function object to call after retrieving the data, including its onSuccess and onFailure methods.

Return Value

When the function retrieves the data, either the onSuccess(result) or onFailure(caught) callBack function runs. The function itself does not return any value.

Example

You can find this function in the out-of-the-box content in CA Process Automation.

  1. On the Home page, click Browse Out-of-the-Box Content.
  2. Navigate to the User Interaction Forms folder, then 07 Populate Table RESTful WS: Populate Table RESTful WS.