How to send response in scripted rest API's

utkarsh6
Giga Contributor

Hi,

I have a requirement related to inbound integration , using scripted rest API's , import set table and transform map.

I am receiving two fields in the request payload from the third part tool to our servicenow.

They are hiting our scripted rest api. We have the scenario for update. We have created a API using put method.

now the requirement is that third party tool is hiting our scripted rest API and sending two fields in the request payload

{ "abc field" :"sys_id of the record" ,

" pqr field" : "value" }

Now firstly when the third party tool hits our api , it will store the data in import set table and after running the transform , we will send the data to target tables and update the related records in target table.

And in the response we have to provide the status code to the third party tool.

So how can we achieve this solution , I have created the scripted rest api , resource path and import set table.

But please help me with the logic that needs to be written in scripted rest API to send the response status to third party tool.

 

Thanks

Utkarsh

11 REPLIES 11

@utkarsh 

Hope you are doing good.

Did my reply answer your question?

If my response helped you please mark it correct to close the question so that it benefits future readers as well.

Regards
Ankur

 

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

@utkarsh 

Hope you are doing good.

Did my reply answer your question?

If my response helped you please mark it correct to close the question so that it benefits future readers as well.

Regards
Ankur

 

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