Skip to content

Send a new message to the device

POST
/devices/id/messages

Parameters

Path Parameters

id*

device id

Typenumber
Required

Request Body

JSON
{
"config": "string",
"message": "string",
"mobileTerminated": true,
"created": "string",
"sent": "string",
"id": 0,
"deviceId": 0,
"userId": 0
}

Responses

Body (JSON)
JSON
{
"config": "string",
"message": "string",
"mobileTerminated": true,
"created": "string",
"sent": "string",
"id": 0,
"deviceId": 0,
"userId": 0
}

Samples

cURL
curl -X POST https://api.lightbug.cloud/api/devices/id/messages
JavaScript
fetch("https://api.lightbug.cloud/api/devices/id/messages", { method: "POST" })
  .then(response => response.json())
  .then(data => console.log(data));
PHP
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.lightbug.cloud/api/devices/id/messages");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python
import requests
response = requests.post("https://api.lightbug.cloud/api/devices/id/messages")
print(response.json())