Overview

The Constrained Application Protocol, CoAP, is a lightweight web transfer protocol designed for small, low-power devices that operate in constrained environments. It is often described as “HTTP for IoT” because it follows a similar request/response model, but with a dramatically smaller footprint and optimized behavior for unreliable or low-bandwidth networks.

CoAP was built with the realities of IoT hardware in mind: limited CPU, restricted memory, battery-powered operation, and networks where packet loss is common. For this reason, CoAP runs over UDP instead of TCP. Using UDP minimizes overhead and reduces energy consumption, while CoAP itself adds simple mechanisms to ensure reliability when needed.

CoAP supports a REST-like interaction model using familiar HTTP-style methods. However, Ubidots currently supports only the POST method, which is used to ingest data into the platform. This means devices will be able to send measurements and payloads to Ubidots, but other operations such as GET, PUT, or DELETE are not yet available.

Because of its efficiency and its minimal message overhead, CoAP has become a popular protocol for sensor networks and embedded systems striving to reduce power consumption while still following a clean, resource-oriented communication model.

In this section you will find the documentation needed to send data to Ubidots using CoAP and the supported POST operation.

libcoap

To send CoAP requests from your computer or to experiment with the examples in this guide, you may install the libcoap client tools using the following commands.

Linux

sudo apt update
sudo apt install libcoap2-bin

MacOS

brew install libcoap