MachineMetrics provides an application programming interface (API) that enables companies to access certain MachineMetrics features and functions as well as retrieve and display MachineMetrics data through a programmatic connection to MachineMetrics from their own company applications. Typical applications that connect to the MachineMetrics API are company Enterprise Resource Planning (ERP) applications and other business management applications.
Using API Keys in MachineMetrics
The standard method for API authentication with MachineMetrics is through OAuth tokens. However, you can also use OAuth-compatible API Keys generated through the API Keys page in MachineMetrics to implement your API integration or just to test your API integration functionality. See MachineMetrics developer resources for more information.
Generating an API Key
An API Key is a unique code that is passed in from your external application through the API to identify and authenticate the calling application or user account with the API provider (MachineMetrics). To generate a MachineMetrics API Key for your company's application, do the following:
- Click the Gear icon in the upper right hand corner of the MachineMetrics homepage and select API Keys from the drop-down menu.
- In the API Keys page, click the Create API Key button:
- In the API Key dialog, select the options to designate the scope of the MachineMetrics functionality you want the API Key to support. See MachineMetrics API Key Functionality Scope Options for the complete list of options available in the API Key dialog.
- Click the Save Changes button at the bottom of the API Key dialog to create the key.
- In the Copy Your Access Token dialog, copy your API access token and store it in a secure location.
IMPORTANT! This dialog is the only time MachineMetrics will display your API Access Token, and MachineMetrics cannot recover it if it is lost. Your API Access Token is required for your application to authenticate with MachineMetrics. It should be treated like a password and only be accessible to authorized personnel.
- Click the Done button when you are have copied and stored your API Access Token. The API Keys page will now display the name of your API Key and the date it was created.
Changing API Key Functionality
If you want to change the MachineMetrics functionality supported by an API Key after you created it, you can just click on the key, change the option selections in the API Key dialog, and click the Save Changes button. If you want to delete an existing API Key, see Deleting an API Key.
MachineMetrics API Key Functionality Scope Options
When creating an API Key, you can select any combination of the following options in the API Key dialog to designate the scope of the MachineMetrics functionality for the API Key you create:
- user: Full control of user profile
- user.read: Read-only access to user profile
- operator: Full control of "operator-level" functionality
- operator.read: Read-only access to dashboards, reporting, and info needed for typical shop-floor activity
- operator.jobs: Job control and access to job lists and info
- operator.parts: Part scrapping and categorization
- operator.downtime: Downtime categorization
- manager: Full control of "manager-level" functionality
- manager.read: Read-only access to system settings, jobs, users, etc.
- system.gateway: Manage edge devices
- system.gateway.read: List available edge devices and status
- erp: Read and write access for ERP integration
- gateway: Read machine info and support data ingest
- reporting: Read access to reportable data
Deleting an API Key
If you want to delete an existing API Key that you created, do the following:
- In the API Keys page, click on the API Key entry that you want to delete.
- In the API Key dialog, scroll to the bottom and click the Delete button.
- Click the You Sure? button to confirm that you want to delete the API Key.