Resources

Medium One Documentation

API Explorer


Introduction

The Medium One API Explorer is a tool that allows users to easily:

  • Login to the API
  • Create an API Basic User
  • Get a list of all your API Basic Users
  • Retrieve an API Basic User's login id and MQTT id
  • Update an API Basic User's password or disable it
  • Delete an API Basic User
  • Get the events of an API Basic User from a specific stream (with optional time range and limits)
  • Create events on behalf of an API Basic User

Note: An alternative to using API Explorer is completing these actions through CURL or Python. To display these commands, click on the "Show Code" button. The commands are automatically updated as you select the fields from the API Explorer.



The first step to using API Explorer is logging into the API.

Login to API: login - POST

  • Click "login - POST" on the side panel
  • Select an account to sign into on the dropdown
    • If you sign onto an API Business User, you will have access to all of your API Basic Users
    • If you sign onto an API Basic User, you will have access to only that API Basic User
  • Type in the password for that account
  • Select an API Key, then Send
    • If you do not already have one, you will need to create one on the Manage API Keys page.
  • If successful, you will get a 200 response


After you've logged in, you can complete any of the other API calls as listed below:

Create an API Basic User: users - POST

  • You must be logged in as an API Business User to create an API Basic User
  • Fill out the login id and password for the user you want to create
    • To find out more about User Permissions, click here
  • If successful, you will get a 200 response
  • You can also create an API Basic User through the UI by going to the Manage Users page.


Get API Basic Users: users - GET

  • You must be logged in as an API Business User to retrieve the API Basic Users list
  • Click 'Send' to retrieve a list of all your API Basic Users
  • If successful, you will get a 200 response and a list of users with disabled, login_id, user_data, and mqtt_id
    • disabled is a boolean specifying if data can be sent to that user or not
    • login_id is the user's login id
    • mqtt_id is the user's mqtt id
  • You can also find the list of API Basic Users on the Manage Users page.


Get an API Basic User: users/<login_id> - GET

  • You must be logged in as an API Business User to retrieve an API Basic User
  • Select an API Basic User on the login_id dropdown and click 'Send'
  • If successful, you will get a 200 response and a message with the user login_id and mqtt_id
    • login_id is the user's login id
    • mqtt_id is the user's mqtt id
  • You can also find an API Basic User's information on the Manage Users page.


Update an API Basic User: users/<login_id> - PATCH

  • You must be logged in as an API Business User to update an API Basic User
  • Select an API Basic User on the login_id dropdown
  • To change the user's password, type in the new password in the password field (optional)
  • To disable the user and not allow any data to be sent in, check the box (optional)
  • If successful, you will get a 200 response


Delete an API Basic User: users/<login_id> - DELETE

  • You must be logged in as an API Business User to delete an API Basic User
  • Select the API Basic User on the login_id dropdown that you want to delete
  • If successful, you will get a 200 response


Get Events: events/<stream_name>/<login_id> - GET

  • You can either be logged in as the API Business User to view any user's events OR you can log in as an API Basic User to see that user's own events
  • In the stream_name dropdown, select the stream you want to view events from
  • In the login_id dropdown, select the user you want to view events from
  • To specify a certain time range for the events, select a timestamp for since and until (optional)
  • Select a limit to specify a number limit of events to display (optional)
  • If successful, you will get a 200 response and a list of events for that API Basic User


Create Events: events/<stream_name>/<login_id> - POST

  • You can either be logged in as the API Business User to send an event to any user OR you can log in as an API Basic User to send that user's own events
  • In the stream_name dropdown, select the stream you want to send events to
  • In the login_id dropdown, select the user you want to send events to
  • The observed_at field is defaulted to the current timestamp of when you loaded the page
    • If the observed_at is not sent with the API call, it is always defaulted to the current timestamp
  • In event_data, type in the event you want to send in JSON format. Examples:
    • {"temperature":27}
    • {"age":18, "gender":"female"}
  • If successful, you will get a 200 response

Getting Started
User Roles & Permissions
Streams, Tags, & Data Types
Dashboard Widgets
API
Workflow Studio
Workflow Libraries
Metering
Special Characters
Third Party Integration
Mobile
API Explorer

API Explorer


Introduction

The Medium One API Explorer is a tool that allows users to easily:

  • Login to the API
  • Create an API Basic User
  • Get a list of all your API Basic Users
  • Retrieve an API Basic User's login id and MQTT id
  • Update an API Basic User's password or disable it
  • Delete an API Basic User
  • Get the events of an API Basic User from a specific stream (with optional time range and limits)
  • Create events on behalf of an API Basic User

Note: An alternative to using API Explorer is completing these actions through CURL or Python. To display these commands, click on the "Show Code" button. The commands are automatically updated as you select the fields from the API Explorer.



The first step to using API Explorer is logging into the API.

Login to API: login - POST

  • Click "login - POST" on the side panel
  • Select an account to sign into on the dropdown
    • If you sign onto an API Business User, you will have access to all of your API Basic Users
    • If you sign onto an API Basic User, you will have access to only that API Basic User
  • Type in the password for that account
  • Select an API Key, then Send
    • If you do not already have one, you will need to create one on the Manage API Keys page.
  • If successful, you will get a 200 response


After you've logged in, you can complete any of the other API calls as listed below:

Create an API Basic User: users - POST

  • You must be logged in as an API Business User to create an API Basic User
  • Fill out the login id and password for the user you want to create
    • To find out more about User Permissions, click here
  • If successful, you will get a 200 response
  • You can also create an API Basic User through the UI by going to the Manage Users page.


Get API Basic Users: users - GET

  • You must be logged in as an API Business User to retrieve the API Basic Users list
  • Click 'Send' to retrieve a list of all your API Basic Users
  • If successful, you will get a 200 response and a list of users with disabled, login_id, user_data, and mqtt_id
    • disabled is a boolean specifying if data can be sent to that user or not
    • login_id is the user's login id
    • mqtt_id is the user's mqtt id
  • You can also find the list of API Basic Users on the Manage Users page.


Get an API Basic User: users/<login_id> - GET

  • You must be logged in as an API Business User to retrieve an API Basic User
  • Select an API Basic User on the login_id dropdown and click 'Send'
  • If successful, you will get a 200 response and a message with the user login_id and mqtt_id
    • login_id is the user's login id
    • mqtt_id is the user's mqtt id
  • You can also find an API Basic User's information on the Manage Users page.


Update an API Basic User: users/<login_id> - PATCH

  • You must be logged in as an API Business User to update an API Basic User
  • Select an API Basic User on the login_id dropdown
  • To change the user's password, type in the new password in the password field (optional)
  • To disable the user and not allow any data to be sent in, check the box (optional)
  • If successful, you will get a 200 response


Delete an API Basic User: users/<login_id> - DELETE

  • You must be logged in as an API Business User to delete an API Basic User
  • Select the API Basic User on the login_id dropdown that you want to delete
  • If successful, you will get a 200 response


Get Events: events/<stream_name>/<login_id> - GET

  • You can either be logged in as the API Business User to view any user's events OR you can log in as an API Basic User to see that user's own events
  • In the stream_name dropdown, select the stream you want to view events from
  • In the login_id dropdown, select the user you want to view events from
  • To specify a certain time range for the events, select a timestamp for since and until (optional)
  • Select a limit to specify a number limit of events to display (optional)
  • If successful, you will get a 200 response and a list of events for that API Basic User


Create Events: events/<stream_name>/<login_id> - POST

  • You can either be logged in as the API Business User to send an event to any user OR you can log in as an API Basic User to send that user's own events
  • In the stream_name dropdown, select the stream you want to send events to
  • In the login_id dropdown, select the user you want to send events to
  • The observed_at field is defaulted to the current timestamp of when you loaded the page
    • If the observed_at is not sent with the API call, it is always defaulted to the current timestamp
  • In event_data, type in the event you want to send in JSON format. Examples:
    • {"temperature":27}
    • {"age":18, "gender":"female"}
  • If successful, you will get a 200 response