ServiceNow Integration - Step by step guide
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
ServiceNow Integration – Step by Step Guide
1. Introduction
ServiceNow integrations allow external systems to send and receive data with ServiceNow using standard protocols like REST, SOAP, MID Server, and APIs.
Integrations help automate processes, reduce manual work, and ensure data consistency across systems.
2. Types of Integration in ServiceNow
ServiceNow supports multiple integration methods:
REST Integration (Most commonly used)
SOAP Integration
MID Server Integration (for on-prem systems)
JDBC Integration
Email Integration
Import Set Integration
3. Prerequisites
Before building integration:
API endpoint details (URL)
Authentication details (Basic / OAuth / API Key)
Request & Response format (JSON / XML)
HTTP method (GET, POST, PUT, DELETE)
Scenario Example
Use Case:
Create an Incident in ServiceNow from an external system using REST API.
6. Step 1: Create a Scripted REST API
Navigate to System Web Services → Scripted REST APIs
Click New
Provide:
Name: External Incident API
API ID: external_incident
Save the record
7. Step 2: Create a Resource
Under the API, click New Resource
Provide:
Resource Name: Create Incident
HTTP Method: POST
Relative Path: /createIncident
Save
8. Step 3: Write Script for Incident Creation
(function process(request, response) {
var body = request.body.data;
var inc = new GlideRecord('incident');
inc.initialize();
inc.short_description = body.short_description;
inc.description = body.description;
inc.caller_id = body.caller;
var incidentSysId = inc.insert();
response.setStatus(201);
response.setBody({
status: "Success",
incident_sys_id: incidentSysId
});
})(request, response);9. Step 4: Test Using REST API Explorer
Go to System Web Services → REST API Explorer
Select your API and Resource
Provide request body (JSON)
{
"short_description": "Network issue",
"description": "Unable to connect to VPN",
"caller": "admin"
}Click Send
Verify incident creation
10. Step 5: Authentication Setup
Common authentication methods:
Basic Authentication
OAuth 2.0
API Key
For secure production integrations, OAuth is recommended.
11. Step 6: Error Handling & Logging
Always add:
Try–catch blocks
Proper error response
Logs using gs.info() or custom tables
Example:
try {
// business logic
} catch (e) {
response.setStatus(500);
response.setBody({
error: e.message
});
}12. Outbound Integration (ServiceNow → External System)
For calling external APIs from ServiceNow:
Go to System Web Services → Outbound → REST Message
Create REST Message
Configure endpoint, authentication, headers
Call it via:
var r = new sn_ws.RESTMessageV2('External API', 'post');
var response = r.execute();13. Best Practices
Use Script Includes for reusable logic
Avoid hardcoding credentials
Use MID Server for on-prem systems
Enable API rate limiting
Log integration errors separately
Thanks & Regards,
Vijay Chorge.
If you found this blog helpful, please mark it as Helpful.
- 626 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Vijayc1
Could you please add the Prefix blog or article so that it’s easy for readers to understand whether it is knowledge or Question.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Vijayc1,
I have a few questions regarding your post, I hope you re okay to discuss it further.
#1 You say "ServiceNow integrations allow external systems to send and receive data with ServiceNow using standard protocols like REST, SOAP, MID Server, and APIs."
- are you really sure that MID server and API are protocols?
#3 Perhaps explaining what represnt each method of could help in such an overview. E.g. difference between PUT and PATCH..
#8 it says "Write script" - it's quite vague.. what kind of script would it be? a business rule, transform script - onBefore, orAfter, or what script exactly ....? have you tested that it really works?
#12 - Outbound Integration (ServiceNow → External System)
- you didn't mention inbound integration, was it on purpose?
- it seems like integrations according to your overview are only one-way..
#13 can you give some example of the script include?
And also, for such descriptive post, I miss information about import set table, transform script, transform maps, mappings, and most importantly (!!!!) IntegrationHub which is the most recommended tool for integrations...
And the numbering order is quite chaotic :((
No AI was used in the writing of this post. Pure #GlideFather only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi there, for completeness on this topic, read & bookmark this important blog post: Integration Design - How to choose the best pattern to integrate ServiceNow with other systems
Please mark it as helpful and accept it as a solution if it helps you in any way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
