Misty's API Explorer provides interactive access to Misty's REST API endpoints. You can use the API Explorer to:
- browse the list of Misty's REST API endpoints
- send REST API commands to Misty
- experiment with different parameters
NOTE: The API Explorer is currently in a pre-release state. As such, not all features are fully functional, and the site may change before the release of Misty's SDK.
Connect Misty to the API Explorer to start experimenting with her REST endpoints. Before you connect Misty to an instance of the API Explorer, make sure your computer and Misty are on the same Wi-Fi network.
- Open up the API Explorer in a browser window.
- Enter the IP address of your robot (you can find your robot's IP address in the Misty companion app) and click the Connect button. Watch for the text on the Connect button to change to Connected.
Follow these steps to send REST requests from the API Explorer to Misty.
- Make sure Misty is connected to the API Explorer.
- Choose a command from the Command List on the left-hand side of the page.
- Enter values for any parameters the command requires.
- Click the Send Request button to send the request to Misty.
When you send a request, Misty's response appears in the JSON Response section of the API Explorer, as well as in your browser's web console.
The full sequence for sending a request from the API Explorer looks like this:
You can run these code samples by pasting them into the
<script> tags of an .html file and opening that file in your web browser. The .html file must include the following references:
- a reference to the jQuery library (available from Google)
- a reference to a local directory that contains the lightClient.js helper tool
Read more about lightClient.js in the documentation.
Download lightClient.js from GitHub.
Note: Code samples for "Get" commands also include examples of the callback function required to handle the data that Misty returns.
This topic briefly describes the function of each part of the API Explorer.
Browse the command list to see the endpoints available on the connected Misty robot. Select a command to open the request form.
Commands are organized into groups by function. You can also choose sort the list of commands alphabetically. Each command in the list is labeled with the HTTP method used when you send a request to the endpoint associated with that command.
The Request section of the request form includes a brief description of the selected command. It also shows sample code for making a request to the associated endpoint.
The sample code in this section automatically updates when you enter new data into the Parameters fields. To copy this sample code, click the Copy button.
For information about using this sample code with Misty, see REST API Code Samples.
The Parameters section includes fields where you can enter data to send along with your request. When you enter values into these fields, the sample code in the Request and Skill Code sections automatically update. To send a request to Misty, click the Send Request button.
The JSON Response section shows any data Misty returns when you send a request. To copy the contents of this section to your clipboard, click the Copy button.
For more information about the return values for Misty's REST API, see the REST API reference documentation.