Utilizing the Tago.io connector, you can query against the device datapoints logged on the Tago.io network. Since Tago.io is a platform, the types of results you can retrieve cross a wide variety of possible scenarios. As such, our example code will not show a specific use case, but rather show how to locate the different things and points associated specifically with the Tago connector as a whole.
As noted, potential use cases cover pretty much any kind of sensor Tago supports, which include:
Credential | Description |
---|---|
Profile Token | You will need your profile token generated from the Tago.io dashboard, located under Profiles and then the Token tab |
Connector Concept | Mapped Type |
---|---|
Device | Device |
Device Data | Point |
This sample, unlike those in most of the other connector docs, is going to start actually at the connectors level, rather than a thing or point. The following example filters by a specific connector ID (which you can find in the URL for the connector when editing it in the UI, or by making a call to connectors without a filter and looking for the id field) and then retrieves the things and points associated with that connector. We also included the state and updated fields, so you can see the connector is ACTIVE and the last time it was updated.
Request ResponseCopy1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
{ connectors(filter: {id: {eq: "CONTgu8VfdJHEpEbpCaTKAbcD"}}) { id name state updated things { id name exactType points { id name exactType series(latest: true) { timestamp value { float64Value } } } } } }
The example response has pretty generic labeling; in a real world scenario, the types would be more detailed depending on the sensor connected to Tago, and the details it feeds into the Tago database for us to retrieve.