LogoLogo
DocsTermsPrivacyStatus
  • 😊Introduzione
  • CONCETTI GENERALI
    • Dispositivo
    • Prodotto
    • Utenti
    • Organizzazione
  • TRACKLE LIBRARY
    • Panoramica
    • Primo utilizzo
    • Configurazione
    • Funzionalità cloud
    • Aggiornamenti OTA
    • Diagnostica
  • TRACKLE CLOUD
    • Panoramica
    • Cloud API
      • Limiti alle richieste
      • Autenticazione
      • Client OAuth
      • Dispositivi
      • Eventi
    • Integrazioni
    • Aggiornamenti firmware OTA
    • Sicurezza
Powered by GitBook
On this page
  • Ottieni un flusso di eventi pubblici
  • Ottieni un flusso di eventi dei tuoi dispositivi
  • Ottieni un flusso di eventi per un dispositivo
  • Ottieni un flusso di eventi di un prodotto
  • Ottieni un flusso di eventi di un dispositivo parte di un prodotto
  • Pubblica un evento
  • Pubblica un evento per un prodotto

Was this helpful?

  1. TRACKLE CLOUD
  2. Cloud API

Eventi

PreviousDispositiviNextIntegrazioni

Last updated 1 year ago

Was this helpful?

I Dispositivi inviano eventi al Cloud ogni volta che si connettono e ogni volta che viene chiamato Trackle.publish(). E' possibile ricevere gli eventi dei dispositivi attraverso una tecnologia che sfrutta un flusso di dati HTTP chiamata .

Puoi filtrare gli eventi da ricevere specificando un eventName. Gli eventi ricevuti saranno limitati a quelli con il filtro specificato. Per esempio specificando il nome evento temp saranno ricevuti tutti gli eventi il cui nome inizia con temp.

Ottieni un flusso di eventi pubblici

GET https://api.trackle.io/v1/events/[:eventName]

Open a stream of Server Sent Events for all public events.

Path Parameters

Name
Type
Description

eventPrefix

string

Filters the stream to only events starting with the specified prefix. Omit to get all events.

:ok

event: temperature
data: {"data":"25.34","ttl":"60","published_at":"2015-07-18T00:12:18.174Z","coreid":"0123456789abcdef0123456

Ottieni un flusso di eventi dei tuoi dispositivi

GET https://api.trackle.io/v1/devices/events/[:eventName]

Open a stream of Server Sent Events for all public and private events for your devices.

Path Parameters

Name
Type
Description

eventPrefix

string

Filters the stream to only events starting with the specified prefix. Omit to get all events.

:ok

event: temperature
data: {"data":"25.34","ttl":"60","published_at":"2015-07-18T00:12:18.174Z","coreid":"0123456789abcdef0123456

Ottieni un flusso di eventi per un dispositivo

GET https://api.trackle.io/v1/devices/:deviceID/events/[:eventName]

Open a stream of Server Sent Events for all public and private events for the specified device.

Path Parameters

Name
Type
Description

deviceID

string

Device ID

eventPrefix

string

Filters the stream to only events starting with the specified prefix. Omit to get all events.

:ok

event: temperature
data: {"data":"25.34","ttl":"60","published_at":"2015-07-18T00:12:18.174Z","coreid":"0123456789abcdef01234567"}

Ottieni un flusso di eventi di un prodotto

GET https://api.trackle.io/v1/products/:productIdOrSlug/devices/events/[:eventName]

Open a stream of Server Sent Events for all public and private events for a product.

Path Parameters

Name
Type
Description

productIdOrSlug

string

Product ID or Slug

eventPrefix

string

Filters the stream to only events starting with the specified prefix. Omit to get all events

:ok

event: temperature
data: {"data":"25.34","ttl":"60","published_at":"2015-07-18T00:12:18.174Z","coreid":"0123456789abcdef01234567"}

Ottieni un flusso di eventi di un dispositivo parte di un prodotto

GET https://api.trackle.io/v1/products/:productIdOrSlug/devices/:deviceID/events/[:eventName]

Open a stream of Server Sent Events scoped to a particular device in a product

Path Parameters

Name
Type
Description

productIdOrSlug

string

Product ID or Slug

deviceID

string

Device ID

eventPrefix

string

Filters the stream to only events starting with the specified prefix. Omit to get all events

:ok

event: temperature
data: {"data":"25.34","ttl":"60","published_at":"2015-07-18T00:12:18.174Z","coreid":"0123456789abcdef01234567"}

Pubblica un evento

POST https://api.trackle.io/v1/devices/events

Publish an event to your devices stream.

Request Body

Name
Type
Description

name

string

Event name

data

string

Event data. Limited to a maximum of 622 bytes

private

boolean

Private or public

{
  "ok": true
}
{
  "error": "name not provided",
  "ok": false
}

Pubblica un evento per un prodotto

POST https://api.trackle.io/v1/products/:productIdOrSlug/events

Publish an event that is sent to the product's event stream.

Path Parameters

Name
Type
Description

productIdOrSlug

string

Product ID or Slug

Request Body

Name
Type
Description

name

string

Event name

data

string

Event data. Limited to a maximum of 622 bytes

private

boolean

Private or public

{
  "ok": true
}
{
  "error": "name not provided",
  "ok": false
}
{
  "error": "Product does not exist",
  "ok": false
}
Server-Sent Events (SSEs)