How to GET information from a web page using Scripted REST Api ?

Sai Pavan1
Tera Contributor

Hello community,

I have a simple requirement where I have to get information from a web page using scripted rest API. The webpage contains random state names with state id's and I have to GET only particular state names of some id's. 

SaiPavan1_0-1676523995574.png

So, from the above webpage which is having state id's and names I have to GET only some state names of particular state id's. Is this possible using scripted rest api or using integration hub ? 

Please guide me to any related links or video that gives solution. 

 

6 REPLIES 6

Sai Kumar B
Mega Sage
Mega Sage

Hello @Sai Pavan1 

Scripted REST APIs are used for Inbound integrations when external application make calls to ServiceNow for the data. In your requirement, you have to make calls to the external application to get the data so I would suggest you use Outbound REST Message and create a GET Request method accordingly to retrieve the data. The following documentation will guide how to set up the outbound REST message

Outbound REST web service 

 

Video reference links

Simple Outbound REST message 

What is Outbound REST Integration in ServiceNow? 
If I could help you with my response you can mark it as helpful and correct as it benefits future viewers
Thanks,
Sai Kumar B
Community Rising Star 2023 & 2022

 

 

Hello @Sai Kumar B,

Thanks for the reply. As per your suggestion, Can we use the REST message without any authentication ? The webpage that I mentioned is not providing any OAUTH provider details  like Token URL, Authorization URL, Client ID and Client Secret. It is just a random webpage available. 

So in this scenario to get those particular state names can we proceed with REST message ? or is there any other way to do this ? 

@Sai Pavan1 

If the webpage you mentioned provide free information without authentication. For public web services that do not require authentication, set the Authentication type field of your outbound REST message to No authentication.

Reference - Outbound REST Integrations 

If I could help you with my response you can mark it as helpful and correct as it benefits future viewers
Thanks,
Sai Kumar B
Community Rising Star 2023 & 2022

@Sai Pavan1 

If I could help you with my response you can mark it as helpful and correct as it benefits future viewers
Thanks,
Sai Kumar B
Community Rising Star 2023 & 2022