REST adapter request and response for the GET action

You can retrieve data from a specified URL by using the REST adapter - GET action. 

You must enter the Get action in the URL field of the Properties tab for the Call Adapter activity. When you use a context item as an input for an adapter request, you must enclose the adapter request in the <request-data> elements. 

Adapter requests for the REST adapter are in the JSON format. You specify the adapter name, header, and other parameters, which are converted to a JSON format. The adapter response is in a JSON format. 

The following table describes the adapter request elements for the REST adapter with a Get action.

Elements for an HTTP adapter request with a Get action

Element

Description

Required

<adapter name>

Specifies the name of the adapter

Default name of the adapter is RESTAdapter

No

<url>

Specifies the URL for the target page from where you want to obtain information

Yes

<headers>

Specifies the header details for the adapter request in a JSON format

Sample header JSON
{
"headers" :
        {
        "authorization" :
            {
 	        "type" : "basic",
			"user-name" : "myUser",
			"password" : "myPassword"
			}
          }
}

For more information, see Specifying header fields for the REST adapter.

No

<return-data-format>

Indicates the data type for the adapter response 

The adapter returns data only in the JSON format.

No

<use-ssl-certificate>

Determines whether to establish a secure connection 

Set the value of this element to true when <action> uses HTTPS. 
Set the value of this element to false or leave it blank when <action>uses HTTP. 

Valid values: true, false (default)

No

<allow-unsigned-certificate>

Specifies whether to allow unsigned certificates from trusted zones 

Set the value of this element to true, if you are using self-signed SSL certificates (a common practice). 

Valid values: true, false (default)

No

<install-certificate>

Determines whether to install certificates 

Set the value of this element to true, if you prefer to have security certificates installed automatically (a common practice). Set the value of this element to false, if you prefer to manually export the security certificate from the specified target server and manually import it into the TrueSight Orchestration's local peer's cacerts file (a rare practice). 

Valid values: true, false (default)

No

<passphrase>

Specifies the Java Standard Trust Keystore passphrase 

Default value: changeit

Warning

 
  • The value of the <passphrase> element is the passphrase for the cacerts certificate stored on the TrueSight Orchestration local peer (CDP or AP) and not the specified target host.
  • Changing the passphrase can be tricky and might destroy the cacerts security file integrity.


Verify the cacerts passphrase using the following command in UNIX or Linux: 

$ /opt/bmc/ao/cdp/jvm/bin/keytool -list -keystore 
/opt/bmc/ao/cdp/jvm/lib/security/cacerts

No

<character-set>

Specifies the supporting CharSet 

Also called character set, it includes identifiers describing a series of universal characters. 

Note: If you do not specify the supporting character set, the adapter response is parsed based on the character set in the HTTP response header.

No

<user-name>

Specifies the user name required for basic or NTLM authentication specified in <header>  

No

<password>

Specifies the password corresponding to the user name specified in <header>

No

<ntlm-authentication>

Indicates whether to use NTLM authentication for the target server for the specified user credentials 

NTLM authentication is an application protocol used in various Microsoft network protocol implementations and is used throughout Microsoft systems as an integrated single sign-on mechanism. 

The adapter supports both NTLMv1 and NTLMv2 authentication. 

Valid values: true, false (default) 

If the value of the parameter is true, the adapter uses NTLMv1 or NTLMv2 authentication (based on the server configuration) to authenticate the user. Else, the adapter uses basic authentication.

No

<Content-Type>

Specifies the type of data format for HTTP content 

For example, application/json, multipart/form-data.

No

<signature-properties>

Contains the elements that specify information about the public key (X.509 certificate) and the private key that are used for the digital signature 

Note: If you specify signature-properties in the adapter configuration and an adapter request, the values in the request override the values in the configuration. 

The <signature-properties> element can contain the modeattribute that specifies the format in which the public (X.509 certificate) and private keys are provided for signing the HTTP request. 

You can provide the keys using one of the following formats:

  • Java Keystore (JKS)
  • Privacy Enhanced Mail (PEM)
  • Definite Encoding Rules (DER) files
  • Base64-encoded PEM 

    Valid values:
  • <signature-properties mode="keystore"> (default)
  • <signature-properties mode="key-files">
  • <signature-properties mode="key-data">

No

<private-key-file>

Specifies the file containing the private key that is used to sign the HTTP request 

The adapter supports the following formats:

  • Base64-encoded PEM
  • DER

Conditional; required when<signature-properties mode="key-files">

<certificate-file>

Specifies the file containing the public key (X509 Certificate) 

The adapter supports the following formats:

  • Base64-encoded PEM
  • DER

Conditional; required when<signature-properties mode="key-files">

<private-key-data>

Contains an XML file specifying the private key in an Base64-encoded PEM format 

For example: 
<private-key-data> --- BEGIN PRIVATE KEY --- 
MIICdQIBADANBgkqhkiG9w0 
BAQEFAASCAl8wggJbAgEAAo 
GBAKomKro6VbW4PeQtUhNz 
ZpSH26vbBTBtH1r4EjnIv4vnh 
SyyA62ewpROVNn0Spvjo 
BFwE88HcX3tXym/zbVgtd 
Pke9K+SYHP6CWdiLqn 
... 
--- END PRIVATE KEY -</private-key-data>

Conditional; required when<signature-properties mode="key-data">

<certificate-data>

Contains an XML file specifying the public key (X509 Certificate) in an Base64-encoded PEM format 

For example: 
<certificate-data> --- BEGIN CERTIFICATE --- 
MIICdzCCAeCgAwIBAgIFXseN1xYwDQYJKoZIhvcNAQEFBQ 
AwUzELMAkGA1UEBhMCVVMxEzARBgNVBAoTCkFtYXpvbi5jb20x 
DDAKBgNVBAsTA0FXUzEhMB8GA1UEAxMY 
........ 
--- END CERTIFICATE -</certificate-data>

Conditional; required when<signature-properties mode="key-data">

<keystore-file>

Specifies the path to the JKS that contains the client certificate

Conditional; required when<signature-properties mode="keystore">

<key-password>

Specifies the password of the key contained in the JKS 

Note: If you do not specify <key-password>, then the value of<keystore-password> is used as the key password.

No

<keystore-password>

Specifies the password to the JKS

Conditional; required when<signature-properties mode="keystore">

<client alias>

Specifies the name of the alias in the JKS that identifies the Public Key Certificate (PKC) that the web server uses to authenticate the client 

Note: The value of the <alias> element is verified only when<install-certificate> is set to true and <allow-unsigned-certificate> is set to false.

Conditional; required when<signature-properties mode="keystore">

<enable-redirects>

Specifies whether the adapter should redirect a URL request to the changed URL location 

Valid values: true (default), false 

Note: If you specify <enable-redirects> in the adapter configuration and an adapter request, the values in the request override the values in the configuration.

No

<download-attachment>

Specifies whether the adapter should display the content of the attached file in the adapter response or save the content in a file 

Valid values: true, false (default) 

If <download-attachment>=true, the adapter checks the <content-disposition> field in the response header. If <content-disposition> contains attachment; file-name="abc.doc", the adapter saves the attached file. 

If the adapter response header does not contain the content-disposition field, the adapter checks the <content-type> field in the response header. If <content-type> contains an image or attachment, the adapter saves the attached file. 

If <download-attachment>=false, the content of the attached file is displayed in the adapter response.

No

<download-directory>

Specifies the full path where the attached file must be downloaded 

Default value: Temporary directory of the Java virtual machine of the peer

No

<request-timeout>Specifies the time (in seconds) to wait when establishing a connection 

Default value: 10 seconds.
No
<ignore-line-break-in-response>

Specifies whether to ignore the line breaks while generating the adapter response

If true, the line break markups are ignored and the response is returned as a single line. If false, the line break markers (if specified in the adapter response) are retained.

Valid values: true (default), false

No

The following figure shows a sample adapter request for the GET action.

XML/JSON sample adapter request for the GET action

<rest-adapter-request>
     "url" : "https://thecontactsapi.restlet.net/v1/contacts?active=true",
</rest-adapter-request>

The following figure shows the adapter response for the GET action.

 Adapter response for the GET action in a JSON format

{"rest-adapter-response":{"metadata":
{"status":"success"},"status-line":
{"code":"200","reason":"OK"},"header-lines":
{"Accept-Ranges":"bytes","Content-Type":"application/json","Date":"Fri, 09 Jun 2017 09:31:15 GMT","Server":"Restlet-Framework/3.41.8","Vary":"Accept-Charset, Accept-Encoding, Accept-Language, Accept","X-Page-Count":"1","X-Page-Number":"1","X-Page-Size":"25","X-Total-Count":"5","Content-Length":"908","Connection":"keep-alive"},"message-body":[
{"id":"0e8dd830-ad98-11e6-bf2e-47644ada7c0f","firstName":"John","lastName":"Smith","birthday":152755200000,"active":true,"rank":1,"company":"0e8cedd0-ad98-11e6-bf2e-47644ada7c0f"},
{"id":"0e8e4d60-ad98-11e6-bf2e-47644ada7c0f","firstName":"Cole","lastName":"Darby","birthday":453340800000,"active":true,"rank":3,"company":"0e8cedd0-ad98-11e6-bf2e-47644ada7c0f"},
{"id":"0e8f5ed0-ad98-11e6-bf2e-47644ada7c0f","firstName":"Maggie","lastName":"Steward","birthday":334800000000,"active":true,"rank":5,"company":"0e8cedd0-ad98-11e6-bf2e-47644ada7c0f"},
{"id":"0e8fd400-ad98-11e6-bf2e-47644ada7c0f","firstName":"Kurt","lastName":"Williams","birthday":383270400000,"active":true,"rank":7,"company":"0e8c9fb0-ad98-11e6-bf2e-47644ada7c0f"},
{"id":"0e904930-ad98-11e6-bf2e-47644ada7c0f","firstName":"Tom","lastName":"Gibson","birthday":-34560000000,"active":true,"rank":9,"company":"0e8c9fb0-ad98-11e6-bf2e-47644ada7c0f"}]}}


The following figure shows the sample adapter request when the <ignore-line-break-in-response> is set to true.

XML request for the Get action when the <ignore-line-break-in-response> is set to false

<rest-adapter-request>
{
   "ignore-line-break-in-response": "false",
   "url": "http://maps.googleapis.com/maps/api/geocode/json?address=Noida"
}
</rest-adapter-request>

The following figure shows the adapter response for the GET action when the <ignore-line-break-in-response> is set to true.

Adapter response for the GET action when the <ignore-line-break-in-response> is set to true

[OUT5={"metadata":["success"],"status-line":
{"code":"200","reason":"OK"},"header-lines":
{"Content-Type":"application/json; charset=UTF-8","Date":"Thu, 27 Apr 2017 09:17:50 GMT","Expires":"Fri, 28 Apr 2017 09:17:50 GMT","Cache-Control":"public, max-age=86400","Vary":"Accept-Language","Access-Control-Allow-Origin":"*","Server":"mafe","X-XSS-Protection":"1; mode=block","X-Frame-Options":"SAMEORIGIN"},"message-body":{"results":[{"address_components":[
{"long_name":"Noida","short_name":"Noida","types":["locality","political"]},
{"long_name":"Gautam Buddh Nagar","short_name":"Gautam Buddh Nagar","types":["administrative_area_level_2","political"]},
{"long_name":"Uttar Pradesh","short_name":"UP","types":["administrative_area_level_1","political"]},
{"long_name":"India","short_name":"IN","types":["country","political"]}],"formatted_address":"Noida, Uttar Pradesh, India","geometry":{"bounds":{"northeast":
{"lat":28.636301,"lng":77.50256},"southwest":{"lat":28.397205,"lng":77.29369}},"location":
{"lat":28.535517,"lng":77.39103},"location_type":"APPROXIMATE","viewport":{"northeast":
{"lat":28.636301,"lng":77.50256},"southwest":
{"lat":28.397205,"lng":77.29369}}},"place_id":"ChIJezVzMaTlDDkRP8B8yDDO_zc","types":["locality","political"]}],"status":"OK"}}]
26 Apr 2017 21:17:50,897 [Current Time=Wed Apr 26 21:17:50 GMT-12:00 2017][Process Name=:RESTTesting:LineBreak] [Root Job Id=38fa5ea41d4d9470:64cc6ec3:15bae8fb7f6:-80001-1493284669805] [Job Id=38fa5ea41d4d9470:64cc6ec3:15bae8fb7f6:-80001-1493284669805][ProcessTermination=The process terminated in the completed state. The process started at 26 Apr 2017 21:17:49,821, terminated at 26 Apr 2017 21:17:50,897, and the execution took 1,076 milliseconds.] 

The following figure shows the sample adapter request when the <allow-unsigned-certificate> is set to true.

Adapter request for the Get action when the <allow-unsigned-certificate> is set to true

<adapter-request>
 <target-adapter>rest-actor</target-adapter>
 <peer-location>
   <location>this</location>
 </peer-location>
 <request-action>get</request-action>
 <request-data>
  <rest-adapter-request>{"url":"https://jira.bmc.com/rest/api/2/issue/DRAOC-59817/comment","use-ssl-certificate":"true","install-certificate":"false","allow-unsigned-certificate":"true","headers" :{"content-type" :"application/json", "Authorization" : "Basic amppbnRhOlByZWV0eTEy"}}</rest-adapter-request>
 </request-data>
</adapter-request>

The following figure shows the adapter response for the GET action when the <allow-unsigned-certificate> is set to true.

Adapter response for the request when the <allow-unsigned-certificate> is set to true

{"rest-adapter-response":{"metadata":
{"status":"success"},"status-line":
{"code":"200","reason":"OK"},"header-lines":
{"Date":"Fri, 09 Jun 2017 09:40:42 GMT","Server":"Apache/2.4.6 (Red Hat)","X-AREQUESTID":"280x4506814x1","X-ANODEID":"phx-jiraprd-05","X-ASEN":"SEN-5981199","Set-Cookie":["JSESSIONID=9CEF12D05B7638DFA47492804877DCBE; Path=/; Secure; HttpOnly","atlassian.xsrf.token=BXV8-9FAB-2I0V-4AN7|6fb9e3879a3ae4445b9a95ae03f58c1283f2b9ef|lin; Path=/; Secure"],"X-Seraph-LoginReason":"OK","X-ASESSIONID":"1fb7wm0","X-AUSERNAME":"jjinta","Cache-Control":"no-cache, no-store, no-transform","X-Content-Type-Options":"nosniff","Content-Type":"application/json;charset=UTF-8","Connection":"close","Transfer-Encoding":"chunked"},"message-body":{"startAt":0,"maxResults":3,"total":3,"comments":[{"self":"https://jira.bmc.com/rest/api/2/issue/804880/comment/735300","id":"735300","author":{"self":"https://jira.bmc.com/rest/api/2/user?username=jjinta","name":"jjinta","key":"jjinta","emailAddress":"jeewan_jinta_tp@bmc.com","avatarUrls":
{"48x48":"https://jira.bmc.com/secure/useravatar?avatarId=10122","24x24":"https://jira.bmc.com/secure/useravatar?size=small&avatarId=10122","16x16":"https://jira.bmc.com/secure/useravatar?size=xsmall&avatarId=10122","32x32":"https://jira.bmc.com/secure/useravatar?size=medium&avatarId=10122"},"displayName":"Jinta, Jeewan","active":true,"timeZone":"America/Chicago"},"body":"LOGS Attached","updateAuthor":{"self":"https://jira.bmc.com/rest/api/2/user?username=jjinta","name":"jjinta","key":"jjinta","emailAddress":"jeewan_jinta_tp@bmc.com","avatarUrls":
{"48x48":"https://jira.bmc.com/secure/useravatar?avatarId=10122","24x24":"https://jira.bmc.com/secure/useravatar?size=small&avatarId=10122","16x16":"https://jira.bmc.com/secure/useravatar?size=xsmall&avatarId=10122","32x32":"https://jira.bmc.com/secure/useravatar?size=medium&avatarId=10122"},"displayName":"Jinta, Jeewan","active":true,"timeZone":"America/Chicago"},"created":"2017-05-31T00:55:14.923-0500","updated":"2017-05-31T00:55:14.923-0500"},{"self":"https://jira.bmc.com/rest/api/2/issue/804880/comment/737608","id":"737608","author":{"self":"https://jira.bmc.com/rest/api/2/user?username=jjinta","name":"jjinta","key":"jjinta","emailAddress":"jeewan_jinta_tp@bmc.com","avatarUrls":
{"48x48":"https://jira.bmc.com/secure/useravatar?avatarId=10122","24x24":"https://jira.bmc.com/secure/useravatar?size=small&avatarId=10122","16x16":"https://jira.bmc.com/secure/useravatar?size=xsmall&avatarId=10122","32x32":"https://jira.bmc.com/secure/useravatar?size=medium&avatarId=10122"},"displayName":"Jinta, Jeewan","active":true,"timeZone":"America/Chicago"},"body":"This is a comment is via REST Automation.","updateAuthor":{"self":"https://jira.bmc.com/rest/api/2/user?username=jjinta","name":"jjinta","key":"jjinta","emailAddress":"jeewan_jinta_tp@bmc.com","avatarUrls":
{"48x48":"https://jira.bmc.com/secure/useravatar?avatarId=10122","24x24":"https://jira.bmc.com/secure/useravatar?size=small&avatarId=10122","16x16":"https://jira.bmc.com/secure/useravatar?size=xsmall&avatarId=10122","32x32":"https://jira.bmc.com/secure/useravatar?size=medium&avatarId=10122"},"displayName":"Jinta, Jeewan","active":true,"timeZone":"America/Chicago"},"created":"2017-06-09T02:20:29.723-0500","updated":"2017-06-09T02:20:29.723-0500"},{"self":"https://jira.bmc.com/rest/api/2/issue/804880/comment/737565","id":"737565","author":{"self":"https://jira.bmc.com/rest/api/2/user?username=jjinta","name":"jjinta","key":"jjinta","emailAddress":"jeewan_jinta_tp@bmc.com","avatarUrls":
{"48x48":"https://jira.bmc.com/secure/useravatar?avatarId=10122","24x24":"https://jira.bmc.com/secure/useravatar?size=small&avatarId=10122","16x16":"https://jira.bmc.com/secure/useravatar?size=xsmall&avatarId=10122","32x32":"https://jira.bmc.com/secure/useravatar?size=medium&avatarId=10122"},"displayName":"Jinta, Jeewan","active":true,"timeZone":"America/Chicago"},"body":"This is a comment is via REST Automation.","updateAuthor":{"self":"https://jira.bmc.com/rest/api/2/user?username=jjinta","name":"jjinta","key":"jjinta","emailAddress":"jeewan_jinta_tp@bmc.com","avatarUrls":
{"48x48":"https://jira.bmc.com/secure/useravatar?avatarId=10122","24x24":"https://jira.bmc.com/secure/useravatar?size=small&avatarId=10122","16x16":"https://jira.bmc.com/secure/useravatar?size=xsmall&avatarId=10122","32x32":"https://jira.bmc.com/secure/useravatar?size=medium&avatarId=10122"},"displayName":"Jinta, Jeewan","active":true,"timeZone":"America/Chicago"},"created":"2017-06-09T03:33:48.060-0500","updated":"2017-06-09T03:33:48.060-0500"}]}}}

 

The following figure shows the sample XML request when the <install-certificate> is set to true

XML request for the Get action when the <install-certificate> is set to true

<adapter-request>
  <target-adapter>rest-actor</target-adapter>
  <peer-location>
  <location>this</location>
  </peer-location>
  <request-action>get</request-action>
  <request-data>
  <rest-adapter-request>
{
   "url": "https://jira.bmc.com/rest/api/2/issue/DRAOC-60033",
   "use-ssl-certificate": "false",
   "install-certificate": "true",
   "allow-unsigned-certificate": "false",
   "return-data-format": "xml",
   "headers": {
      "authorization": {
         "type": "basic",
         "Username": "jjinta",
         "Password": "fghrbvs"
      }
   }
}
  </rest-adapter-request>***MASKED***</request-data>
</adapter-request>

The following figure shows the adapter response when the <install-certificate> is set to true

Adapter response for the GET action when the <install-certificate> is set to true

[adapter response={"metadata":
{"status":"success"},"status-line":{"code":"200","reason":"OK"},"header-lines":{"Date":"Wed, 17 May 2017 06:30:58 GMT","Server":"Apache/2.4.6 (Red Hat)","X-AREQUESTID":"90x2080421x1","X-ANODEID":"phx-jiraprd-05","X-ASEN":"SEN-5981199","Set-Cookie":["atlassian.xsrf.token=BXV8-9FAB-2I0V-4AN7|c2330edf95c9f23cd59ddd9114a393ddefd36b64|lout; Path=/; Secure","JSESSIONID=6954F7786A426897510789524D5A9D1B; Path=/; Secure; HttpOnly"],"X-AUSERNAME":"anonymous","Cache-Control":"no-cache, no-store, no-transform","X-Content-Type-Options":"nosniff","Content-Type":"application/json;charset=UTF-8","Connection":"close","Transfer-Encoding":"chunked"},"message-body":{"non-xml-data-response":{"expand":"renderedFields,names,schema,transitions,operations,editmeta,changelog","id":"819660","self":"https://jira.bmc.com/rest/api/2/issue/819660","key":"DRAOC-60033","fields":{"customfield_13100":"Jira Integration","customfield_13102":null,"fixVersions":[{"self":"https://jira.bmc.com/rest/api/2/version/18602","id":"18602","description":"DRAOC.20.17.01","name":"20.17.01","archived":false,"released":false,"releaseDate":"2017-08-31"}],"customfield_13101":"2112237","customfield_11200":"Atrium Orchestrator Content.20.17.01","customfield_13104":null,"resolution":null,"customfield_13103":null,"customfield_11202":null,"customfield_13106":null,"customfield_11203":null,"customfield_10500":"1|i0xz5l:","customfield_11711":null,"customfield_10105":{"self":"https://jira.bmc.com/rest/api/2/customFieldOption/10332","value":"No","id":"10332"},"customfield_10106":{"self":"https://jira.bmc.com/rest/api/2/customFieldOption/10334","value":"No","id":"10334"},"customfield_11713":null,"customfield_11712":null,"customfield_10901":null,"customfield_11714":null,"customfield_11717":null,"customfield_11716":null,"customfield_11719":null,"customfield_11718":null,"lastViewed":null,"customfield_12000":null,"priority":{"self":"https://jira.bmc.com/rest/api/2/priority/2","iconUrl":"https://jira.bmc.com/images/icons/priorities/critical.png","name":"P2","id":"2"},"customfield_10101":{"self":"https://jira.bmc.com/rest/api/2/customFieldOption/10311","value":"Internal - QA","id":"10311"},"customfield_10102":null,"labels":[],"customfield_11700":null,"customfield_11702":null,"customfield_11701":null,"aggregatetimeoriginalestimate":null,"timeestimate":null,"versions":[{"self":"https://jira.bmc.com/rest/api/2/version/18602","id":"18602","description":"DRAOC.20.17.01","name":"20.17.01","archived":false,"released":false,"releaseDate":"2017-08-31"}],"customfield_11705":null,"customfield_11707":null,"issuelinks":[{"id":"767879","self":"https://jira.bmc.com/rest/api/2/issueLink/767879","type":{"id":"10000","name":"Blocks","inward":"is blocked by","outward":"blocks","self":"https://jira.bmc.com/rest/api/2/issueLinkType/10000"},"outwardIssue":{"id":"819657","key":"DRAOC-60031","self":"https://jira.bmc.com/rest/api/2/issue/819657","fields":{"summary":"Mutual Authentication using Signature mode as key file in the adapter config","status":{"self":"https://jira.bmc.com/rest/api/2/status/1","description":"The issue is open and ready for the assignee to start work on it.","iconUrl":"https://jira.bmc.com/images/icons/statuses/open.png","name":"Open","id":"1","statusCategory":{"self":"https://jira.bmc.com/rest/api/2/statuscategory/2","id":2,"key":"new","colorName":"blue-gray","name":"To Do"}},"priority":{"self":"https://jira.bmc.com/rest/api/2/priority/2","iconUrl":"https://jira.bmc.com/images/icons/priorities/critical.png","name":"P2","id":"2"},"issuetype":{"self":"https://jira.bmc.com/rest/api/2/issuetype/10300","id":"10300","description":"This Issue Type is used to create Zephyr Test within Jira.","iconUrl":"https://jira.bmc.com/download/resources/com.thed.zephyr.je/images/icons/ico_zephyr_issuetype.png","name":"Test","subtask":false}}}},{"id":"767878","self":"https://jira.bmc.com/rest/api/2/issueLink/767878","type":{"id":"10000","name":"Blocks","inward":"is blocked by","outward":"blocks","self":"https://jira.bmc.com/rest/api/2/issueLinkType/10000"},"outwardIssue":{"id":"819658","key":"DRAOC-60032","self":"https://jira.bmc.com/rest/api/2/issue/819658","fields":{"summary":"Mutual Authentication using Signature mode as key data in the adapter config via CallAdapter","status":{"self":"https://jira.bmc.com/rest/api/2/status/1","description":"The issue is open and ready for the assignee to start work on it.","iconUrl":"https://jira.bmc.com/images/icons/statuses/open.png","name":"Open","id":"1","statusCategory":{"self":"https://jira.bmc.com/rest/api/2/statuscategory/2","id":2,"key":"new","colorName":"blue-gray","name":"To Do"}},"priority":{"self":"https://jira.bmc.com/rest/api/2/priority/2","iconUrl":"https://jira.bmc.com/images/icons/priorities/critical.png","name":"P2","id":"2"},"issuetype":{"self":"https://jira.bmc.com/rest/api/2/issuetype/10300","id":"10300","description":"This Issue Type is used to create Zephyr Test within Jira.","iconUrl":"https://jira.bmc.com/download/resources/com.thed.zephyr.je/images/icons/ico_zephyr_issuetype.png","name":"Test","subtask":false}}}}],"customfield_11709":null,"assignee":{"self":"https://jira.bmc.com/rest/api/2/user?username=puverma","name":"puverma","key":"puverma","emailAddress":"Puja_Verma_CW@bmc.com","avatarUrls":{"48x48":"https://jira.bmc.com/secure/useravatar?avatarId=10122","24x24":"https://jira.bmc.com/secure/useravatar?size=small&avatarId=10122","16x16":"https://jira.bmc.com/secure/useravatar?size=xsmall&avatarId=10122","32x32":"https://jira.bmc.com/secure/useravatar?size=medium&avatarId=10122"},"displayName":"Verma, Puja","active":true,"timeZone":"Asia/Kolkata"},"status":{"self":"https://jira.bmc.com/rest/api/2/status/1","description":"The issue is open and ready for the assignee to start work on it.","iconUrl":"https://jira.bmc.com/images/icons/statuses/open.png","name":"Open","id":"1","statusCategory":{"self":"https://jira.bmc.com/rest/api/2/statuscategory/2","id":2,"key":"new","colorName":"blue-gray","name":"To Do"}},"components":[{"self":"https://jira.bmc.com/rest/api/2/component/11202","id":"11202","name":"Base Adapters"}],"customfield_10203":null,"customfield_10600":null,"customfield_10205":["com.atlassian.greenhopper.service.sprint.Sprint@4e851a20[id=2064,rapidViewId=461,state=FUTURE,name=BAO 20.17.01 Sprint 8,startDate=<null>,endDate=<null>,completeDate=<null>,sequence=2064]"],"customfield_10206":null,"aggregatetimeestimate":null,"creator":{"self":"https://jira.bmc.com/rest/api/2/user?username=jjinta","name":"jjinta","key":"jjinta","emailAddress":"jeewan_jinta_tp@bmc.com","avatarUrls":{"48x48":"https://jira.bmc.com/secure/useravatar?avatarId=10122","24x24":"https://jira.bmc.com/secure/useravatar?size=small&avatarId=10122","16x16":"https://jira.bmc.com/secure/useravatar?size=xsmall&avatarId=10122","32x32":"https://jira.bmc.com/secure/useravatar?size=medium&avatarId=10122"},"displayName":"Jinta, Jeewan","active":true,"timeZone":"America/Chicago"},"subtasks":[],"reporter":{"self":"https://jira.bmc.com/rest/api/2/user?username=jjinta","name":"jjinta","key":"jjinta","emailAddress":"jeewan_jinta_tp@bmc.com","avatarUrls":{"48x48":"https://jira.bmc.com/secure/useravatar?avatarId=10122","24x24":"https://jira.bmc.com/secure/useravatar?size=small&avatarId=10122","16x16":"https://jira.bmc.com/secure/useravatar?size=xsmall&avatarId=10122","32x32":"https://jira.bmc.com/secure/useravatar?size=medium&avatarId=10122"},"displayName":"Jinta, Jeewan","active":true,"timeZone":"America/Chicago"},"aggregateprogress":{"progress":0,"total":0},"customfield_10200":null,"customfield_10201":null,"customfield_12501":null,"customfield_10202":null,"customfield_11524":null,"customfield_13306":null,"customfield_13305":null,"customfield_11801":null,"customfield_13308":null,"customfield_11800":null,"customfield_13307":null,"customfield_10713":null,"customfield_11528":null,"customfield_11802":null,"customfield_11807":["aC2140000000056CAA"],"customfield_11806":null,"progress":{"progress":0,"total":0},"votes":{"self":"https://jira.bmc.com/rest/api/2/issue/DRAOC-60033/votes","votes":0,"hasVoted":false},"worklog":{"startAt":0,"maxResults":20,"total":0,"worklogs":[]},"issuetype":{"self":"https://jira.bmc.com/rest/api/2/issuetype/1","id":"1","description":"A problem which impairs or prevents the functions of the product.","iconUrl":"https://jira.bmc.com/images/icons/issuetypes/bug.png","name":"Bug","subtask":false},"timespent":null,"project":{"self":"https://jira.bmc.com/rest/api/2/project/10801","id":"10801","key":"DRAOC","name":"Atrium Orchestrator Content","avatarUrls":{"48x48":"https://jira.bmc.com/secure/projectavatar?avatarId=10011","24x24":"https://jira.bmc.com/secure/projectavatar?size=small&avatarId=10011","16x16":"https://jira.bmc.com/secure/projectavatar?size=xsmall&avatarId=10011","32x32":"https://jira.bmc.com/secure/projectavatar?size=medium&avatarId=10011"},"projectCategory":{"self":"https://jira.bmc.com/rest/api/2/projectCategory/10001","id":"10001","description":"DCA / Cloud : BAO","name":"DCA / Cloud : BAO"}},"aggregatetimespent":null,"customfield_11522":null,"customfield_11913":null,"customfield_11516":null,"resolutiondate":null,"customfield_11914":null,"customfield_11917":null,"customfield_10707":null,"workratio":-1,"watches":{"self":"https://jira.bmc.com/rest/api/2/issue/DRAOC-60033/watchers","watchCount":1,"isWatching":false},"created":"2017-04-28T04:29:37.293-0500","customfield_12200":null,"customfield_12201":null,"customfield_11510":null,"customfield_11502":null,"customfield_11501":null,"customfield_11743":"01214000001ZUcsAAG","customfield_11503":null,"customfield_11506":null,"customfield_11901":null,"customfield_11508":null,"customfield_11507":null,"customfield_11509":null,"updated":"2017-05-15T05:39:21.673-0500","timeoriginalestimate":null,"description":"<rest-adapter-request>\r\n{\r\n\"url\" : \"https://clm-pun-027849.bmc.com:8087/api/test\",\r\n\"use-ssl-certificate\" : \"true\",\r\n\"allow-unsigned-certificate\" : \"false\",\r\n\"install-certificate\" : \"true\",\r\n\"signature-properties\" :\r\n{ \"mode\":\"key-files\", \"private-key-file\" : \"C:\\BDA_89_keys\\server.key\", \"certificate-file\" : \"C:\\BDA_89_keys\\server.pem\" }\r\n}\r\n<\/rest-adapter-request>\r\n\r\nResponse:\r\n27 Apr 2017 21:24:43,992 [Current Time=Thu Apr 27 21:24:43 GMT-12:00 2017] [Process Name=:RESTTesting:SignaturePropkeyFiles] [Root Job Id=cf25e720f1183aa7:6bb0ddb3:15bb3ccf8b8:-80001-1493371483149] [Job Id=cf25e720f1183aa7:6bb0ddb3:15bb3ccf8b8:-80001-1493371483149] [Error=An error occurred that triggered compensation:] [TEXT= Summary: Execution failed. Caused by: Summary: An internal error occurred while handling adapter request. ]","customfield_10012":null,"customfield_13400":null,"customfield_11500":null,"customfield_11621":null,"timetracking":{},"customfield_11620":null,"customfield_10401":null,"customfield_11612":null,"customfield_11732":null,"customfield_10800":null,"customfield_11613":null,"customfield_11734":{"self":"https://jira.bmc.com/rest/api/2/customFieldOption/12100","value":"YES","id":"12100"},"attachment":[{"self":"https://jira.bmc.com/rest/api/2/attachment/140093","id":"140093","filename":"logsmutualauth.txt","author":{"self":"https://jira.bmc.com/rest/api/2/user?username=jjinta","name":"jjinta","key":"jjinta","emailAddress":"jeewan_jinta_tp@bmc.com","avatarUrls":{"48x48":"https://jira.bmc.com/secure/useravatar?avatarId=10122","24x24":"https://jira.bmc.com/secure/useravatar?size=small&avatarId=10122","16x16":"https://jira.bmc.com/secure/useravatar?size=xsmall&avatarId=10122","32x32":"https://jira.bmc.com/secure/useravatar?size=medium&avatarId=10122"},"displayName":"Jinta, Jeewan","active":true,"timeZone":"America/Chicago"},"created":"2017-04-28T04:30:27.517-0500","size":8365,"mimeType":"text/plain","content":"https://jira.bmc.com/secure/attachment/140093/logsmutualauth.txt"}],"customfield_11615":null,"customfield_11618":null,"customfield_11617":null,"summary":"REST Adapter ::Mutual Authentication Failed for both key file and key data via CallAdapter","customfield_13111":null,"customfield_13110":null,"customfield_13113":null,"customfield_10000":null,"customfield_13112":null,"customfield_10001":{"self":"https://jira.bmc.com/rest/api/2/customFieldOption/12002","value":"2 - High","id":"12002"},"customfield_13115":null,"customfield_12300":null,"customfield_13114":null,"customfield_11610":null,"customfield_13117":null,"customfield_10400":null,"customfield_11730":null,"customfield_13116":null,"customfield_11722":null,"customfield_13108":null,"customfield_13107":null,"environment":null,"customfield_11724":null,"customfield_11603":null,"customfield_11723":null,"customfield_13109":null,"customfield_11605":null,"customfield_11604":null,"customfield_11725":null,"duedate":null,"customfield_11607":null,"customfield_11606":null,"customfield_11609":null,"comment":{"startAt":0,"maxResults":0,"total":0,"comments":[]}}}}}]

The following figure shows the sample XML request when the <download-attachment> is set to true and the download location is specified. 

XML request for the GET action when the <download-attachment> is set to true and the download location is specified

<adapter-request>
<target-adapter>rest-actor</target-adapter>
<peer-location>
<location>this</location>
</peer-location>
<request-action>get</request-action>
<request-data>
<rest-adapter-request>
{
   "url": "https://jira.bmc.com/secure/attachment/137504/RequestRespose.txt",
   "allow-unsigned-certificate": "true",
   "return-data-format": "xml",
   "download-attachment": "true",
   "download-directory": "C:/jai",
   "headers": {
      "Authorization": "Basic amppbnRhOlByZWV0eTEy"
   }
} 
</rest-adapter-request>
</request-data>
</adapter-request>

The following figure shows the adapter response when <download-attachment> is set to true and the download location is specified

Adapter response for the GET action when <download-attachment> is set to true and the download location is specified

<rest-adapter-response>
<metadata>
<status>success</status>
</metadata>
<status-line>
<code>200</code>
<reason>OK</reason>
</status-line>
<header-lines>
<Date>Fri, 26 May 2017 05:52:57 GMT</Date>
<Server>Apache/2.4.6 (Red Hat)</Server>
<X-AREQUESTID>52x1238731x3</X-AREQUESTID>
<X-ANODEID>phx-jiraprd-05</X-ANODEID>
<X-ASEN>SEN-5981199</X-ASEN>
<Set-Cookie>JSESSIONID=709180EEFA787E5FD13C5738B4C13ABF; Path=/; Secure; HttpOnly</Set-Cookie>
<X-Seraph-LoginReason>OK</X-Seraph-LoginReason>
<Set-Cookie>atlassian.xsrf.token=BXV8-9FAB-2I0V-4AN7|7dad12ba2ede0157a9939bd4c6d82b21590c83df|lin; Path=/; Secure</Set-Cookie>
<X-ASESSIONID>18qqlxj</X-ASESSIONID>
<X-AUSERNAME>jjinta</X-AUSERNAME>
<X-Content-Type-Options>nosniff</X-Content-Type-Options>
<Content-Disposition>attachment; filename*=UTF-8''RequestRespose.txt;</Content-Disposition>
<X-Download-Options>noopen</X-Download-Options>
<Cache-control>private, max-age=31536000</Cache-control>
<Expires>Wed, 31 Dec 1969 23:59:59 GMT</Expires>
<Content-Type>text/plain;charset=UTF-8</Content-Type>
<Content-Length>10222</Content-Length>
<Connection>close</Connection>
</header-lines>
<download-directory>C:/jai</download-directory>
<name>RequestRespose.txt</name>
</rest-adapter-response>

The following figure shows the sample XML request when <enable-redirects> is set to true.

XML request for the GET action when <enable-redirects> is set to true

<adapter-request>
<target-adapter>rest-actor</target-adapter>
<peer-location>
<location>this</location>
</peer-location>
<request-action>get</request-action>
<request-data>
<rest-adapter-request>{
   "url": "http://10.129.147.45:80",
   "enable-redirects": "true",
   "headers": {
      "authorization": {
         "type": "basic",
         "user-name": "Administrator",
         "password": "bmcAdm1n"
      }
   }
}</rest-adapter-request>***MASKED***</request-data>
</adapter-request>

The following figure shows the adapter response when <enable-redirects> is set to true.

Adapter response for the GET action when <enable-redirects> is set to true

adapter response={"metadata":{"status":"success"},"status-line":{"code":"200","reason":"OK"},"header-lines":{"Server":"Apache-Coyote/1.1","Content-Type":"text/plain","Content-Length":"342","Date":"Fri, 12 May 2017 07:30:30 GMT"},"message-body":{"non-xml-data-response":"<Html><Title>Testing Application for HTTP Adapter<\/Title><Head><\/Head><Title>Testing Application for HTTP Adapter<\/Title><Head><\/Head><Body>Hi, I am inside the doGet() Method of the EchoServlet, <br><br><br><br> <br><br> Query String : null<br><br><Center> Copyrights ©, Developed By XYZ <\/Center><\/Body><\/Html>"}}]

The following figure shows the sample XML request with NTLM authentication.

XML request for the GET action with NTLM authentication

<adapter-request>
  <target-adapter>rest-actor</target-adapter>
  <peer-location>
    <location>this</location>
  </peer-location>
  <request-action>get</request-action>
  <request-data>
     <rest-adapter-request>{"url":"https://vw-pun-bao-dv01:443/hello.htm","use-ssl-certificate":"true","install-certificate":"false","allow-unsigned-certificate":"true","headers" : { "authorization" :{ "type" : "NTLM", "user-name" : "baodv01.dc\\Administrator", "password" : "bmcAdm1n" }}}</rest-adapter-request>****MASKED****</request-data>
</adapter-request>

The following figure shows the adapter response with NTLM authentication.

Adapter response for the GET action with NTLM authentication

{"rest-adapter-response":{"metadata":{"status":"success"},"status-line":{"code":"200","reason":"OK"},"header-lines":{"Content-Type":"text/html","Last-Modified":"Fri, 02 May 2014 11:08:43 GMT","Accept-Ranges":"bytes","ETag":"\"6d14b0e1f665cf1:0\"","Vary":"Accept-Encoding","Server":"Microsoft-IIS/8.0","Persistent-Auth":"true","X-Powered-By":"ASP.NET","Date":"Wed, 22 Nov 2017 08:28:51 GMT"},"message-body":{"html":{"head":{"meta":{"@name":"generator","@content":"HTML Tidy, see www.w3.org"},"title":[]},"body":{"h1":"This is NTLM test"}}}}
Was this page helpful? Yes No Submitting... Thank you

Comments