>

Get Started

Welcome to our API Documentation! these resources will help you connect your devices and applications to the Ubidots cloud.

Contents

  • 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:

  1. Go to your account, create a variable and grab it’s ID. Paste this ID in the form below.

  2. Click on “API Credentials” then copy your authentication token:

  3. Paste the above values below to see how the HTTP request is built:

Http Request:


POST /api/v1.6/variables//values HTTP/1.1
X-Auth-Token: 
Host: things.ubidots.com
Connection: close
Content-Type: application/json
Content-Length: 

API response:


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

  1. Now go to the “Events” tab and click on “Add Event”.
  2. Select the data source and the variable you just created.
  3. Configure a condition to trigger your event if the variable value is > 100.
  4. Click on “Send SMS” then type your phone number (mind your country code!) and finish.

API response:


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!

Next steps

If you’re looking to interact with our API from a web, mobile or desktop application, you may continue exploring our full API Reference and API Clients.

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.

Sample Projects

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! :)


GET STARTED
Join thousands of fellow IoT developers using Ubidots to build production-ready IoT solutions.

Sign up for free