ServiceNow REST & Scripted REST API Guide
by NowSpectrum
$35+
ServiceNow integrations are where the most complex and highest-stakes development happens on the platform. Whether you're consuming external APIs via RESTMessageV2, exposing data to third-party systems via the Table API, or building custom endpoints with Scripted REST, the decisions you make here affect security, reliability, and maintainability at enterprise scale.
This guide covers all three integration surfaces in depth — what each one does, when to use it, how to authenticate correctly, how to handle errors, and the production patterns that separate robust integrations from ones that fail silently at 2am.
What's inside — 27 pages:
The REST API Landscape — Table API vs Scripted REST vs RESTMessageV2. A clear decision framework for which surface to use and why, before you write a single line of code.
Table API — Inbound REST — Every endpoint pattern, every query parameter (sysparm_query, sysparm_fields, sysparm_limit, and 7 more), full HTTP method reference (GET, POST, PUT, PATCH, DELETE), and pagination patterns for large result sets.
Authentication Methods — Basic auth done correctly with dedicated service accounts. Full OAuth 2.0 token flow including refresh token handling. The security mistakes we've seen expose enterprise credentials in production.
RESTMessageV2 — Outbound REST — GET and POST patterns with full error handling. Using saved REST Message definitions instead of hardcoded endpoints. Try-catch patterns that prevent a single failed integration call from breaking an entire Business Rule.
Scripted REST API — Building custom GET and POST handlers from scratch. Request and response object reference. Path parameters, query parameters, and request body handling. When to build one — and just as importantly, when not to.
Error Handling & Reliability — A complete HTTP status code reference table mapped to required actions. Exponential backoff retry logic you can drop straight into a Script Include.
Async Execution & MID Server — Non-blocking REST calls for high-throughput scripts. Routing through MID Server for on-premise system integration.
Security Patterns — Credential storage using System Properties and Connection & Credential Aliases. ACL enforcement on Scripted REST endpoints. Role-based access control in custom handlers.
Quick Reference Tables — The complete Table API parameter list. Every RESTMessageV2 method with return types. Nothing left to look up elsewhere.
Real production incidents included:
Two detailed war stories from enterprise deployments — a healthcare provider's exposed credential incident, and a financial institution's rate-limit failure that silently dropped 7,900 records with no alert. These aren't hypotheticals. They're what happens when these patterns are skipped.
Who this is for:
ServiceNow developers building integrations for the first time who want to avoid the mistakes that cause production incidents. Experienced developers who want a single reference instead of five browser tabs of documentation. Architects reviewing integration code who need a checklist of what correct looks like.
What makes this different:
This isn't a documentation summary. Every pattern here reflects what we've seen succeed and fail across enterprise ServiceNow deployments. The retry logic, the credential management rules, the MID Server routing guidance — all of it comes from production incidents, not theory.
27 pages. No padding. Just the reference.