Welcome to our API Documentation! these resources will help you connect your devices and applications to the Ubidots cloud.
API Reference: A complete list of the supported API calls, with sample requests and responses.
Device Clients: Firmware examples and tutorials on how to connect different devices to Ubidots.
API Clients: API libraries to help you interact with Ubidots from your own applications.
Try it now!
Get familiar with our API using this live example.
Send one value to Ubidots
Let’s start by sending an HTTP request to the Ubidots API to create one value.
We’ll need to tell the API the ID of the Variable we want to update, and a security token so that our request can be authenticated:
- Variable ID: This is a unique identifier of the time series that stores your data.
- Token: A unique key to authenticate your request.
Let’s create a sample HTTP request using these two:
Go to your account, create a Variable and grab it’s ID. Paste this ID in the form below.
Click on “API Credentials” then copy your authentication token:
Paste the above values below to see how the HTTP request is built:
POST /api/v1.6/variables//values HTTP/1.1 X-Auth-Token: Host: things.ubidots.com Connection: close Content-Type: application/json Content-Length:
Sample curl request
curl -X POST -H "Content-Type: application/json" -d '' https://things.ubidots.com/api/v1.6/variables//values/?token=
Now go back to your Ubidots Variable; you should see the data you just sent.
Send yourself an SMS
- Now go to the “Events” tab and click on “Add Event”.
- Select the Device and the Variable you just created.
- Configure a condition to trigger your event if the Variable value is > 100.
- Click on “Send SMS” then type your phone number (mind your country code!) and finish.
Now that we created an Event, let’s send another value -this time greater than 100- to meet the condition you just set:
You should now get an SMS alerting you the sensor value is above the given threshold!
If you are more into the hardware side of IoT, you’ll love our device libraries and tutorials, which can help you connect your devices to Ubidots.
Makers and hardware enthusiasts have published tons of Ubidots-powered projects around the web. Check out our Hackster hub for a selection of IoT projects containing code examples and use cases that can speed up your IoT ideas. Don’t forget to follow us on Hackster! :)