This series of steps illustrates what is needed to make API calls and provides example requests and responses for a number of common interactions.
Please note: This walkthrough is for informational purposes only. The requests and responses are simulated and are not actually communicating with the real API.
There are two Auth Tokens that will be used throughout this tutorial.
Application Auth Tokens are limited in their use, with the main use being the creation and management of Organizations and Streams . They can also be used to get a list of Devices application-wide, to aid in understanding the full scope of devices under the management of an Application. In summary, these tokens are generally used for setup activities.
Organization Auth Tokens are used to manage the Locations hierarchy, UserRoles, and Devices that belong to an Organization. These tokens are used at runtime to facilitate interaction with devices.
Eaton does not offer end-user management for Applications, with the exception of user account management for Installers and Developers.
It is the Application's responsibility to store and manage users of their system. The Developer is responsible for creating a middleware layer between the end-users of their system and the EM Platform. Specifically, a mapping should be kept of which Organizations, Locations, and Devices belong to which end-user(s). A user's requests should be mapped to an Organization so the middleware layer can make the request to the EM API using an Organization Auth Token on the user's behalf. This mapping is not stored or managed by the EM API.
Step Overview:
All API requests require an Application API Key to be provided in the Em-Api-Subscription-Key
header. This key can be found by selecting the Application you wish to communicate with the API on the My Apps page.
Throughout the tutorial you will see this fake API key used in the Em-Api-Subscription-Key
header of every simulated request.
API Key: the-fake-api-key