Create Scope
Scopes
Domino REST API Scope is the final part on exposing a database with Domino REST API.
The scope defines to whom a specific schema is exposed. This is not done directly, there isn’t a place you pick users to add to a scope, instead you can specify a list of scopes a user has when they log in with the authentication endpoint. Because of this, you can set up multiple scopes, each pointing to a different schema for the same database. You could have different fields exposed through one scope that aren’t exposed in another or that only documents of a certain form type are available through one scope, giving you many different options. It is important to note that all Domino Database ACL security and rights are maintained.
Now, we need to expose a scope. This could be done via the Domino REST API Configuration UI. The Domino ToDo Database tutorial is a tutorial that takes that approach. In this tutorial, the schema and scope will be managed via REST API calls.
Creating The Scope
- Hover over the
Domino-REST-API-NewDB
collection name and click on the ellipsis (three dots). Select Add Request. - Name the request
create scope
and click Save. - Change the method from GET to POST.
- Set the URL as
{{SETUP_HOST}}/admin/scope?createSchema=true
. - On the Headers tab, add a HTTP request header called Authorization with the value
{{bearer}}
. This maps to the bearer collection variable we set from theauthenticate
request. - Add an HTTP request header Content-Type set to
application/json
. - On the Body tab change the type to
Raw
and also change the type fromText
toJSON
. -
Set the request body content to:
{ "apiName": "customers", "description": "Customer scope", "icon": "Base64 stuff, preferably SVG", "iconName": "beach", "isActive": true, "nsfPath": "customers.nsf", "schemaName": "customers" }
- Click Send to make the request.
- Save and close the request.
Congratulations!
This request has enabled the new scope database to be administered via Domino Rest API.