How to send an assync response from scripted rest api?

Vinicius Luz1
Tera Expert

Hello guys,

 

I have an External system connecting to my SN instance to create INCIDENTS.

It happens that we need this to be processed by a scripted rest api for specific reasons.

 

On the scripted rest api I've created I'm setting the response like this:

        var res = {};
        res.status = "Success";
        res.message = "Record Successfully created";
		res.number = resp.bkfnumber;
		res.u_int_reference = resp.number;
        response.setBody(res);

 

The external system technicians asked for an Assync Response sending them a payload thru POST method.

I'm not sure how can I do that on my code.

 

Any help?

1 REPLY 1

Sonu Gupta
Tera Expert

Hi @Vinicius Luz1 ,

 

To send asynchronous response, you need to create another HTTP method pointing to their endpoint and send the response to that endpoint as soon as your Incident is created.

You can also use flow designer to send REST messages to External system.


Regards,

Sonu