Service Portal Widget REST API Example?

John Reid1
Kilo Contributor

Hi,

Does anyone have any example Service Portal widgets where a data entry is required and then a call to an external 3rd Party API via RESTMessageV2 and then displaying the response?

This is for my own learning, I've tried looking on Share but can't see anything there that does this as an example.

Ideal this as an update set would be good to see/play with!

Many Thanks.

10 REPLIES 10

Joel Millwood2
Kilo Guru

Hi John,

Here is a link to a CreatorCon Digital Lab which covers exactly what you are after and walks you through it step by step: Service Portal - Integrating Third Party APIs for integrating with Github.

Here is another for integrating with Spotify: Service Portal and Spotify - Integrating Third Party APIs

Have fun!

Fantastic - thank you Joel!

John Reid1
Kilo Contributor

Does anyone have any other examples? The Spotify one is missing a fair chunk of instructions/code.

Thanks in advance,

John 

Hi John,

Which part do you need more help on. Making a REST call from a widget is done the same way as making a scripted REST call elsewhere in the platform. Is the difficulty in taking the import from the client in the view and passing it back through the controller to the model (server side) then making a REST or with the opposite, returning the data from the endpoint back to the view?

Here are some more links that I hope are of assistance to you:

Scripting outbound REST

Advanced Widget Techniques with REST API and Angular Providers - this takes input within a widget and makes an api call in the server script / model of a widget

How to use a REST API with RESTMessageV2 in Service Portal