RDL functions for REST API calls


This topic describes predefined RDL functions. Before you run a function, you must get an authentication token or session and add it to the headers.

Before you begin

To make a successful API call to an outside domain, add a truststore certificate to the application as follows:

  1. Download the certificate from the browser.
  2. Copy  the .crt file to /<AMICM-INSTALLED-PATH>/iocinst/config/security on the application server.
  3. At the command prompt, run /<AMICM-INSTALLED-PATH>/iocinst/config/security.
  4. At the command prompt, run keytool -importcert -file <certificate>.crt -keystore mvcmtruststore.jks -alias <aliasName>  -storepass <storePassword>.
    The certificate is added to make the API call.

The RDL function calls are as follows:

Function

Example of function call

Action

restGET

restGet (uri, headers, queryParameters)

Performs an HTTP REST GET call and returns the results

restPOST

restPost(uri, bodyContent, headers, queryParameters)

Performs an HTTP REST POST call and returns the results

restPUT

restPut(uri, bodyContent, headers, queryParameters)

Performs an HTTP REST PUT call and returns the results

restDELETE

restDelete (uri, headers, queryParameters)

Performs an HTTP REST DELETE call and returns the results

The following table describes the function parameters:

Parameter

Description

uri

The complete URI of the REST endpoint, starting with http or https.

For example:

uri = "https://api.example.com/rest/api/lastest/issue/000000"

bodyContent

The bodyContent is a map that is converted into the appropriate JSON or HTML form data type. 

Warning

Important

bodyContent is required only for PUT and POST function calls.

headers

(Optional) An RDL map containing the name/value pairs of any HTTP headers to be sent with the request. 

For example:

jiraPat = "Xzc0MDU5NTM1OTY4OhaC7jZ07uyhovlNdRDcGbid94cL"headers.Authorization = "Bearer " & jiraPatheaders.Accept = "application/json"

queryParameters

(Optional) An RDL map containing the name/value pairs of any query parameters to be sent with the request.

If you need to send headers, but no parameters, send false.

For example:

queryParmeters.expand = "name,fields"

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Ops Console Management, BMC AMI Ops Console Automation, and BMC AMI Ops SecureHMC 4.1