Skip to main content

Using the /api/mgmnt Service to Discover REST Services

Using the /api/mgmnt Service to Discover REST Services

The /api/mgmnt service includes calls you can use to discover REST service classes and REST-enabled web applications.

Discovering REST Services

To use the /api/mgmnt service to discover the REST services that are available on an instance, use the following REST call:

  • For the HTTP action, select or specify GET.

  • For the URL, specify a URL of the following form, using the <baseURL> for your instance:

    http://<baseURL>/api/mgmnt/v2/

    Or, if you want to examine only one namespace:

    http://<baseURL>/api/mgmnt/v2/:namespace

    Where namespace is the namespace you want to examine.

(Note that these calls ignore manually-coded REST services. To discover manually-coded REST applications, use the calls GET /api/mgmnt/ and GET /api/mgmnt/:v1/:namespace/restapps.)

If the call is successful, InterSystems IRIS returns an array that lists the REST services, in JSON format. For example:

[
  {
    "name": "%Api.Mgmnt.v2",
    "webApplications": "/api/mgmnt",
    "dispatchClass": "%Api.Mgmnt.v2.disp",
    "namespace": "%SYS",
    "swaggerSpec": "/api/mgmnt/v2/%25SYS/%Api.Mgmnt.v2"
  },
  {
    "name": "myapp",
    "webApplications": "/api/myapp",
    "dispatchClass": "myapp.disp",
    "namespace": "USER",
    "swaggerSpec": "/api/mgmnt/v2/USER/myapp"
  }
]

Discovering REST-Enabled Web Applications

To use the /api/mgmnt service to discover the REST-enabled web applications that are available on an instance, use the following REST call:

  • For the HTTP action, select or specify GET.

  • For the URL, specify a URL of the following form, using the <baseURL> for your instance:

    http://<baseURL>/api/mgmnt

    Or, if you want to examine only one namespace:

    http://<baseURL>/api/mgmnt/v1/:namespace/restapps

    Where namespace is the namespace you want to examine.

See the reference sections for GET /api/mgmnt/ and GET /api/mgmnt/:v1/:namespace/restapps.

FeedbackOpens in a new tab