Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

What is the recommended way to call external REST APIs (GET and POST) from a UI Builder workspace

SurathS
Tera Contributor

I am building a new workspace using ServiceNow UI Builder and need to integrate it with an external API.

What is the recommended way to call external REST APIs (GET and POST) from a UI Builder workspace? My application needs to send requests to an external endpoint and process the API responses within ServiceNow.

I would also like to understand whether this should be implemented using Data Resources, RESTMessage or another ServiceNow-supported approach.

1 REPLY 1

Deėpak Sharma
Mega Sage

Hi @SurathS 

For your GET requests to fetch and display data, you should create a Transform Data Broker. You just write your standard sn_ws.RESTMessageV2 script inside the broker to call the external endpoint and return the parsed JSON. Then in UI Builder, you add that data broker as a data resource and bind its output to whatever component you are using on the screen.

For POST requests when a user clicks a button to send data, the cleanest way is to use Flow Designer. Build subflow or an action that contains a REST step to hit your endpoint. Back in UI Builder, you just map your button click event to trigger that subflow and pass the workspace form values as inputs. This keeps all your API tokens secure in the backend credential store.

Happy to help! If this resolved your issue, kindly mark it as the correct answer ✅  and Helpful and close the thread 🔒 so others can benefit too.

Warm Regards,

Deepak Sharma

Community Rising Star 2025