IS SCRIPTED REST API (OR) WEB SERVICE Import sets in this scenario(Which is Best?)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2022 08:28 PM
I HAVE 2 SCENARIOS:
SCENARIO 1:
(TRIRD PARTY APP WILL SEND CHANGE NUMBER AS INPUT
TRIRD PARTY APP WILL CONSUME SERVICENOW API
SERVICENOW SHOULD SEND STATUS AND APPROVAL FIELD VALUES)
METHOD 1:
DIRECTLY SENDING THE API BUILT USING REST API EXPLORER:
https://<your instance>.service-now.com/api/now/table/change_request?sysparm_query=number%3D<Change number>&sysparm_fields=approval%2Cstate&sysparm_limit=1
METHOD 2:
CREATING A SCRIPTED REST API => SCRIPTED REST RESOURCE:
HTTP METHOD :GET
SCRIPTED REST RESOURCE SCRIPT TO SEND THE STATE AND APPROVAL FIELD VALUES
QUESTION 1: WHICH METHOD IS BEST FIRST SCENARIO => (METHOD 1 (or) METHOD 2).
SCENARIO 2:
(TRIRD PARTY APP WILL SEND CHANGE NUMBER AS INPUT
TRIRD PARTY APP WILL CONSUME SERVICENOW API
SERVICENOW SHOULD UPADTE STATUS FIELD VALUE)
METHOD 1:
CREATING A SCRIPTED REST API => SCRIPTED REST RESOURCE:
HTTP METHOD :POST
SCRIPTED REST RESOURCE SCRIPT TO UPDATE THE STATE FIELD:
METHOD 2:(IS THIS METHOD WRIGHT OR WRONG?)
CREATING WEB SERVICES => INBOUND => WEBSERVICES FIELDS
MAPPING WEB SERVICE FIELDS TO TARGET TABLE
note: KEEPING CHANGE NUMBER AS COALESCE
WHEN THIRD PARTY SEND THE CHANGE NUMBER IF CHANGE NUMBER MATCHES IT WILL UPDATE THE CHANGE RECORD.
QUESTIONS :
HOW I NEED TO GENERATE THE END POINT IN THIS METHOD 2?
WHERE IT WILL BE PRESENT?
HOW DOES IT HIT THE END POINT AFTER SHARING THE EDNPOINT WITH THIRD PARTY?
REPEATING THE QESTIONS AGAIN.
QUESTION 1: WHICH METHOD IS BEST IN FIRST SCENARIO => (METHOD 1 (or) METHOD 2).
QUESTION 2: WHICH METHOD IS BEST IN SECOND SCENARIO => (METHOD 1 (or) METHOD 2).
QESTION 3: SECOND SCENARIO(METHOD 2)
HOW I NEED TO GENERATE THE END POINT IN THIS METHOD 2? => SECOND SCENARIO(METHOD 2)
WHERE IT WILL BE PRESENT? => SECOND SCENARIO(METHOD 2)
HOW DOES IT HIT THE END POINT AFTER SHARING THE END POINT WITH THIRD PARTY?=> SECOND SCENARIO(METHOD 2)
PLEASE SHARE IF YOU FIND ANY OTHER MISTAKES IN THESE METHODS:
THANKS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2022 12:23 AM
Hi,
Transform will not generate the end points.
we have web services where you can generate the endpoint and Transform data.
1. Once you create the Inbound web service with all the fields then you need to map the
fields with target table so for that need Transform map where we will map fields with target table.
Using new button on below you can create transform map as shown below.
2. Once the mapping is done on web service form Related links will see Explore REST API.
if you click on that then you can select the method and give some data to test.
Once you send data then on below you will see the Request where you will get the End Point.
Refer this video for more in detail of Import SET API.
https://youtu.be/BsfVGhafVkc
HOW DOES tHIRD PART HIT THE END POINT WITH CHANGE NUMBER ?
1. You need to add the field for change number on payload so third party will send that.
If third is ServiceNow then you will send the payload as with your fields so they can trigger with business rule and send data with change number as you need.
Hope you it helps you.
Please Mark ✅ Correct/helpful if applicable, Thanks!!
Regards
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar