Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

Image RemovedImage Added


Give the role a name (“UCRole” is recommended) and click the “Submit” button.

Image RemovedImage Added

The ACL

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.

Image RemovedImage Added

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.

Image RemovedImage Added

If there is no “New” button on screen you might need to elevate permissions: from the user dropdown, select “Elevate Roles”.

Image RemovedImage Added

Be sure to have “security_admin” checked and click “OK”.

Image RemovedImage Added

Now click on the “New” button.

Image RemovedImage Added

Select “REST_Endpoint” for the “Type” field and give it a name (“UCACL” is recommended)

Image RemovedImage Added

Scroll down to “Requires Role” and add the “UCRole” we previously created then click the “Submit” button.

Image RemovedImage Added


The User

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.

Image RemovedImage Added

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.

Image RemovedImage Added

Back on the “Users” section, select the user you just created, scroll down to the bottom, select the “Roles” tab and click “Edit”.

Image RemovedImage Added

Add both, the role we created previously and the “impersonator” role, then click the “Update” button.

Image RemovedImage Added

Scripted REST API

...

Write "Scripted REST APIs" in the Filter Navigator and select the Scripted REST APIs option.

Image RemovedImage Added

New Scripted REST API                   

Press "New" to create a new record.

Image RemovedImage Added


Create the Scripted REST API

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.

Image RemovedImage Added


Select the Scripted REST API

Search for the service in the “Scripted REST APIs” page and click on it.

Image RemovedImage Added

Resources

New Resource

Scroll to the bottom and click "New" to create a new Resource.

Image RemovedImage Added

Resource Fields

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.


Image RemovedImage Added

Resource Code

Paste the provided code below the “// Implement resource here” comment and click submit.

...