REST log in parameters

The following table describes the REST log in parameters for a Control-M for Web Services connection profile.

Parameter

Description

Require Login

Check this box if the REST job requires a previously generated token or session ID or any prerequisite to the outgoing HTTP request (REST account type only).

Login URL

Defines the URL for the log in request.

Headers

(Optional) Defines any additional HTTP headers that are required in the log in request. Type the following format:

<name>=<value>

NOTE: Separate each pair of name/value with a colon.

Request body

(Optional) Defines any text required in the log in request body.

Job Preset

(Optional) Enables you to add to each job request an HTTP header or a parameter to the HTTP query URL based on the login returned data.

Job Preset is defined in the following format: (separated by semicolon if more than one set):

<name>:<value>;<name>:<value>

  • <name>: Type one of the following:

    HTTP header: Start with the character ‘@’ for the job and then the header name

    HTTP parameter name: Start with the character ‘#’ for the job and then the parameter name.

  • <value>: Type one of the following:

    Start with ‘/’ for the Xpath from the login response data and then the Xpath

    ‘$’ for Jsonpath from the login response data and then the Jsonpath

    ‘@’ for the header from the login response HTTP headers and followed by the header name:

    <’@’ | ‘#’><job HTTP header or parameter name>:<’/’ | ‘$’ | ‘@’><Xpath, Jsonpath, or header name of the login response>

 

Example 1: A job request requires the following HTTP header on submit:

Authorization:<login session id>

where 'Authorization' is the HTTP header name, and the <login session id> is its corresponding value, and the <login session id> is taken from the login returned data.

Assume that the login request returns the following JSON:

{ "loginResponse":

{ "session": "12ab34cd56ef78ab90cd12ef34ab56cd", "user": "JohnDoe" }

}

In this case, the Job Preset should be:

@Authorization:$loginResponse.session

 

Example 2: A job request requires the following parameter add to the HTTP query URL:

http://abc.xyz.com:8090/restaction/purchase?orderNum=12345&session=<login session id>&customer=ABC

Assuming the same login returned data in case 1, then the Job Preset should be:

#session:$loginResponse.session

 

Example 3: A job request requires the following HTTP header on submit, where the login response is XML:

Authorization:<login session id>

where 'Authorization' is the HTTP header name, and the <login session id> is its corresponding value, and the <login session id> is taken from the login returned data.

Assume the login request returns the following JSON:

<loginResponse>

<session>12ab34cd56ef78ab90cd12ef34ab56cd</session>

<user>JohnDoe</user>

</loginResponse>

In this case, the Job Preset should be:

@Authorization:/loginResponse/session

 

Example 4: A job request requires the following parameter add to the HTTP query URL, and the <login session id> is taken from one of the HTTP headers of the login returned data:

http://abc.xyz.com:8090/restaction/purchase?orderNum=12345&session=<login session id>&customer=ABC

Assume the login response came with the following HTTP headers:

Session:12ab34cd56ef78ab90cd12ef34ab56cd

In this case, the Job Preset should be:

@Authorization:@Session

Parent Topic

Creating a Control-M for Web Services connection profile