Messages

Send text to a device

post

Send text or raw data over UDP or TCP to a device with a specific SIM ID.

If the protocol is UDP, the packet will be sent to the receiving port. If the protocol is TCP, a connection will be established with the device on that port and the data will be sent. If the device does not accept incoming connections on that port, the data will be discarded.

Either text or data must be provided, but not both. Use text for string data and data for base64-encoded binary data that will be decoded and sent as raw bytes.

Authorizations
Path parameters
sim_idstringRequiredExample: 000000001
Body
protocolstring · enumRequired

The protocol to use for sending the message

Possible values:
portinteger · min: 1 · max: 65535Required

The target port number

textstringOptional

String data to send (mutually exclusive with data)

datastring · byteOptional

Base64-encoded binary data to send (mutually exclusive with text)

Responses
200

Message sent successfully

application/json
post
POST /messages/{sim_id} HTTP/1.1
Host: api.onomondo.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 51

{
  "protocol": "udp",
  "port": 1234,
  "text": "hello world"
}
{
  "id": "46c5e0e3-2739-4b6a-8f78-dc4a936d5861"
}

Last updated