Rest json response find correlation id

Training
Tera Contributor

Im creating incident to third party using POST REST. Then doing GET method to get number/sysid of that incident so I can set it as correlation id in my instance.

 

Using GET I'm getting response -

Transactions[

..

.

body{

Incident 1 In encrypted base 64

}

 

body{

 

Incident 2 In encrypted base 64

 

}

So on

 

How can I iterate through this response array and then decode it to set correlation id?

 

Please help.

 

12 REPLIES 12

Ankur Bawiskar
Tera Patron
Tera Patron

@Training 

so what's actually there in that base64

unless you share the actual json response body we cannot help

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur, thanks for reply.

Base64 contains few fields of the incident created in third party such as incident state, created on, incident number and clientticket number (this is the field which shows incident i created in my instance and incident number is the field which i need to set as correlation id against this )

 

GET is providing me response such as

 

{

"status":"success",

"Message":"retrieved",

"responses":[{

activities:{

One:

Two:

Three:

},

headers {

One:

Two:

},

"body": "base64 encryption string containing fields mentioned in starting answer"

},

 

Similar fields again for 2nd incident

3rd incident and so on

 

This is all contained in single array "responses"

 

I'm able to get the response fields outside this array using gs.log but unable to get fields such as encrypted body which are present in array .. need help here.

 

I'm calling script include (containing GET REST) from scheduled job.

 

 

 

 

@Training 

sorry but unless you share how the body looks at least for 1 incident it's difficult to understand.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

 

.