...
To create a new specific Role for the new service, write “Role” on the Filter Navigator to the left and select the “Users and Groups -> Roles” option. Then click on the “New” button.
Give the role a name (“UCRole” is recommended) and click the “Submit” button.
The default ACL for the Scripted REST API is “Scripted REST External Default”. By default, any user with access to the ServiceNow instance will be able to execute exposed services.
To create a new specific ACL for the new service, write “ACL” on the filter navigator to the left and select the “System Security-> Access Control (ACL)” option.
If there is no “New” button on screen you might need to elevate permissions: from the user dropdown, select “Elevate Roles”.
Be sure to have “security_admin” checked and click “OK”.
Now click on the “New” button.
Select “REST_Endpoint” for the “Type” field and give it a name (“UCACL” is recommended)
Scroll down to “Requires Role” and add the “UCRole” we previously created then click the “Submit” button.
To create a new specific User for the new service, write “Users” on the Filter Navigator to the left and select the “Users and Groups -> Users” option. Then click on the “New” button.
Select a “User Id” and “Password” for the user and check the “Web service access only” option so the user won’t have UI access, then click the “Submit” button.
Back on the “Users” section, select the user you just created, scroll down to the bottom, select the “Roles” tab and click “Edit”.
Add both, the role we created previously and the “impersonator” role, then click the “Update” button.
...
Write "Scripted REST APIs" in the Filter Navigator and select the Scripted REST APIs option.
Press "New" to create a new record.
Write a name for the service. "Aspire UC" is recommended. The “API ID” field will be generated automatically. Click on "Submit" to create the service.
Search for the service in the “Scripted REST APIs” page and click on it.
Scroll to the bottom and click "New" to create a new Resource.
Write a name for the Resource (“getById” is recommended). Make sure that “HTTP method” is set to “GET” and the relative path reflects the specified name.
Paste the provided code below the “// Implement resource here” comment and click submit.
...