Scripted REST API ServiceNow Example: Build One End to End
A worked Scripted REST API example in ServiceNow: create the API, add GET and POST resources, read parameters, return errors, secure it, and test with curl.
Read guidePractical guides, useful scripts, and lessons from working with the platform. A little less figuring it out. A little more getting it done.
A targeted query is a good place to start.
// Only the records you need
var incidents = new GlideRecord('incident');
incidents.addQuery('active', true);
incidents.setLimit(10);
incidents.query();Read the query performance guide 
The notebook
A worked Scripted REST API example in ServiceNow: create the API, add GET and POST resources, read parameters, return errors, secure it, and test with curl.
Read guideHow sysparm_view, sysparm_query, sys_id=-1 and other ServiceNow URL parameters work, with examples for forms, lists, modules and the REST Table API.
Read guideUse these ServiceNow App Engine Studio best practices to plan the data model, control access, govern citizen developers, test, and deploy apps safely.
Read guideThe script library
75 ServiceNow examples across client scripts, business rules, integrations, and more. Find a pattern, understand it, and adapt it to your instance.
Open the script libraryHave a ServiceNow question or a project in mind?