Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

createTicket JSON how to read the headers from API response

09
New Contributor III
New Contributor III

Hi Team,

i am trying to create a ticket using a service desk connection. i have 2 API calls and i want to read headers from call1 to call2. 

i have followed the Rest documentation for create Ticket json. I have tried couple of options but didnt worked:

https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Developers-Handbook.htm

      "ticketidPath": "response.headers.get('Location')",

{
"ticketidPath": "response.call2.message.logout",
"call": [
{
"name": "call1",
"connection": "test",
"url": "https://adadfd:38080/baocdp/rest/login",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpHeaders": {
"Content-Type": "application/json"
},
"httpParams": "{\"username\":\"sss\",\"password\": \"y1\"}"
},
{
"name": "call2",
"connection": "test",
"url": "https://adadfd:38080/baocdp/rest/logout",
"httpMethod": "POST",
"httpParams": "{}",
"httpContentType": "application/json",
"httpHeaders": {
"Authentication-Token": "response.call1.headers.get('Authentication-Token')"
}
}
]
}

 

 

CALL 1 response

 

 

 

Response Headers:
	Status Code: 200 OK
	Authentication-Token: AQIC5wM2LY4SfcwENnXQHu8dxXuIS3Yfzg8AWT4YpEu4sqA.*AAJTSQACMDIAAlNLAAoxNDI3OTI3NjAxAAJTMQACMDE.*
	Content-Type: application/json;charset=UTF-8
	Date: Wed, 27 May 2015 13:38:04 GMT
	Server: Apache-Coyote/1.1
	Transfer-Encoding: chunked
 
Response Body:
{
	"login":"true"
}

 

 

 

 

1 REPLY 1

rushikeshvartak
All-Star
All-Star

{
"ticketidPath": "response.call2.message.logout",
"call": [
{
"name": "call1",
"connection": "test",
"url": "https://adadfd:38080/baocdp/rest/login",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpHeaders": {
"Content-Type": "application/json"
},
"httpParams": "{\"username\":\"sss\",\"password\": \"y1\"}"
},
{
"name": "call2",
"connection": "test",
"url": "https://adadfd:38080/baocdp/rest/logout",
"httpMethod": "POST",
"httpParams": "{}",
"httpContentType": "application/json",
"httpHeaders": {
"Authentication-Token": "response.call1?fields=values('Authentication-Token')"
}
}
]
}

 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.