Skip to content

HTTP Mode

Identified with the label

HTTP
, the HTTP Mode of Layrz Protocol is designed for 100% reliable communication over the internet using the HTTP protocol. This mode is particularly useful for applications that require a robust and secure connection, but not necessarily real-time communication.

Features

  • Reliable Connection: I mean, It's HTTP, so it ensures that all packets are delivered without loss.
  • Security: HTTP can be secured using HTTPS, providing encryption and authentication.
  • Compatibility: HTTP is widely supported and can be easily integrated with existing web services and APIs.

Disadvantages

  • Latency: HTTP is not designed for real-time communication, so it may introduce some latency compared to TCP.

HTTP endpoints

POST /v2/message

Register a new message to the server.

Headers

HeaderValueDescription
Content-Typetext/plainThe content type of the message.
AuthorizationLayrzAuth {IDENT};{PASSWORD}The ident and password of the device.

Body

Any of Pb, Pc, Pd, Pi, Pm, Po, Pr or Ps

Response

Any of Ab, Ao, Ac or Ar

POST /v2/image/{FILENAME}
Deprecated on v2.7.0

Upload an image to the server.

Deprecated on v2.7.0
in favor of the Pm packet.

Path Parameters

ParameterTypeDescription
FILENAMEstringThe name of the file to upload. This should be a valid filename, without the extension.

Headers

HeaderValueDescription
Content-Typeimage/jpegThe content type of the image.
AuthorizationLayrzAuth {IDENT};{PASSWORD}The ident and password of the device.

Body

The base64 encoded image data, with the content type included in the base64 string.

data:image/jpeg;base64,...

Response

Any of Ao, Ac or Ar

GET /v2/commands

Get the command queue of the device.

Headers

HeaderValueDescription
Content-Typeapplication/jsonThe content type of the request.
AuthorizationLayrzAuth {IDENT};{PASSWORD}The ident and password of the device.

Response

Any of Ao, Ac or Ar

POST /v2/commands
Removed on v2.3.0

Register a command ACK to the server.

Headers

HeaderValueDescription
Content-Typeapplication/jsonThe content type of the request.
AuthorizationLayrzAuth {IDENT};{PASSWORD}The ident and password of the device.

Body

Exactly the Pc packet.

Response

Any of Ao, Ac or Ar

GET /v2/ble
Added on v2.5.0
Deprecated on v2.7.0

Gets the available BLE devices that can be sniffed by the device.

Deprecated on v2.7.0
in favor of the Pr packet.

Headers

HeaderValueDescription
Content-Typeapplication/jsonThe content type of the request.
AuthorizationLayrzAuth {IDENT};{PASSWORD}The ident and password of the device.

Response

Any of Ab, Ao, Ac or Ar