Making your first query

Now that you have obtained an access_token from the Authentication step, we are ready to make our first request. Here is an example of a request with authorization to our GraphQL API to obtain sensors data.

Authorization in Header

{"Authorization": "Bearer [access_token]"}

GraphQL Query

query MyFirstQuery {
  sensors {
      data {
          client_id
          floor_id
          room_id
          hive_id
          hive_serial
          sensor_id
          name
          mac_address
          mode
          model
          sensitivity
          center
          height
          orientation
          field_of_view
      }
  }
}

Code Examples

curl --location 'https://api.butlr.io/api/v3/graphql' \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer [insert access_token here]' \
--data '{"query":"query MyFirstQuery {\n  sensors {\n      data {\n          client_id\n          floor_id\n          room_id\n          hive_id\n          hive_serial\n\n          sensor_id\n          name\n          mac_address\n          mode\n          model\n          sensitivity\n          center\n          height\n          orientation\n          field_of_view\n      }\n  }\n}","variables":{}}'

Last updated