RESTAPIRequest - pathParams

The path parameters passed in the request URI.

Table 1. Field
Name Type Description
pathParams Object The path parameters as a script object. Available path parameters depend on the web service configuration.

In this example, the scripted REST API endpoint follows this format: https://instance.service-now.com/api/now/myservice/{tableName}/{id}. The request being processed uses this URL: https://instance.service-now.com/api/now/myservice/myApp_table/1234.

var pathParams = request.pathParams; 
var tableName = pathParams.tableName; //‘myApp_table’ 
var id = pathParams.id; //‘1234’