Calling External API in ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Best practices to call External API's(Hosted on any Cloud Solution/On-Prem Solution) from ServiceNow platform synchronous/asynchronous.
Kindly help with relevant technical documents.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Hi there @RavinderK
You can call either synchronously (using RESTMessageV2 in server-side scripts) or asynchronously (using Scripted REST APIs, Outbound REST, or IntegrationHub).
For on-prem/cloud APIs, make sure to configure MID Server if the endpoint isn’t publicly accessible.
Handle authentication via Connection & Credential Aliases (OAuth2, Basic, API Keys).
Always add timeouts, retries, and error handling to avoid performance issues.
Use async (queued jobs/IntegrationHub) for long-running or heavy calls.
Best to use async calls whenever possible
External Content Ingestion API
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG
Microsoft MVP (AI Services), India
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Best practice is to use async when you make API calls especially with third-party API for better performance and scalability. In exception scenarios, you can consider using sync calls with timeout limit set to avoid bottlenecks.
General rule is, if you want to validate something first with external API before proceeding with next steps use sync call as it waits for execution to complete first and will not procced to next steps without a response. Use this only for limited and specific scenarios only if it is a MUST.
For everything else use async call, as it is efficient and will proceed with next steps after making the API call and provides a smoother user experience.
Below blog & articles can help you to understand the difference between sync and async calls and best practices to follow,
https://blog.postman.com/understanding-asynchronous-apis/
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0749289
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0716391
If this helped to answer your query, please mark it as helpful & accept the solution.
Thanks,
Bhuvan