how to consume rest api data in serviceportal what steps to follow

Shilpi Sharma2
Tera Contributor

Hi All,

i have a new api and its working fine and giving data in json format now i want to consume that rest api output in service portal widget. 

9 REPLIES 9

Harsh Vardhan
Giga Patron

use that rest api in server side of script on your widget. 

 

you can refer the  below lab session . it has mentioned the steps. 

https://developer.servicenow.com/app.do#!/event/creatorcon18/CCW1028/creatorcon_18_CCW1028_bonus_lab...

 

 

If my answer helped you, kindly mark it as correct and helpful.

 

Omkar Mone
Mega Sage

Hi 

You can call that rest message in the Script Include and then return the response by calling that SI in the Server Script of that widget.

 

Hope this helps.

 

Regards

Omkar Mone

Hi omkar,

Can i call that rest message directly in server script of widget and then assign output to any html control.

your doubt will  be clear if you will follow the link which i had provided you. 

 

it has mentioned the example for one widget as well. Its complete creator-con 18 lab session about calling api in widget. 

 

https://developer.servicenow.com/app.do#!/event/creatorcon18/CCW1028/creatorcon_18_CCW1028_lab_6__cr...

 

If my answer helped you, kindly mark it as correct and helpful.