- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 03:59 AM
I have used GET and POST HTTP methods to integrate two PDI between. But I need to add PATCH and DELETE Methods also for this PATCH method i dont want give sys id in Endpoint URL itself. Instead of that is there anyway to pass sys id.
If i mentioned sys id in url itself then it will applicable only to one sys id
i want to give dynamic sys id.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 08:46 AM
Hi @Aditya02
To use the PATCH method in ServiceNow without specifying the sys_id in the endpoint URL, you can pass the sys_id dynamically in the request body or as a query parameter. Here’s a summary of how you can achieve this:
Using Request Body:
- Include the sys_id in the JSON payload of your PATCH request.
- Example:
{ "sys_id": "your_sys_id", "field_to_update": "new_value" }
Using Query Parameters:
- Pass the sys_id as a query parameter in the URL.
- Example URL: https://your_instance.service-now.com/api/now/table/incident?sys_id=your_sys_id
- Ensure your script or integration logic extracts the sys_id from the query parameters.
ServiceNow Scripted REST API:
- Create a Scripted REST API in ServiceNow to handle PATCH requests.
- In your script, dynamically handle the sys_id from the request body or query parameters
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 04:27 AM - edited 03-21-2024 04:28 AM
You can use request parameters or request body to pass the sys ID. Here's how you can do it:
Using Request Parameters:
- Modify your endpoint URL to accept parameters.
- Pass the sys ID as a parameter in your request.
- Extract the sys ID from the request parameters in your PDI transformation and use it accordingly.
Using Request Body:
- Modify your request to include the sys ID in the request body.
- Extract the sys ID from the request body in your PDI transformation and use it accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 04:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2024 02:32 AM
Hi @Aditya02 ,
It may helps to you. please refer to this link
Refer:
ServiceNow to ServiceNow Integration - Step by Ste... - ServiceNow Community
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 08:46 AM
Hi @Aditya02
To use the PATCH method in ServiceNow without specifying the sys_id in the endpoint URL, you can pass the sys_id dynamically in the request body or as a query parameter. Here’s a summary of how you can achieve this:
Using Request Body:
- Include the sys_id in the JSON payload of your PATCH request.
- Example:
{ "sys_id": "your_sys_id", "field_to_update": "new_value" }
Using Query Parameters:
- Pass the sys_id as a query parameter in the URL.
- Example URL: https://your_instance.service-now.com/api/now/table/incident?sys_id=your_sys_id
- Ensure your script or integration logic extracts the sys_id from the query parameters.
ServiceNow Scripted REST API:
- Create a Scripted REST API in ServiceNow to handle PATCH requests.
- In your script, dynamically handle the sys_id from the request body or query parameters
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!Sandeep