Identifying URL Templates in a Module
Define URL templates in a module to identify the service endpoints clients call.
You specify service endpoints using templates to identify the app-specific part of the URL a client uses. Then, you configure a handler for one or more HTTP methods for each template. Before you define templates, you first create a module to contain them. You can name the module anything you like, but say you call it v0.
Then, in your v0 module, you can use URL templates like:
-
/actionitems– for working with action items in general, and -
/actionitems/:id– to work with a specific action item by unique identifier.
The URL a client app uses to call your web API starts with your domain, followed first by /ords/schemaalias, then by your module name and template. For example, to work with action items in general, the remote application uses the URL:
https://example.com/ords/cloudcompanion**/v0/actionitems**
To work instead with the specific action item with ID 1234, the client uses this URL instead:
https://example.com/ords/cloudcompanion**/v0/actionitems/1234**