Adapter API routes

Adapter API routes can be defined in the same manner as application routes. This allows you to expose adapter functionality using a web API instead of a task or custom code.

Route example

Adding the route property to a method in the pronghorn.json file informs Itential Platform that you would like the route exposed.

For example, if you have an adapter named HelloWorld, you can define a route for one of its methods with the following entry in the pronghorn.json file:

1{
2 "name" : "hello",
3 "summary" : "Say hello",
4 "description" : "Example",
5 "input" : [],
6 "output" : {
7 "type" : "object",
8 "name" : "return_data",
9 "description" : "A string saying hello back to the user."
10 },
11 "route" : {
12 "verb" : "GET",
13 "path" : "/hello"
14 },
15 "roles" : ["admin"]
16}

This example tells Itential Platform to define the route /hello as the interface for the hello method in the HelloWorld adapter.

One important difference between applications and adapters when it comes to their API routes is that applications use the title property in the pronghorn.json file for their base path, whereas adapters use their service name. The service name is the name you gave the adapter when creating it. You can view this name in the Admin Essentials application under the Adapters dropdown.

Adapters dropdown in Admin Essentials

Using the HelloWorld adapter as an example: if you added it to Itential Platform with the name HelloWorldAlpha, the hello method would be accessible at:

http://<IAP base path>/HelloWorldAlpha/hello

If you added a second HelloWorld adapter named HelloWorldBeta, the hello method would be at:

http://<IAP base path>/HelloWorldBeta/hello

Reference

You can view the routes that Itential Platform creates on the Help Desk page under Adapter/Integration API. Navigate to the icon on the left pane, select Help (right side), then click the View Documentation button under Adapter/Integration API.

http://<IAP base path>/help
Adapter/Integration API section on the Help Desk page

Other uses

Exposed adapter routes can also be used in JSON Forms validation in the same manner as application routes. Find your base URL and API route in the dropdowns.

JSON Forms validation using exposed adapter routes