How to have Scripted REST API in flow designer ?

Thej1
Tera Expert

Hi,

 

How to incorporate the Scripted REST API in flow designer as we do it for Outbound REST message ?
In Flow Designer, We add REST message by creating new Action of REST and importing REST message. Then adding that into the flow.

 

We have Bidirectional integration of ServiceNow with BMC. After making 3 API REST calls, a ticket is created in BMC. Then after closing it manually in BMC they will call our Scripted REST API of Scripted Web service and send an ID as a parameter. Then we need to make 4th Outbound call by having the provided id and in response we will receive Incident number.
We are doing it all in flow designer.

 

Not getting how to incorporate the Scripted REST API in flow. Could you please help me on this ?

@Dr Atul G- LNG @Ankur Bawiskar @Mohit Kaushik @Harish Bainsla 


Thanks

14 REPLIES 14

@Thej1 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi @Ankur Bawiskar ,

 

Thanks for the quick reply.

I created a scripted web service and the response pay load look like
{
"webhook_id":"WBH00000001234",
"entry_details": {"Status":"Resolved"},
"entry_event":"Update",
"form_name":"HPD:Help Desk",
"entry_id":"INC000000919900"
}
Now we want to have this Scripted REST api in existing flow.

I created a REST action and given end point, method and other details and tested.got 200 with the Request body as 
{
"webhook_id":"WBH000000000501",
"entry_details": {"Status":"Resolved"},
"entry_event":"Update",
"form_name":"HPD:Help Desk",
"entry_id":"INC000000919969"
}

Now how to make this request body as dynamic so that every time they call and sends response, that particular entry id is stored in flow variable and can use this entry id in the next outbound REST call ?

@Thej1 

I didn't get your requirement.

You are forming that JSON and posting to some endpoint?

To make it dynamic how are you planning to pick those?

are those to be picked from table record?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@Ankur Bawiskar 

 

Remedy will send a payload by Scripted REST API and need to make another outbound REST call with the entry id as parameter.
I am not getting how to pic those.
Can i create a subflow and when ever receives a request pass those response as the inputs to subflow and then can use this entry id for another outbound call ?

@Thej1 

Remedy will send that payload and in scripted rest API and you can invoke subflow from script and pass that payload to it as input and let that subflow invoke REST Step

Before invoking the subflow you can make it dynamic and then send it to subflow

check this link

Scripting with Flows, Subflows, and Actions 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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