How to use REST APIs
Use the REST API to find devices, read their state, and send commands.
Get a token
Sign in to get a temporary API token. Select Copy token to use it in your terminal. The examples on this page use it too. The token is short-lived, so keep it private and copy a fresh one when it expires.
For your own app, use OAuth authorization.
Create a simulator light
The commands on this page use the endpoint ID of your simulator light.
Explore your endpoints
You can also try it live below. Click Run to list the endpoints available to your token.
Each result is an endpoint, such as a light, speaker, or sensor. If the list is empty, add a device or create a simulator, then run the command again.
Try a light command
Use Turn off to switch off your simulator light. Choose Bash or PowerShell to copy the command for your terminal. You can turn the light on again with Turn on.
What just happened?
You used a token to turn off a simulator light with the Port OS API. You can send the same requests from your own app.