Docs

Send one or several messages

Send one or several messages through agrirouter to other endpoints, with automatic chunking for large payloads.

Send one or several messages through agrirouter to other endpoints. The payload goes in the request body as a binary stream. If it exceeds the internal chunk size, agrirouter splits it for you, so the client does not need to chunk on its own. Every delivered message lands in the feed of each recipient that a route points to.

POST
/messages

Authorization

AuthorizationBearer <token>

Agrirouter OAuth2 authentication for QA environment.

In: header

Header Parameters

content-length*integer

The size of the complete payload in bytes. This is used to determine if the payload needs to be split into chunks and how.

Formatint64
x-agrirouter-is-publish*boolean

If set to true, the message will be sent as a published message and any endpoints that are subscribed to the message type would be able to receive it, provided other conditions for routing are met.

x-agrirouter-direct-recipients?array<>

Comma-separated list of agrirouter endpoint IDs of the direct recipients. Allows specifying direct recipients of the message, which could receive it even if they are not subscribed to the message type.

x-agrirouter-sent-timestamp*string

Client side timestamp of sending the data.

Formatdate-time
x-agrirouter-endpoint-id*string

The agrirouter endpoint ID of the sender. This is the ID of the endpoint that is sending the message.

Formatuuid
x-agrirouter-teamset-context-id?string

A teamset is a set of connected machines that work and move together and are connected to the same (virtual) communication unit. The machines in the teamset are typically connected physically and informationally (for example via ISOBUS).

Lengthlength <= 100
x-agrirouter-message-type*string

Message type of the sent data. See available types here: https://docs.agrirouter.com/agrirouter-interface-documentation/latest/tmt/overview.html

Lengthlength <= 100
x-agrirouter-tenant-id*string

The farmer's tenant ID in relation to which communication is done.

Formatuuid
x-agrirouter-context-id*string

Application side identifier of the sent data. agrirouter will use this to generate application message id and also will pass it on as chunk context id in case if the payload had to be split into several messages. This has to be generated by the application and be unique for every sent payload. Applications may want to reuse the same id in case if they are resending the same payload again, when f.e retrying after a failure.

Lengthlength <= 50
x-agrirouter-filename?string

Optional name of the file that is attached to messages as metadata.

Lengthlength <= 100

Request Body

application/octet-stream

TypeScript Definitions

Use the request body type in TypeScript.

body*file
Formatbinary

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.agrirouter.com/messages" \  -H "content-length: 0" \  -H "x-agrirouter-is-publish: true" \  -H "x-agrirouter-sent-timestamp: 2019-08-24T14:15:22Z" \  -H "x-agrirouter-endpoint-id: 497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "x-agrirouter-message-type: iso:11783:-10:device_description:protobuf" \  -H "x-agrirouter-tenant-id: 497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "x-agrirouter-context-id: string" \  -H "Content-Type: application/octet-stream" \  -d 'string'
Empty