REST APIs

REST APIs can be used to work with data sets and models and to administer and monitor events.

When you train or deploy IBM® Maximo® Visual Inspection, you can use REST APIs to work with data sets and models.

You can also use the APIs to administer and monitor events. Use these APIs to bypass the user interface and automate IBM Maximo Visual Inspection processes or solutions.

REST API endpoints

The following table provides links to Maximo Visual Inspection REST API documentation that details version specific endpoints.

Version number API endpoints Notes
8.8 Documentation API endpoints are the same as version 8.6 API endpoints.
8.7 Documentation API endpoints are the same as version 8.6 API endpoints.
8.6 Documentation -
8.5 Documentation -
8.4 Documentation -
8.3 Documentation -
8.2 Documentation -

Creating and managing API keys

You can manage API keys from the IBM Maximo Visual Inspection user interface by opening the Services menu in the side bar and selecting API key.

  • To create an API key, click Generate API key.
  • To revoke a generated API key, click Delete API key.
  • To use a generated API key in an external program or through an API, see the following sections:
  • Each user can set their own API Key from the User pull-down > Manage profile.
  • Admin users cannot set an API Key in their user profile as they use the system-level API Key set in System > MVI Settings.

Entering the API token in an external program

  • Click the copy icon for the API key and paste it in the external program.
  • Click copy for the API endpoint and paste it in the external program.

Using the API token through an API

Programmatically, interacting with the Maximo Visual Inspection API also requires the API key and API endpoint values that you can copy from the Maximo Visual Inspection user interface.

Notice that the API endpoint value already contains the trailing substring /api.

The following cURL command shows how to authenticate with the API and interact with data sets. In this command, the {MVI_API_KEY} placeholder maps to the value that was copied from API key. The {MVI_SERVER} placeholder maps to the value that was copied from API endpoint.

curl -kXGET -H "x-auth-token: {MVI_API_KEY}" {MVI_SERVER}/datasets

Sample input

curl -kXGET -H "x-auth-token: 3d5af6ee780a83de36dc75b9364d9bf2" https://instance.mas.company.com/api/datasets

Sample output

For this example, a successful request yields a JSON list of data sets that are associated with the user who has access to {MVI_API_KEY}:

[
  {
    "_id": "c8f74bb3-5a9d-4d12-b8f0-1aa4cdd39621",
    "name": "new dataset",
    "usage": "generic",
    "scenario": "",
    "pre_process": "",
    "owner": "mviadmin",
    "locked": 0,
    "type": 0,
    "created_at": 1602193887165,
    "updated_at": 1602193887165,
    "total_file_count": 0
  }
]