M2M Authorization
Sometimes a machine or application needs to talk to UpBlue directly, without a person logging in: a custom script that pushes measurements, an external system that delivers data. This machine-to-machine (M2M) access works with service users and tokens.
For collecting machine data, you rarely need this. The Collector, Cloud Connections and UpBlue Connect handle their own authorization. M2M tokens are for your own custom integrations.
Setting up M2M access
Create a service user
Create a service user on the tenant User management page.
Give it access
Add the service user to the organisation it should write to, and give it the User can insert right.
Create a token
Go to the Token page (menu top right).
The token is displayed once. Store it somewhere safe.
Advice: one token per integration. If a token is compromised, delete it — then only that one integration needs a new token.
To revoke access, delete the token.
Inserting data
With the token, data can be pushed to the insert API. Data is sent in the Influx line protocol format: the tag name, labels, a value and a timestamp per line — the same building blocks as everywhere in UpBlue.
POST https://stream.upblue.io/v1/{organisation_uuid}/iflp
Authorization: Bearer <token>
Content-Type: text/plain
temperature,Site=Factory1,Area=Hall1 value=21.2 1757500000000000000A successful insert returns HTTP 204. The inserted data appears as normal tags, ready for dashboards and alerts.
Just want an external system to deliver data, without building anything? A Webhook connection is simpler: UpBlue gives you a URL, the system posts to it.