NAV
Https

Aura Rest API

Use our featured API to manage and control your organization's Aura Air devices in real time and enable third party integrations with Building Management Systems or other services.

The Aura API is organized around REST and uses HTTP verbs and response codes. All requests must be formatted as Content-Type: application/JSON (except where noted). All responses are also formatted JSON, encoded in the UTF-8 character encoding (Content-Type: application/JSON; charset=utf-8).

Security

The Aura API uses the API key security. Each key is generated by Aura, please contact support for API access. Each key given will be a refference to a specific owner of an organization and will give access to all the endpoints and the functionalities of the Aura API for your organization.
The API key must be passed in the Headers of each request as shown below:

Authorization: Bearer API_KEY

Base URL : https://aura-b2b-rest.web.app

API Update Guidelines

The Aura API is updated frequently with new features and improvements. These updates ensure that the API evolves with customer and industry demands. Managing this change to ensure we provide a reliable, consistent, and backward compatible API design is a critical challenge for our team. Every new and improved feature is put through a peer-review process to ensure it will not change an existing resource to the extent that it breaks current customer implementations, and that it is consistent with existing resources (therefore, predictable and easy to use).

API Usage

The number of calls you can make to the Aura API is limited. This limitation is related to the number of devices paid for accessing the API.
If you excceed your limit, our team will contact you to upgrade your subscription.
You can verify your current daily usage of the API by checking the following keys in the Headers

Header value
X-CALLS The number of calls you made on this day
X-CALL-RESET-SECONDS The number of seconds before the reset of the daily api usage
X-CALL-LIMIT The limit of calls you can perform per day

Developer Keys

Please contact our customer service team to sign up for a developer key and begin using our API today.

Locations

A location is one of the base entity of your organization that can contain many devices , groups , or floors

Add a Location

Body

  {
  "address" : "Sderot Rothschild 45",
  "city" : "Tel AViv",
  "name" : "Home",
  "state" : "Israel",
  "zipcode" : "86521"
}

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

  {
    "status": "sucess",
    "message": "Created a new location",
    "newId": "-hrkiyEWBMqnreiZMHO"
} 

To create a location you will need the following keys:

key value
address (string)
city (string)
name (string)
state (string)
zipcode (string)

HTTP Request

POST https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/locations

parameter value
orgId your organization Id

Get All Locations

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "data": {
        "-Lp2LeDOb8SdpqYU1Wpw12": {
            "_id": "-Lp2LeDOb8SdpqYU1Wpw12",
            "address": "Hamiphras 6",
            "altitude": 0,
            "aura_daily_report": "true",
            "bad_aqi_event": false,
            "city": "Yavne",
            "components": {
                "administrative_area": "Merkaz",
                "country_iso_3": "ISR",
                "locality": "Yavne",
                "postal_code": "81000",
                "postal_code_short": "81000",
                "premise": "6",
                "premise_number": "6",
                "sub_administrative_area": "Rehovot",
                "thoroughfare": "Hamifras",
                "thoroughfare_name": "Hamiphras"
            },
            "created_at": 1577098253453,
            "last_modified": 1577098253453,
            "latitude": 31.86777,
            "longitude": 34.733457,
            "name": "Building 2",
            "state": "Israel",
            "zipcode": "8101306"
        },
        "-M7qh60FjNWsDVfEuD6Z": {
            "_id": "-M7qh60FjNWsDVfEuD6Z",
            "address": "Saknai 4",
            "aura_daily_report": true,
            "city": "hod hasharon",
            "components": {
                "ISO_3166-1_alpha-2": "US",
                "ISO_3166-1_alpha-3": "USA",
                "_category": "place",
                "_type": "village",
                "continent": "North America",
                "country": "United States of America",
                "country_code": "us",
                "country_iso_3": "USA",
                "county": "Maricopa County",
                "hamlet": "Kaka",
                "state": "Arizona",
                "state_code": "AZ"
            },
            "created_at": 1590055694668,
            "is_shared": false,
            "last_modified": "2020-07-09T09:00:13.914Z",
            "latitude": 32.1420858,
            "longitude": 34.8918504,
            "name": "Aura Office",
            "state": "israel",
            "zipcode": "453535"
        }
    }
}

Retrieve all locations under organization
the data is an object and each key/vallue is a location.
For more information on the location object go to the Get a single location by ID endpoint.

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/locations

parameter value
orgId your organization Id

Get a Specific Location

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "data": {
        "_id": "-Lp2LeDOb8SdpqYU1Wpw12",
        "address": "Hamiphras 6",
        "altitude": 0,
        "aura_daily_report": "true",
        "bad_aqi_event": false,
        "city": "Yavne",
        "components": {
            "administrative_area": "Merkaz",
            "country_iso_3": "ISR",
            "locality": "Yavne",
            "postal_code": "81000",
            "postal_code_short": "81000",
            "premise": "6",
            "premise_number": "6",
            "sub_administrative_area": "Rehovot",
            "thoroughfare": "Hamifras",
            "thoroughfare_name": "Hamiphras"
        },
        "created_at": 1577098253453,
        "last_modified": 1577098253453,
        "latitude": 31.86777,
        "longitude": 34.733457,
        "name": "Building 2",
        "state": "Israel",
        "zipcode": "8101306"
    }
}

get a specific location under organization
minimum data obtained :

key value
_id (unique string)
address (string)
city (string)
created_at (ISO date string)
last_modified (ISO date string)
latitude and longitude (float numbers)
name (unique string among locations)
state (string)
zipcode (string)
components (object more information on the location)

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/locations/{{locationId}}

parameter value
orgId your organization Id
locationId The location Id you want to retrieve

Update a Specific Location

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body

  {   
    "state":"Israel",
    "zipcode":"86953",
    "city":"Tel Aviv",
    "address":"4 Sderot Rothschild"
}

Response

{
    "status": "success",
    "data": {
        "state": "Israel",
        "zipcode": "86953",
        "city": "Tel Aviv",
        "address": "4 Sderot Rothschild"
    }
}

Update a specific key of a specific location under organization:
To update the address, provide the city, state, and the zipcode. Meaning you can pass 3 differents objects with the following keys:

Note that two locations cannot have the same name and cannot contain the same address details.

HTTP REQUEST

PATCH https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/locations/{{locationId}}

parameter value
orgId your organization Id
locationId the location Id you want to update

Delete a Specific Location

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "message": "location deleted",
    "locationId": "-Lp2LeDOb8SdpqYU1Wpw12"
}

Delete a location by its ID. The organization must be the owner of the location.

HTTP REQUEST

DELETE https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/locations/{{locationId}}

parameter value
orgId your organization Id
locationId the location Id you want to delete

Floors

A floor in an entity of your organization that exist under a location.
A floor can contain many devices

Add a Floor

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body

{
    "name":"floor 1",
    "locationId":"-awmagoeQTSlyvdcvrrEQPIQHFT",
    "reminderDay":1
}

Response

{
    "status": "success",
    "message": "Created a new Floor",
    "locationId": "-ntdrloKTWKHifxfpXPJFKEDB"
}

This endpoint lets you create a floor
Data needed :

key value
name (must be unique among the floors)
locationId (must exists under your organization)
reminderDay (a number representing the day of the month when you want a reminder to clean the prefilter it must be 1,5,10 or 15)

Two floors cannot have the same name.

HTTP REQUEST

POST
https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/floors
parameter value
orgId your organization Id

Get All Floors

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "data": {
        "-M8tVY8qZaSrXtrUzG80": {
            "_id": "-M8tVY8qZaSrXtrUzG80",
            "created_at": "2020-06-03T09:27:55.319Z",
            "last_modified": "2020-06-03T09:27:55.319Z",
            "locationId": "null",
            "name": "floor ne",
            "reminderDay": "1"
        },
        "-MAQ4XeE2mdDkDmq2bva": {
            "_id": "-MAQ4XeE2mdDkDmq2bva",
            "created_at": "2020-06-22T08:12:42.549Z",
            "last_modified": "2020-06-22T08:12:42.549Z",
            "locationId": "null",
            "name": "floor 2",
            "reminderDay": "1"
        }
    }
}

Retrieve all floors under an organization.
If you want more details on the floor object go to the Get a single floor by ID endpoint.

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/floors

parameter value
orgId your organization Id

Get a Specific Floor

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "data": {
        "_id": "-M8tVY8qZaSrXtrUzG80",
        "created_at": "2020-06-03T09:27:55.319Z",
        "last_modified": "2020-06-03T09:27:55.319Z",
        "locationId": "null",
        "name": "floor ne",
        "reminderDay": "1"
    }
}

Get a floor by its ID.
The received object will have the folowing keys :

key value
_id string , the id of the floor
created_at ISO string date , date of creation of the floor
last_modified ISO string date , last update of the floor
locationId unique string , the location of the floor
name string , unique among floor under the sane location
reminderDay integer , day of the month to clean the pre_filter of the devices , can be 1 , 5 , 10 or 15

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/floors/{{floorId}}

parameter value
orgId your organization Id
floorId the floor Id you want to update

Update a Specific Floor

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body

{
    "name":"floor 9"
}

Response

{
    "status": "success",
    "data": {
        "name": "floor 9"
    }
}

Update a floor under a specific organization. The keys you can update are :

key value
name (must be unique among the floors)
reminderDay (a number representing the day of the month when you want a reminder to clean the prefilter. Must be 1, 5, 10, or 15)

Note that two floors cannot have the same name.

HTTP REQUEST

PATCH https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/floors/{{floorId}}

parameter value
orgId your organization Id
floorId the floor Id you want to update

Delete a Specific Floor

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "message": "floor has been deleted",
    "floorId": "-M8tVY8qZaSrXtrUzG80"
}

Delete an existing floor from your organization.
Note that all the devices under this floor will have a null floorId value.

HTTP REQUEST

DELETE https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/floors/{{floorId}}

parameter value
orgId your organization Id
floorId the floor Id you want to delete

Groups

A group is an entity of your organization that exists under a location.
A group can contain many devices. The main difference between a group and a floor is that the group can be linked to a rule.

Add a Group

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body

{
    "locationId":"-awmagoeQTSlyvdcvrrEQPIQHFT",
    "name": "test322"
}

Response

{
    "status": "success",
    "message": "Created a new Group",
    "data": {
        "groupId": "-levreaJYHSAKvntwbnuGCLROV",
        "name": "test322",
        "locationId": "-awmagoeQTSlyvdcvrrEQPIQHFT"
    }
}

This endpoint lets you create a new group.
Data needed:

key value
locationId (string relative to an existing location in your organization)
name (unique string among the groups)

Note that the locationId used must be under your organization.
Two groups cannot have the same name.

HTTP REQUEST

POST https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/groups

parameter value
orgId your organization Id

Get All Groups

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "data": {
        "-M8tcHwxWOGJtVAZI14G": {
            "_id": "-M8tcHwxWOGJtVAZI14G",
            "created_at": "2020-06-03T10:01:46.121Z",
            "last_modified": "2020-06-03T10:01:46.121Z",
            "locationId": "-Lp2LeDOb8SdpqYU1Wpw13",
            "name": "ee"
        },
        "-M8tcM-nKe7HmX9tcuch": {
            "_id": "-M8tcM-nKe7HmX9tcuch",
            "created_at": "2020-06-03T10:02:02.752Z",
            "last_modified": "2020-06-03T10:02:02.752Z",
            "locationId": "null",
            "name": "build2"
        },
        "-M8tcVdtAlnqpHljBiVq": {
            "_id": "-M8tcVdtAlnqpHljBiVq",
            "created_at": "2020-06-03T10:02:42.246Z",
            "last_modified": "2020-06-03T10:02:51.571Z",
            "locationId": "-Lp2LeDOb8SdpqYU1Wpw12",
            "name": "build123"
        }   
      }
}

Retrieve a list of all groups under your organization.
Go to get a single group by ID endpoint to get more information on the structure of the group object.

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/groups

parameter value
orgId your organization Id

Get a Specific Group

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "data": {
        "_id": "-M8tcHwxWOGJtVAZI14G",
        "created_at": "2020-06-03T10:01:46.121Z",
        "last_modified": "2020-06-03T10:01:46.121Z",
        "locationId": "-Lp2LeDOb8SdpqYU1Wpw13",
        "name": "ee"
    }
}

Get a single group by its ID under your organization.
Data obtained:

key value
_id (a unique string)
created_at (ISO string date)
last_modified (ISO string date)
locationId (string , unique , related to a specific location of your organization)
name (unique string among your groups)
ruleId (optionnal) the rule the froup is linked to , for more information on the rule go to the Rules section

Note that the group must be under your organization if you want to access it.

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/groups/{{groupId}}

parameter value
orgId your organization Id
groupId the group Id you want to get

Update a Specific Group

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body

{
    "name":"best group in the world"
}

Response

{
    "status": "succes",
    "message": "group updated",
    "data": {
        "groupId": "-M8tcHwxWOGJtVAZI14G",
        "group": {
            "name": "the best name",
            "last_modified": "2020-08-25T08:40:19.688Z"
        }
    }
}

Update keys of a single group
Key to update:

key value
name (unique string among groups)

HTTP REQUEST

PATCH https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/groups/{{groupId}}

parameter value
orgId your organization Id
groupId the groupId you want to update

Delete a Specific Group

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "message": "group deleted",
    "data": {
        "groupId": "ooxyyZz2"
    }
}

This endpoint lets you delete a group by its ID.
Note that all the devices under this group will have a value null to the key groupId and ruleId

HTTP REQUEST

DELETE https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/groups/{{groupId}}

parameter value
orgId your organization Id
groupId the group Id you want to delete

Devices

A Device can be connected to your organization through the Aura Business App and is most of the time under a location.
A device can also be at the same time under a group of this location and a floor of this location.

Get All Devices

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "data": {
        "1f002e000a47363433353735": {
            "_id": "1f002e000a47363433353735",
            "created_at": "2020-05-14T09:22:58.431Z",
            "filter_due_date": "2020-10-14T09:22:58.431Z",
            "floorId": "-M8op_BSEnPr4ccQoITD",
            "groupId": "-M8tcVdtAlnqpHljBiVq",
            "last_modified": "2020-06-07T12:29:54.303Z",
            "locationId": "-Lp2LeDOb8SdpqYU1Wpw12",
            "room": "Living Room"
        },
        "25002e001147383531363134": {
            "_id": "25002e001147383531363134",
            "created_at": "2020-05-14T09:22:58.431Z",
            "filter_due_date": "2020-10-14T09:22:58.431Z",
            "floorId": "-M8opVbcMkKAXZGCJt2l",
            "groupId": "ooxyyZz1",
            "last_modified": "2020-06-04T10:42:53.289Z",
            "locationId": "-Lp2LeDOb8SdpqYU1Wpw",
            "room": "Conference Room roei"
        }
    },
    "next":"IBHSOWB9879GB"
}

Retrieve a list of devices under your organization.
If you want more details on the device object go to the get a single devide by ID endpoint.

This endpoint supports pagination, you can send it the following optional queries:

Query value
limit the maximum number of devices you want to retrieve
index the index of the page you want to get

Every request will send back a key next if there are more results than the ones sent, this value is the index to use in the next request.

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/devices

parameter value
orgId your organization Id

Get a Specific Device

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "data": {
            "_id" : "1d002a000847393039353939",
            "checked" : false,
            "created_at" : 1609846679642,
            "filter_due_date" : "2021-07-05T10:37:59.903Z",
            "floorId" : "-MQSC-a0mTkO_l8OR3FE",
            "groupId" : "-MQHDZ7lpYu0GVPO1n8I",
            "last_modified" : "2021-01-07T14:16:41.211Z",
            "locationId" : "-MQHARok5OezOXzu-pd3",
            "mode" : {
              "current_mode" : "auto",
              "scheduler" : {
                "high" : {
                  "end" : "07:30",
                  "start" : "05:00"
                },
                "low" : {
                  "end" : "19:00",
                  "start" : "07:31"
                }
              }
            },
            "room" : "QA W",
            "ssid" : "Cymotive-Guests "
    }
}

Get a single device by its ID.
Data obtained:

key value
_id (unique string)
created_at (ISO string)
filter_due_date (ISO string , a date HTTP REQUESTed to the moment you will have to replace the filter)
floorId (The string id of an existing floor of your organization)
groupId (The string id of an existing group of your organization)
last_modified (ISO string)
locationId (The string id of an existing location of your organization)
room (similar to a name , except it is not unique)
ruleId optional , string , the rule that is link to the group of the device
mode.scheduler the scheduler object as defined in the get scheduler endpoint
mode.current_mode The default mode of the device go to the set device mode endpoint for more details
ssid the wifi name the device is connected to

To get the rule linked to the device, use the get rule linked to a specific device endpoint. * Needs an API key

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/devices/{{deviceId}}

parameter value
orgId your organization Id
deviceId the device id you want to get

Update a Specific Device

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body

{
    "room": "Living Room"
}

Response

{
    "status": "success",
    "message": "device updated",
    "data": {
        "deviceId": "3b002c001047383531363134",
        "info": {
            "status": true,
            "message": "Data updated succesfully!"
        }
    }
}

Update keys of a device:
Here is a list of the keys you can update :

key value
floorId (unique string of a floor that must be under your organization)
groupId (unique string of a group that must be under your organization)
locationId (unique string of a location that must be under your organization)
room (a string same as a namen , except two device can have tha same room under your organization)

Note that :

HTTP REQUEST

PATCH https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/devices/{{deviceId}}

parameter value
orgId your organization Id
deviceId the device Id you want to update

Get Sensor Data of a specific Device

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "succes",
    "data": {
        "aqi": {
            "value": 0
        },
        "pm10": {
            "value": 8,
            "units": "µg/m3"
        },
        "pm25": {
            "value": 0,
            "units": "µg/m3"
        },
        "co": {
            "value": 0.8,
            "units": "ppm"
        },
        "humidity": {
            "value": 45.8,
            "units": "%"
        },
        "temperature": {
            "value": 26,
            "units": "C"
        },
        "co2": {
            "value": 417,
            "units": "ppm"
        },
        "voc": {
            "value": 38,
            "units": "ppb"
        }
    }
}

Get the device sensor data at the actual moment by it id
Here is a list of sensor :

sensor unit
AQI (Air Quality index a value between 0 and 500 , better when it's less)
pm10 ( big particles ug/m3)
pm25 (bigger particle ug/m3)
co (carbon monoxyde ppm)
humidity (in percentage)
temperature (in °C)
co2 (in ppm)
voc (organic component in ppb)

You can pass a list of sensor (separated by a coma) in the query sensor to get only specific sensors
If you don't pass any query the server will sent you all the sensor information

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/devices/{{deviceId}}/sensors

parameter value
orgId your organization Id
deviceId the device Id you want to get the sensor
query value
sensor (optional) list of sensors you want to get the value off

Get Sensor History Data of a specific Device

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Success",
    "data": [
        {
            "pm10": {
                "value": 9,
                "units": "µg/m3"
            },
            ...
            "publised_at": "2021-05-23T14:27:52.716Z"
        },
        {
            "pm10": {
                "value": 14,
                "units": "µg/m3"
            },
            ...
            "publised_at": "2021-05-23T15:30:55.247Z"
        },
        ...
    ]
}

This endpoint let you get an history of all the sensors values between two dates with a specific interval :

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/devices/{{deviceId}}/sensors/history

parameter value
orgId your organization Id
deviceId the device Id you want to get the sensor
query value
start_date ISO string date , start date of the report
end_date ISO string date , end date of the report
interval interval between two report (can be 1h: 1 hour, 30m: 30 minutes, 15m: 15 minutes, 5m: 5 minutes)
sensors (optional) a coma separated list of the sensors you want to retrieve , if not given all the sensors will be sent
timezone (optional), a integer between -12 and 13 the timezone you want to get the report in , if not given the utc time will be used

Set Device Default Mode

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "message": "The mode was updated",
    "data": {
        "mode": "high",
        "deviceId": "25002e001147383531363134"
    }
}

Set device mode (call firmware setSystemMode):
The mode passed as a parameter can be

Auto mode will just stop the high mode , the low mode or the silent mode.
If you want to set the night mode you will have to use the set scheduler endpoint

Note that :

HTTP REQUEST

POST https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/devices/{{deviceId}}/mode/{{mode}}

parameter value
orgId your organization Id
deviceId the device Id you want to get the sensor
mode the mode you want to set the device in (can be high/low/auto)

Get Device Mode

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Success",
    "data": {
        "actualMode": "night",
        "isSchedulerActive": true
    }
}

Give you the ability to get the current mode
There is 5 different modes :

Check set device mode and set scheduler endpoint to get more information about the modes

The answer will be in the data key and will contain the following keys :

key value
actualMode The actual mode of the device is in right now.
isSchedulerActive true if the scheduler was set in the other case false
defaultMode the mode that the device will take when the scheduler end if it's active , the actualMode and the defaultMode will be the same if the scheduler is inactive

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/devices/{{deviceId}}/mode

parameter value
orgId your organization Id
deviceId the device Id you want to get the mode

Set Device Scheduler

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body Example #1

{
    "high":{
        "start":"09:00",
        "end":"12:00"
    },
     "low":{
        "start":"15:00",
        "end":"18:00"
    },
    "night":{
        "start":"18:00",
        "end":"22:00"
    },
    "silent":{
        "start":"22:30",
        "end":"23:30"
    }
}

Body Example #2

{
      "high":{
        "start":"09:00",
        "end":"12:00"
    },
     "low":{
        "start":"15:00",
        "end":"18:00"
    },
    "night":{
        "start":"22:00",
        "end":"06:00"
    }
}

Body Example #3

{
    "high":{
        "start":"01:00",
        "end":"07:00"
    },
     "low":{
        "start":"18:00",
        "end":"00:00"
    }
}

Response

  {
    "status": "Success",
    "data": {
        "actualMode": "night",
        "isSchedulerActive": true
    }
  }

Give you the ability to set the scheduler for a specific device of your organization
The scheduler let you define mode scheduling , it means that for each mode you will be able to select a time frame where this mode during the day
The scheduler can be applied on the following mode :

If you want to be sure that your scheduler will work on the timezone you want you can send an additionnal query parmeter timezone with the value of the timezone you want to apply ( a number between -12 and 14) , Be careful the timezone of your device will be updated with this new value

You have to send in the body an object with a key for each mode you want to define (see the body example #1)
Inside each mode the following keys are needed :

key value
start the start time of the mode HH:mm
end the end time of the mode in format HH:mm

Note that :

HTTP REQUEST

POST https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/devices/{{deviceId}}/scheduler

parameter value
orgId your organization Id
deviceId the device Id you want to set the scheduler
query value
timezone (optionnal) The timezone to apply on the device : a integer between -12 and 12

Get Device Scheduler

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
      "high":{
        "start":"09:00",
        "end":"12:00"
    },
     "low":{
        "start":"15:00",
        "end":"18:00"
    },
    "night":{
        "start":"22:00",
        "end":"06:00"
    }
}

Give you the ability to get the current scheduler of a specific device
To learn more on what is a scheduler go to the set scheduler endpoint
The object that is returned in the response is the same as the one that have to be sent in the set scheduler endpoint Each key is a mode name and each mode contains the following keys :

key value
start the start time of the mode HH:mm
end the end time of the mode in format HH:mm

Check set device default mode and set scheduler endpoint to get more information about the modes

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/devices/{{deviceId}}/scheduler

parameter value
orgId your organization Id
deviceId the device Id you want to get the scheduler

Delete Device Scheduler

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "message": "The scheduler was deleted",
    "data": {
        "body": {}
    }
}

Give you the ability to delete a scheduler that was set on a specific device

Not that : * If a mode of the scheduler was active when you delete it the device will switch to default mode * If any scheduler is set the endpoint will not send back an error

HTTP REQUEST

DELETE https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/devices/{{deviceId}}/scheduler

parameter value
orgId your organization Id
deviceId the device Id you want to get the scheduler

Set Device Timezone

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Configured successfully",
    "message": "Time zone has been set to - (-2)",
    "data": {
        "device": "3b002c001047383531363134",
        "timezone": -2
    }
}

Set device timezone (call firmware setTimeZone)
The timezone prameter must be a integer number between -12 and 13

HTTP REQUEST

POST https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/devices/{{deviceId}}/timezone/{{timezone}}

parameter value
orgId your organization Id
deviceId the device Id you want to get the sensor
timezone the mode you want to set the timezone in (can be an integer between -12 and 13)

Get the ssid of a specific device

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Configured successfully",
    "message": {
        "cmd": "VarReturn",
        "name": "SSID",
        "result": "Highroad",
        "coreInfo": {
            "name": "NS20220077",
            "last_heard": "2020-09-15T09:39:24.086Z",
            "connected": true,
            "last_handshake_at": "2020-09-14T15:09:55.470Z",
            "deviceID": "25002e001147383531363134",
            "product_id": 9494
        }
    },
    "device": "25002e001147383531363134"
}

Give the ability to access the ssid of a specific device
Meaning releavant information on the wifi setting of the device

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/devices/{{deviceId}}/ssid

parameter value
orgId your organization Id
deviceId the device Id you want to get the ssid

Set Led indication on a specific device

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Configured successfully",
    "message": "Led is now  - (on)",
    "data": {
        "device": "25002e001147383531363134"
    }
}

Give the ability to turn on or off the led of a specific device
In the url you have to pass the parameter on or off

HTTP REQUEST

POST https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/devices/{{deviceId}}/switchLed/{{state}}

parameter value
orgId your organization Id
deviceId the device Id you want to change the led state
state the new state of the led (on or off)

Set device ssid

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body

{
    "ssid_name":"Highroad",
    "ssid_password":"*******"
}

Response

{
    "status": "Configured successfully",
    "device": "25002e001147383531363134"
}

Give you the ability to change the wi-fi of the device
In the body two keys are needed :

key value
ssid_name a string that is the name of the wi-fi
ssid_password the password of the wi-fi

HTTP REQUEST

PUT https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/devices/{{deviceId}}/setCredentials

parameter value
orgId your organization Id
deviceId the device Id you want to change the ssid

Rules

A rule is an entity of your organization that can be linked to a group.
This entity contains margins which are maximum and minimum limits for sensors.
Once a rule is linked to group , this rule will apply on all the devices under this group. If one of the devices reach the limit defined for the sensors an alert will be trigered through your Business Dashboard.
You can also link a webhook to a rule that will be called each time the limit of the sensors is reached by a device

Add a Rule

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body

{
  "margins": {
    "co": {
      "active": true,
      "max": 200,
      "min": 20
    },
    "co2": {
      "active": true,
      "max": 1000,
      "min": 10
    },
    "humidity": {
      "active": true,
      "max": 30,
      "min": 25
    },
    "pm10": {
      "active": true,
      "max": 1000,
      "min": 900
    },
    "pm25": {
      "active": true,
      "max": 1000,
      "min": 200
    },
    "temperature": {
      "active": true,
      "max": 50,
      "min": 20
    },
    "voc": {
      "active": true,
      "max": 120,
      "min": 100
    }
  },
  "name": "The name"
}

Response

{
    "status": "succes",
    "message": "Created a new Rule",
    "data": {
        "newId": "-ktqufHOTPCbyxyuXWCMPDB"
    }
}

Give the ability to create a new rule that can be linked to many devices
Data to provide:

key value
name (must be unique among the rules)
margins (must follow the same rule as said in the update a single rule endpoint endpoints and must contain at least active , min and max for one sensor)

For more information about the margins key go to update a single rule endpoint

HTTP REQUEST

POST https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/rules

parameter value
orgId your organization Id

Get All Rules

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "data": [
        "-MDAhdwKNzOyGQOq5wN1",
        "-eezxujDOZKJOQbacneBOBZQI",
        "-ughkJFSBOZJapniyYREERQ",
        "-lfibykKOULLGAweuinpwdSRYWUFAJ",
        "-fiyuaFFUWJRmgvhtleVKZ",
        "-mkqfLFJILRHiyyzMVKMEAB"
    ]
}

Get a list of all the ids of the rules of the organization
To get more information on one rule use Get a single rule by ID endpoints

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/rules

parameter value
orgId your organization Id

Get a Specific Rule

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
  "_id" : "-MDn_EnJIQhseLKWablp",
  "created_at" : "2020-08-03T09:09:13.510Z",
  "last_modified" : "2020-08-12T12:22:05.440Z",
  "margins" : {
    "co" : {
      "active" : true,
      "max" : 200,
      "min" : 20
    },
    "co2" : {
      "active" : true,
      "max" : 1000,
      "min" : 10
    },
    "humidity" : {
      "active" : true,
      "max" : 70,
      "min" : 30
    },
    "pm10" : {
      "active" : true,
      "max" : 1000,
      "min" : 200
    },
    "pm25" : {
      "active" : true,
      "max" : 1000,
      "min" : 200
    },
    "temperature" : {
      "active" : true,
      "max" : 26,
      "min" : 15
    },
    "voc" : {
      "active" : false,
    }
  },
  "name" : "LEED",
  "organizationId" : "keC9HTwXplOvCc9M1RS82lxX3ax2"
}

Get a specific rule by id :
data obtained :

key value
_id (unique string)
margins (object Go to update a single rule endpoints for more details)
name (unique string among the rules)
organizationId (string)

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/rules/{{ruleId}}

parameter value
orgId your organization Id
ruleId the rule Id you want to get

Update a Specific Rule

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body

{
 "margins":{
     "co2":{
         "active":true ,
          "max":50 ,
           "min":30
           }
        }
    }

Response

{
    "status": "success",
    "message": "rule updated sucessfully",
    "ruleId": "-ughkJFSBOZJapniyYREERQ"
}

Update a specific rule by id
Here is a list of the differents keys that you can update :

key value
name (unique string among rules)
margins (object)

About the margins :
Each key in the margin object must be a valid sensor name , here is the list :

sensor unit
co ppm
co2 ppm
humidity %
pm10 ug/m3
pm25 ug/m3
temperature °C
voc ppb
aqi between 0 and 500 less is better

Each sensor in the margins object can have the folowing keys :

key value
min (number minimum value)
max (number maximum value)
active (boolenan , do the rule will trigger on this sensor)

A specific sensor can contain only the key min or only the key max or both

Note that you need at least one sensor in the margin object
If you don't put a sensor , he will appear in the database with only the key active false inside it
You are able also to create a sensor with only a key active false

Note that :

HTTP REQUEST

PATCH https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/rules/{{ruleId}}

parameter value
orgId your organization Id
ruleId the rule Id you want to update

Update a specific sensor of a specific rule

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body

{
    "active":true,
    "max":90,
    "min":15
}

Response

{
    "status": "success",
    "message": "rule's margins updated",
    "data": {
        "margins": {
            "active": true,
            "max": 90,
            "min": 15
        }
    }
}

Give the ability to update a specific sensor from a specific rule:
Pass as a parameter the sensor name , that must be one of the list of the update a single rule endpoint In the body the server is waitinf for 3 keys :

key value
active (boolean : is the rule on this sensor will be active and will triger)
min (integer , the minimum value of the sensor)
max (integer , the maximum value of the sensor)

One , two or all the three keys can be sent in the request. Be carefull if you send only the key active with a value true to the API without never defined the min and max key of this sensor you will receive an error

HTTP REQUEST

PATCH https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/rules/{{ruleId}}/margin/{{sensor}}

parameter value
orgId your organization Id
ruleId the rule Id you want to update
sensor the sensor name you want to update

Rewrite margins of a specific rule

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body

{"co":{
    "active":true,
    "min":20,
    "max":50
}}

Response

{
    "status": "success",
    "message": "rule's margins updated",
    "data": {
        "margins": {
            "co": {
                "active": true,
                "min": 20,
                "max": 50
            }
        }
    }
}

Give the ability to rewrite the margins of a rule:

HTTP REQUEST

POST https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/rules/{{ruleId}}/margins

parameter value
orgId your organization Id
ruleId the rule Id you want to rewrite the margins

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Success",
    "message": "The group and the rule are linked",
    "data": {
        "groupId": "540024000c51393034363135",
        "ruleId": "-gvpGYPETCSopecvhmBNGUIP"
    }
}

Let you link a specific rule to a specific group

A rule can be linked to many groups but a group can be linked to only one rule , that's why if you try to link a group that is already linked to a rule , the old rule of the group will be overwriten with the new rule

Once a group is linked with a rule all the devices under this group will have a new key ruleId which will be the ruleId used in the request.

If you want to get the list of groups a rule is linked to use the get the groups linked to a specific group endpoint

HTTP REQUEST

POST https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/rules/{{ruleId}}/groups/{{groupId}}

parameter value
orgId your organization Id
ruleId the rule Id you want to link to a device
groupId the group you want to link to a rule

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Success",
    "message": "The group has been unlinked from the rule",
    "data": {
        "groupId": "540024000c61193024333135"
    }
}

Let you unlink a specific group from the rule it is linked to

Because a group can only be linked to one rule , you don't have to specify the rule Id , the endpoint will automaticaly remove the link between the specified group and the rule linked to it

Once the rule will be unlinked fro the group , all the devices under the specifc group will lost their key ruleId

This endpoint will send back a success even if the specified group is not linked to any rule

If you want to get the list of groups a rule is linked to use the get the groups linked to a specific rule endpoint

HTTP REQUEST

DELETE https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/groups/{{groupId}}/rules

parameter value
orgId your organization Id
groupId the group you want to unlink from the rule

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Success",
    "message": "The rule has been unlinked from all groups",
    "data": {
        "ruleId": "-olxarSTGHIdytjhrgrFFJWK"
    }
}

Let you unlink a specific rule from all the groups it is linked to

Once the rule will be unlinked from all the groups , all the devices under the groups and the groups themselves will lost their key ruleId

This endpoint will send back a success even if the specified rule is not linked to any group

If you want to get the list of groups a rule is linked to use the get the groups linked to a specific rule endpoint

HTTP REQUEST

DELETE https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/rules/{{ruleId}}/groups

parameter value
orgId your organization Id
ruleId the rule you want to unlink from it's groups

Get the devices linked to a specific rule

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Success",
    "data": {
        "3b002c001047383531363134": {
            "_id": "3b002c001047383531363134",
            "created_at": "2020-05-14T09:22:58.431Z",
            "filter_due_date": "2020-10-14T09:22:58.431Z",
            "floorId": "-M8op_BSEnPr4ccQoITD",
            "groupId": "null",
            "last_modified": "2020-06-07T12:29:54.303Z",
            "locationId": "-Lp2LeDOb8SdpqYU1Wpw12",
            "room": "Living Room",
            "mode": {
                "current_mode": "low",
            },
        },
        "540024000c51393034363135": {
            "_id": "540024000c51393034363135",
            "created_at": "2020-05-14T09:22:58.431Z",
            "floorId": "null",
            "groupId": "null",
            "last_modified": "2020-11-14T09:22:58.431Z",
            "locationId": "null",
            "mode": {
                "current_mode": "low",
            },
            "room": "Living Room"
        }
    }
}

This endpoint let you retrieve all the devices linked to a specific rule

If you want more information on the device object got to get a specific device endpoint

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/rules/{{ruleId}}/devices

parameter value
orgId your organization Id
ruleId the rule Id linked to the devices

Get rule linked to specific device

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Success",
    "data": {
        "_id": "-bupzfwNGMBJHtzftRYCIUMD",
        "created_at": "2021-05-25T15:43:40.814Z",
        "last_modified": "2021-05-25T15:43:40.814Z",
        "margins": {
            "co": {
                "active": false
            },
            "co2": {
                "active": false
            },
            "humidity": {
                "active": false
            },
            "pm10": {
                "active": false
            },
            "pm25": {
                "active": false
            },
            "temperature": {
                "active": true,
                "max": 50,
                "min": 20
            },
            "voc": {
                "active": false
            }
        },
        "name": "rule test#3",
        "organizationId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1"
    }
}

This endpoint let you retrieve the rule linked to a specific device

If you want more information on the rule object got to get-a-specific-rule endpoint

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/devices/{{deviceId}}/rules

parameter value
orgId your organization Id
deviceId the device Id linked to a rule

Get the groups linked to a specific rule

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Success",
    "data": {
        "-heoqzpvwHULXBSNksvhzPHVDI": {
            "_id": "-heoqzpvwHULXBSNksvhzPHVDI",
            "created_at": "2021-06-10T07:46:04.910Z",
            "last_modified": 1623323198,
            "locationId": "-itjdPSZDWfobilnaQBVVTWS",
            "name": "my good group",
            "ruleId": "-yeydwhadIUQNTtijlftbWQH"
        },
        "-icyevnPMNKJkjwuwrvBZTIC": {
            "_id": "-icyevnPMNKJkjwuwrvBZTIC",
            "created_at": "2021-06-10T11:37:07.457Z",
            "last_modified": 1623325051,
            "locationId": "-jhnfngvRNQFHgxgfgVOBAJBCT",
            "name": "my perfect group",
            "ruleId": "-yeydwhadIUQNTtijlftbWQH"
        }
    }
}

This endpoint let you retrieve all the groups linked to a specific rule

If you want more information on the group object got to get a specific group endpoint

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/rules/{{ruleId}}/groups

parameter value
orgId your organization Id
ruleId the rule Id linked to the groups

Remove webhooks from a rule

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Success",
    "message": "All the webhooks were unlinked from the rule",
    "data": {
        "ruleId": "-bagllCEFPTBKtkiqfbJVFY"
    }
}

This endpoint remove all the webhooks from a given rule
In the rule object the webhooks ids list will be remove
Inside each webhook that was linked to the rule , the rule Id will be remove from the array of rules

HTTP REQUEST

DELETE https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/rules/{{ruleId}}/webhooks

parameter value
orgId your organization Id
ruleId the rule Id you want to remove the webhooks

Delete a Specific Rule

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
  "status" :"success" , 
  "message" :"rule deleted" , 
  "ruleId":"-MLndsnds55sq"
}

Remove an existing rule by id

HTTP REQUEST

DELETE https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/rules/{{ruleId}}

parameter value
orgId your organization Id
ruleId the rule Id you want to delete

Webhooks

Request Body

{
    "rule_id": "12345",
    "created_at": "2021-06-22T13:11:31.614Z",
    "device_id": "5430583",
    "event": "auradb",
    "margins": {
      "co" : {
        "active" : false
      },
      "co2" : {
        "active" : false
      },
      "humidity" : {
        "active" : false
      },
      "pm10" : {
        "active" : false
      },
      "pm25" : {
        "active" : false
      },
      "temperature" : {
        "active" : true,
        "max" : 30
      },
      "voc" : {
        "active" : false
      }
    },
    "sensors": {
      "aqi":  100,
      "pm10": 8,
      "pm25": 3,
      "co": 0.8,
      "humidity": 45.8,
      "temperature":34,
      "co2": 417,
      "voc": 38
    },
    "rules_results": {
      "aqi": { "max": null, "min": null },
      "co": { "max": null, "min": null },
      "co2": { "max": null, "min": null },
      "humidity": { "max": null, "min": null },
      "pm10": { "max": null, "min": null },
      "pm25": { "max": null, "min": null },
      "temperature": { "max": true, "min": null },
      "voc": { "max": null, "min": null }
    }
  }

A webhook can be created only through the Business API and can be linked to many rule.
In order to work a webhook should be :

In these conditions if one of the rule is triggered the url set in the webhook will be called The request method will be POST and the data send in the body will be the one under Request Body at the right

Here are some details about the data send in the body :

Key Value
ruleId The rule ID triggered
created_at The ISO string date giving the exact moment when the rule was triggered
device_id The device that triggered this rule
event The name of the event will always be auradb
margins The margins of the rule trigerred , go to the update a single rule endpoint to get more information on this object
sensors the value of the different sensors at the moment when the rule was triggered , go to the Get Sensor Data of a specific Device to get informations on the unit of each sensor
rules_results give an json object with for each sensors 2 different keys :
  • min : true only if the the rule was triggered because of the minimum value of this sensor , else null
  • max : true only if the the rule was triggered because of the maximum value of this sensor , else null

A rule can also be linked to many webhooks

Get list of webhooks

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "data": {
        "-dJUKUAKRsgspvqWFEV": {
            "created_at": "2020-08-19T11:59:03.083Z",
            "id": "-dJUKUAKRsgspvqWFEV",
            "is_active": true,
            "last_modified": "2020-08-19T13:28:47.896Z",
            "orgId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
            "rules": [
                "-MDAhdwKNzOyGQOq5wN1"
            ],
            "url": "https://webhook.site/7bb3c3d2-5087-4ef6-842d-b12663e1ff41"
        },
        "-ixurjpklRJYOXNhbvlsreAATEPVI": {
            "created_at": "2020-08-19T12:19:22.378Z",
            "id": "-ixurjpklRJYOXNhbvlsreAATEPVI",
            "is_active": true,
            "last_modified": "2020-08-19T12:19:22.378Z",
            "orgId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
            "url": "https://google.com"
        },
        "-sxgtsPZSHfrsteagdDBSKJZ": {
            "created_at": "2020-08-19T12:47:19.429Z",
            "id": "-sxgtsPZSHfrsteagdDBSKJZ",
            "is_active": true,
            "last_modified": "2020-08-19T12:47:19.429Z",
            "orgId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
            "url": "https://go.com"
        },
        "-wdiphiskRDPOKQWubJCICDH": {
            "created_at": "2020-08-19T12:40:57.564Z",
            "id": "-wdiphiskRDPOKQWubJCICDH",
            "is_active": true,
            "last_modified": "2020-08-19T13:29:08.697Z",
            "orgId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
            "rules": [
                "-MDAhdwKNzOyGQOq5wN1"
            ],
            "url": "https://goog.com"
        }
    }
}

Get the list of webhooks specific to the organization
If you want more information on the webhook object got to the get a specific webhook by id endpoint

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/webhooks

parameter value
orgId your organization Id

Get a specific webhook by id

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "data": {
        "created_at": "2020-08-19T11:59:03.083Z",
        "id": "-dJUKUAKRsgspvqWFEV",
        "is_active": true,
        "last_modified": "2020-08-19T13:28:47.896Z",
        "orgId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
        "rules": [
            "-MDAhdwKNzOyGQOq5wN1"
        ],
        "url": "https://webhook.site/7bb3c3d2-5087-4ef6-842d-b12663e1ff41"
    }
}

Get a specific webhook by his id , only if the organization is the owner of this webhook
Data obtained:

key value
created_at (ISO string)
_id (unique string)
is_active (boolan , if it is to false , the webhook will not be called even if he is linked to a rule)
last_modified (ISO string)
orgId ( string :the organizatio Id of the the organization that created this webhook)
rules (optional : an array of rules ids the webhook is linked to , if the webhook is not linked to any rule this array does

not exist) url |(string: the url to call)

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/webhooks/{{webhookId}}

parameter value
orgId your organization Id
webhookId The webhook Id you want to get

Get list of webhooks linked to a rule

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "data": {
        "empty": false,
        "list": [
            {
                "created_at": "2020-08-31T14:49:52.907Z",
                "id": "-xxtBGPYSOLIwpmdhcdlhFDMIZDG",
                "is_active": true,
                "last_modified": "2020-09-01T10:23:12.576Z",
                "orgId": "t1WspsDLvndfvptjG6JV8a28wXm1",
                "rules": [
                    "-ryakpyubrRNMSTcccogmqHFMUAZE"
                ],
                "url": "https://mywebsite.cm"
            },
            {
                "created_at": "2020-09-01T09:27:33.057Z",
                "id": "-cykvfnmHKNWgjzcRZZE",
                "is_active": true,
                "last_modified": "2020-09-01T10:28:13.889Z",
                "orgId": "t1WspsDLvndfvptjG6JV8a28wXm1",
                "rules": [
                    "-ryakpyubrRNMSTcccogmqHFMUAZE"
                ],
                "url": "https://youtube.com"
            }
        ]
    }
}

Send back the list of webhooks link to a specific rule For more information on the webhook object go to the Get a specific webhook by id endpoint

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/rules/{{ruleId}}/webhooks

parameter value
orgId your organization Id
ruleId The ruleId you want to get the webhooks of

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "data": [
        {
            "_id": "-qnhnomDIOHHfkwlwhKARLLH",
            "created_at": "2020-09-02T08:57:28.905Z",
            "floorId": "-wxfmnKHQOZKDanlkmlijBBNYQE",
            "groupId": "-uuiquuCYOTbgfvwSHADZJ",
            "last_modified": "2020-09-02T08:57:28.905Z",
            "locationId": "-mxmrbDBDQKQWArpehxkWNTSDN",
            "margins": {
                "co": {
                    "active": true,
                    "max": 40,
                    "min": 14
                },
                "co2": {
                    "active": false
                },
                "humidity": {
                    "active": true,
                    "max": 30,
                    "min": 25
                },
                "pm10": {
                    "active": true,
                    "max": 1000,
                    "min": 900
                },
                "pm25": {
                    "active": false
                },
                "temperature": {
                    "active": false
                },
                "voc": {
                    "active": false
                }
            },
            "name": "my rule",
            "organizationId": "t1WspsDLvndfvptjG6JV8a28wXm1",
            "webhooks": [
                "-cykvfnmHKNWgjzcRZZE",
                "-xxtBGPYSOLIwpmdhcdlhFDMIZDG"
            ]
        },
        {
            "_id": "-lndslMKGAFHiisbrsSQNO",
            "created_at": "2020-09-02T08:59:25.066Z",
            "floorId": "-wxfmnKHQOZKDanlkmlijBBNYQE",
            "groupId": "-uuiquuCYOTbgfvwSHADZJ",
            "last_modified": "2020-09-02T08:59:25.066Z",
            "locationId": "-mxmrbDBDQKQWArpehxkWNTSDN",
            "margins": {
                "co": {
                    "active": true,
                    "max": 40,
                    "min": 14
                },
                "co2": {
                    "active": false
                },
                "humidity": {
                    "active": true,
                    "max": 30,
                    "min": 25
                },
                "pm10": {
                    "active": false
                },
                "pm25": {
                    "active": true,
                    "max": 1000,
                    "min": 200
                },
                "temperature": {
                    "active": false
                },
                "voc": {
                    "active": false
                }
            },
            "name": "my new rule",
            "organizationId": "t1WspsDLvndfvptjG6JV8a28wXm1",
            "webhooks": [
                "-xxtBGPYSOLIwpmdhcdlhFDMIZDG"
            ]
        }
    ]
}

Send back the list of rules under a specific webhook
For more information on the rule object go to the Get a specific rule by id endpoint
Note that :

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/webhooks/{{webhookId}}/rules

parameter value
orgId your organization Id
webhookId The webhook Id you want to get the rules of

Create a Webhook

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body

 {
    "url":"https://mywebsite.com"
}

Response

{
    "status": "success",
    "message": "webhook added",
    "data": {
        "url": "https://mywebsite.com",
        "created_at": "2020-08-25T09:50:07.572Z",
        "last_modified": "2020-08-25T09:50:07.572Z",
        "is_active": true,
        "orgId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
        "id": "-yfrqksaNSBCisyeCM"
    }
}

Create a webhook in the webhooks list:
The key needed is url and have to be a valid url

HTTP REQUEST

POST https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/webhooks

parameter value
orgId your organization Id

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "message": {
        "success": true,
        "message": "webhooks - rule link updated"
    }
}

Link a webhook to a specific rue by id
Note that it will create a webhooks array in the rule object containing all the webhooks ids this rule is linked to
It will al so create a rule array inside the webhook object conatinig all the rule ids the webhook is linked to

HTTP REQUEST

POST https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/rules/{{ruleId}}/webhooks/{{webhookId}}

parameter value
orgId your organization Id
ruleId the rule you want to link to the webhook
webhookId the webhook you want to link to the rule

Enable / disable a webhook

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "message": "state of the webhook changed"
}

Enable or disable a webhook by passing as state on or off
A disabled webhook will not be called when the rules linked to it are broken

HTTP REQUEST

POST https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/webhooks/{{webhookId}}/{{state}}

parameter value
orgId your organization Id
webhookId the webhook you want to enable/disable
state the updated state of a webhook , on for enable and off for disable

Update a webhook

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body

{
  "url":"https://newurl.com"
}

Response

{
    "status": "success",
    "message": "webhook updated",
    "data": {
        "created_at": "2020-08-19T11:59:03.083Z",
        "id": "-dJUKUAKRsgspvqWFEV",
        "is_active": false,
        "last_modified": "2020-08-25T10:25:53.057Z",
        "orgId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
        "rules": [
            "-ktqufHOTPCbyxyuXWCMPDB"
        ],
        "url": "https://newurl.com"
    }
}

Update the url of a specific webhook
The url must be passed in the body it will be the only key accepted

HTTP REQUEST

PATCH https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/webhooks/{{webhookId}}

parameter value
orgId your organization Id
webhookId the webhook you want to update

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "message": {
        "success": true,
        "message": "webhooks - rule link updated"
    }
}

Unlink a webhook from a rule.
This rule will no longer trigger this webhook when it will be broken
The Webhook Id will be deleted from the webhooks arrays inside the rule specified
The rule Id given will be deleted from the webhook`s rules array specified

HTTP REQUEST

DELETE https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/rules/{{ruleId}}/webhooks/{{webhookId}}

parameter value
orgId your organization Id
webhookId the webhook you want to unlink from the rule
ruleId the rule you want to unlink from the webhook

Delete a webhook

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "message": "webhook removed"
}

Delete a webhook from the webhooks list
This webhook will also be deleted from all the webhooks lists in the rules he was linked too

HTTP REQUEST

DELETE https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/rules/{{ruleId}}/webhooks/{{webhookId}}

parameter value
orgId your organization Id
webhookId the webhook you want to delete

Global Webhooks

A global webhook works like a webhook but its not linked to any rule.
The global webhook will instead be called all the time the sensors of one of your device update (approximately evry 10 sec)

Get list of global webhooks

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "data": {
        "-dJUKUAKRsgspvqWFEV": {
            "created_at": "2020-08-19T11:59:03.083Z",
            "id": "-dJUKUAKRsgspvqWFEV",
            "is_active": true,
            "last_modified": "2020-08-19T13:28:47.896Z",
            "orgId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
            "url": "https://webhook.site/7bb3c3d2-5087-4ef6-842d-b12663e1ff41"
        },
        "-ixurjpklRJYOXNhbvlsreAATEPVI": {
            "created_at": "2020-08-19T12:19:22.378Z",
            "id": "-ixurjpklRJYOXNhbvlsreAATEPVI",
            "is_active": true,
            "last_modified": "2020-08-19T12:19:22.378Z",
            "orgId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
            "url": "https://google.com"
        }
    }
}

Get the list of global webhooks specific to the organization
If you want more information on the webhook object got to the get a specific global webhook by id endpoint

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/webhooks/global

parameter value
orgId your organization Id

Get a specific global webhook by id

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "data": {
        "created_at": "2020-08-19T11:59:03.083Z",
        "id": "-dJUKUAKRsgspvqWFEV",
        "is_active": true,
        "last_modified": "2020-08-19T13:28:47.896Z",
        "orgId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
        "url": "https://webhook.site/7bb3c3d2-5087-4ef6-842d-b12663e1ff41"
    }
}

Get a specific global webhook by his id , only if the organization is the owner of this global webhook
Data obtained:

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/webhooks/{{webhookId}}/global

parameter value
orgId your organization Id
webhookId The webhook you want to get

Create a global webhook

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body

  {
      "url":"https://mywebsite.com"
  }

Response

{
    "status": "success",
    "message": "webhook added",
    "data": {
        "url": "https://mywebsite.com",
        "created_at": "2020-08-25T09:50:07.572Z",
        "last_modified": "2020-08-25T09:50:07.572Z",
        "is_active": true,
        "orgId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
        "id": "-yfrqksaNSBCisyeCM"
    }
}

Create a global webhook in the globalWebhooks
The key needed is url and have to be a valid url
A global webhook will be called at each changes of each device of your organization

HTTP REQUEST

POST https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/webhooks/global

parameter value
orgId your organization Id

Enable / Disable a global webhook

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "message": "sate of the webhook changed"
}

Enable or disable a global webhook by passing as state on or off
A disabled global webhook will never be called

HTTP REQUEST

POST https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/webhooks/{{webhookId}}/global/{{state}}

parameter value
orgId your organization Id
webhookId The global webhook you want to update the state of
state The new sate of the webhook you want to update

Update a global webhook

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body

  {
      "url":"https://mysuperbwebsite.com"
  }

Response

{
    "status": "success",
    "message": "webhook updated",
    "data": {
        "created_at": "2020-08-19T11:59:03.083Z",
        "id": "-dJUKUAKRsgspvqWFEV",
        "is_active": false,
        "last_modified": "2020-08-25T10:25:53.057Z",
        "orgId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
        "url": "https://mysuperbwebsite.com"
    }
}

Update the url of a specific global webhook
The url must be passed in the body it will be the only key accepted

Needs an APi key

HTTP REQUEST

PATCH https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/webhooks/{{webhookId}}

parameter value
orgId your organization Id
webhookId The global webhook you want to update

Delete a global webhook

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "message": "webhook removed"
}

Delete a global webhook from the globalWebhooks This global webhook will never be called again

HTTP REQUEST

DELETE http://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/webhooks/{{webhookId}}

parameter value
orgId your organization Id
webhookId The global webhook you want to delete

Customers

A customer is the user that can access your Businness Dashboard.
The data that the customer can acccess in it is based on the locations that he can access.
A customer that have access to any location will not see data on the Business Dashboard

Get all customers

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Success",
    "data": {
        "1382HQIflXUEBZGkjLdFE8uubSs1": {
            "_id": "1382HQIflXUEBZGkjLdFE8uubSs1",
            "created_at": 1598536224063,
            "email": "gulit@gmail.com",
            "gdpr_compliant": {
                "approved": true,
                "time_stamp": "2020-08-27T13:50:24.063Z"
            },
            "last_modified": 1598536224063,
            "locations": {
                "-spmmbkIPRYQHFFGrzwkEZYCCIDK": {
                    "_id": "-spmmbkIPRYQHFFGrzwkEZYCCIDK",
                    "customer_role": "viewer"
                },
                "-tcthvbMQGARTKVsumsagjAGBZVGP": {
                    "_id": "-tcthvbMQGARTKVsumsagjAGBZVGP",
                    "customer_role": "technician"
                }
            },
            "name": "Jane Doe",
            "organizationId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
            "settings": {
                "time_zone": "+1200"
            }
        },
        "2slPFwveYmce2MoqbCvrSbLl4em1": {
            "_id": "2slPFwveYmce2MoqbCvrSbLl4em1",
            "created_at": 1611507062340,
            "email": "john@doe.com",
            "gdpr_compliant": {
                "approved": true,
                "time_stamp": "2021-01-24T16:51:02.340Z"
            },
            "last_modified": 1611569112,
            "locations": {
                "-tcthvbMQGARTKVsumsagjAGBZVGP": {
                    "_id": "-tcthvbMQGARTKVsumsagjAGBZVGP",
                    "customer_role": "viewer"
                }
            },
            "name": "John Doe",
            "organizationId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
            "settings": {
                "time_zone": "+0200"
            }
        },

This endpoint give you the ability to get the list of all the customers
For more information on the customer Object go the Get a single customer by ID endpoint

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/customers

parameter value
orgId your organization Id

Get a single customer by ID

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Succes",
    "data": {
        "_id": "1a7MObmW5nZG6BJ1ZHEZZn61fsz1",
        "created_at": 1594733578086,
        "email": "gilad+12@auraair.io",
        "gdpr_compliant": {
            "approved": true,
            "time_stamp": "2020-07-14T13:32:58.087Z"
        },
        "last_modified": "2020-07-14T13:34:42.963Z",
        "name": "billie eilish",
        "organizationId": "keC9HTwXplOvCc9M1RS82lxX3ax2",
        "settings": {
            "time_zone": "+0300"
        },
        "locations": {
            "-spmmbkIPRYQHFFGrzwkEZYCCIDK": {
                "_id": "-spmmbkIPRYQHFFGrzwkEZYCCIDK",
                "customer_role": "admin"
            },
            "-tcthvbMQGARTKVsumsagjAGBZVGP": {
                "_id": "-tcthvbMQGARTKVsumsagjAGBZVGP",
                "customer_role": "admin"
            },
        },
        "subscribed": false,
        "subscribed_alerts": false,
        "subscribed_maintanance": false,
        "subscribed_reports": true
    }
}

Get a single customer by ID
Data obtained :

key value
_id the unique id of the customer
created_at ISO string
last_modified ISO string
email string :email of the customer
gdpr_compilant object : contain a ISO date when the user consented the gdpr_compilant
name string name of the customer , two customers can have the same name)
organizationId (unique string among the organization
locations list of locations where the user have a role , each location have 2 keys : _id for the location id and customer_role for the role
settings string contain the time zone of the customer
subscribed boolan , tell if the user suvbscribed to mails of the b2B service
subscribed_maintenance boolan , tell if the user suvbscribed to mails of maintenance the b2B service
subscribed_reports boolean , tell if the user subscribed to mails of reports of the b2B service
subscribed_alerts boolean , tell if the user subscribed to mails of alerts of the b2B service

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/customers/{{customerId}}

parameter value
orgId your organization Id
customerId the customer you want to get

Get Customers by location ID

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Success",
    "data": {
        "1382HQIflXUEBZGkjLdFE8uubSs1": {
            "_id": "1382HQIflXUEBZGkjLdFE8uubSs1",
            "created_at": 1598536224063,
            "email": "johndoe@gmail.com",
            "gdpr_compliant": {
                "approved": true,
                "time_stamp": "2020-08-27T13:50:24.063Z"
            },
            "last_modified": 1598536224063,
            "locations": {
                "-spmmbkIPRYQHFFGrzwkEZYCCIDK": {
                    "_id": "-spmmbkIPRYQHFFGrzwkEZYCCIDK",
                    "customer_role": "viewer"
                },
                "-tcthvbMQGARTKVsumsagjAGBZVGP": {
                    "_id": "-tcthvbMQGARTKVsumsagjAGBZVGP",
                    "customer_role": "technician"
            },
            "name": "John Doe",
            "organizationId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
            "settings": {
                "time_zone": "+1200"
            }
        },
        "6CdBg1ctzSY8rjrWKwel7Ii9sFg2": {
            "_id": "6CdBg1ctzSY8rjrWKwel7Ii9sFg2",
            "created_at": 1602691629149,
            "email": "janedoe@gmail.com",
            "gdpr_compliant": {
                "approved": true,
                "time_stamp": "2020-10-14T16:07:09.149Z"
            },
            "last_modified": 1602691629149,
            "locations": {
                "-spmmbkIPRYQHFFGrzwkEZYCCIDK": {
                    "_id": "-spmmbkIPRYQHFFGrzwkEZYCCIDK",
                    "customer_role": "admin"
                },
                "-tcthvbMQGARTKVsumsagjAGBZVGP": {
                    "_id": "-tcthvbMQGARTKVsumsagjAGBZVGP",
                    "customer_role": "admin"
                },
            },
            "name": "Jane Doe",
            "organizationId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
            "settings": {
                "time_zone": "+0300"
            }
        }
    }
}

Get the list of all the customers that have access to a specific location.

All the customers that have the given location Id under their location object will be returned.

For more information about the customers object go to the get a single customer by ID endpoint

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/customers/locations/{{locationId}}

parameter value
orgId your organization Id
locationId the location you want to get the customers of

Get Customers by location ID and role

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Success",
    "data": {
        "1382HQIflXUEBZGkjLdFE8uubSs1": {
            "_id": "1382HQIflXUEBZGkjLdFE8uubSs1",
            "created_at": 1598536224063,
            "email": "johndoe@gmail.com",
            "gdpr_compliant": {
                "approved": true,
                "time_stamp": "2020-08-27T13:50:24.063Z"
            },
            "last_modified": 1598536224063,
            "locations": {
                "-spmmbkIPRYQHFFGrzwkEZYCCIDK": {
                    "_id": "-spmmbkIPRYQHFFGrzwkEZYCCIDK",
                    "customer_role": "viewer"
                },
                "-tcthvbMQGARTKVsumsagjAGBZVGP": {
                    "_id": "-tcthvbMQGARTKVsumsagjAGBZVGP",
                    "customer_role": "technician"
            },
            "name": "John Doe",
            "organizationId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
            "settings": {
                "time_zone": "+1200"
            }
        },
        "6CdBg1ctzSY8rjrWKwel7Ii9sFg2": {
            "_id": "6CdBg1ctzSY8rjrWKwel7Ii9sFg2",
            "created_at": 1602691629149,
            "email": "janedoe@gmail.com",
            "gdpr_compliant": {
                "approved": true,
                "time_stamp": "2020-10-14T16:07:09.149Z"
            },
            "last_modified": 1602691629149,
            "locations": {
                "-spmmbkIPRYQHFFGrzwkEZYCCIDK": {
                    "_id": "-spmmbkIPRYQHFFGrzwkEZYCCIDK",
                    "customer_role": "viewer"
                },
                "-tcthvbMQGARTKVsumsagjAGBZVGP": {
                    "_id": "-tcthvbMQGARTKVsumsagjAGBZVGP",
                    "customer_role": "admin"
                },
            },
            "name": "Jane Doe",
            "organizationId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
            "settings": {
                "time_zone": "+0300"
            }
        }
    }
}

Get the list of all the customers that have a specific role under a specific location

This endpoint is very similar to the Get Customers by location id endpoint , it only introduce a way to filter the data of this endpoint by role

All the customers that have the given location Id under their location object with the specific role will be returned

For more information about the customers object go to the get a single customer by ID endpoint

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/customers/locations/{{locationId}}/role/{{role}}

parameter value
orgId your organization Id
locationId the location you want to get the customers of
role The role of the customers you want to get

Get Customers locations list by ID

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Success",
    "data": {
        "locations": {
            "-tcthvbMQGARTKVsumsagjAGBZVGP": {
                "_id": "-tcthvbMQGARTKVsumsagjAGBZVGP",
                "customer_role": "viewer"
            },
            "-fdfwwbMQGARTKVslasjfffZakl": {
                "_id": "-fdfwwbMQGARTKVslasjfffZakl",
                "customer_role": "technician"
            }
        }
    }
}

Get the list of locations where the customer have a role

The data correspond to the locations object of a customer when you retrieve him

The different keys for each location are :

key value
_id the location ID
customer_role the role the customer have under this location , can be : admin , viewer or technician

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/customers/{{customerId}}/locations

parameter value
orgId your organization Id
customerId the customer you want to get the list of locations

Create a customer to your organization

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Body

  {
    "customer":{
        "email":"myemail@gmail.com", 
        "name":"John Doe",
        "time_zone":"+12"
    },
    "sendMail":true
}

Response

{
    "status": "success",
    "message": "Customer added",
    "data": {
        "customer": {
            "_id": "iruqRa7j55gsMU1JsGU7AZd7n5y2",
            "name": "John Doe",
            "email": "myemail@gmail.com",
            "created_at": 1598517149309,
            "last_modified": 1598517149309,
            "last_login": null,
            "organizationId": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
            "customer_role": "admin",
            "gdpr_compliant": {
                "approved": true,
                "time_stamp": "2020-08-27T08:32:29.309Z"
            },
            "settings": {
                "time_zone": "+1200"
            }
        },
        "password": "feidhca"
    }
}

Give the ability to create a customer for your organization : You need to provide 3 keys :

key value
email (a valid string email not already in use by another customer)
name (a valid string name for your customer)
time_zone ( a integer between -12 and 12)

The customer object must be send in the body under the customer key
You can also add a key send_mail and put the value true to send a mail to the created customer

In the response you will get the customer object created under the key data.customer (for more information on it go to the Get a single customer by ID endpoints)

You will also get the password of the created user under the key data.password

Note that the customer will be created without any role , if you want to add a role to it go into the add location role to customer endpoint

If you decide to send mail to the customer , the login information will be in it (email and password)

When a customer is created his id is put under the viewers object of the organization

HTTP REQUEST

POST https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/customers

parameter value
orgId your organization Id

Add customer role access for specific location

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Success",
    "message": "customer 2slPFwveYmce2MoqbCvrSbLl4em1 updated",
    "data": {
        "customerId": "2slPFwveYmce2MoqbCvrSbLl4em1",
        "roleName": "viewer"
    }
}

Let you the capability to give to a specific customer access (with selected role, can be technician/viewer/admin) to a specific location.

It will add the specific location object to the list of locations under the customer object , look the Get Customers locations list by ID endpoint for more information about this list

Note that the endpoint will return an error if the customer already have access (role) for the specified location, if you wish to update only the customer role for the location see Update customer role access for specific location

HTTP REQUEST

POST https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/customers/{{customerId}}/locations/{{locationId}}/role/{{role}}

parameter value
orgId your organization Id
customerId the customer you want to give a new role
locationId the new location where the customer will have a role
role the role of the customer under his new location

Update customer role access for specific location

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "message": "the customer was updated",
    "data": {
        "customerId": "2slPFwveYmce2MoqbCvrSbLl4em1",
        "roleName": "admin"
    }
}

Let you the capability to update the role of a specific customer under a specific location

It will update the key customer_role of the location in the location list under the customer object , look the Get Customers locations list by ID endpoint for more information about this list

The endpoint will return an error if the user does not have any role under the given location

To add a role for a specific location to a customer go to the Add customer role access for specific location endpoint

HTTP REQUEST

PUT https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/customers/{{customerId}}/locations/{{locationId}}/role/{{role}}

parameter value
orgId your organization Id
customerId the customer you want to update the role
locationId the location where the customer have this role
role the new role of the customer under the location

Remove the access of a specific location from the customer

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "Success",
    "message": "The customer was updated with success",
    "data": {
        "customerId": "2slPFwveYmce2MoqbCvrSbLl4em1",
        "locationId": "-ygnrZPFGHCtslhweQMBD"
    }
}

Let you the capability to remove the access of a specific location from the customer

It will remove the specific location object from the list of locations under the customer object, look the Get Customers locations list by ID endpoint for more information about this list

Note that the endpoint will return an error if the user does not have any location with the specified location id.

HTTP REQUEST

PUT https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/customers/{{customerId}}/locations/{{locationId}}

parameter value
orgId your organization Id
customerId the customer you want to remove the location role
locationId the location to remove

Delete a customer by Id

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "message": "customer deleted"
}

Give you the ability to delete a customer by his Id
Note that the customer id will also be deleted from the viewer object under the organization

HTTP REQUEST

DELETE https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}/customers/{{customerId}}

parameter value
orgId your organization Id
customerId the customer you want to delete

Organizations

Get a single organization by ID

Headers

  {
    "Authorization": "Bearer API_KEY"
  }

Response

{
    "status": "success",
    "data": {
        "_id": "YhGd6IE9lDcEuDgMCiS3IhL18Ym1",
        "created_at": "2020-05-14T10:22:58.431Z",
        "customer_role": "owner",
        "devices": {
            "1f002e000a47363433353735": {
                "_id": "1f002e000a47363433353735",
                "created_at": "2020-05-14T09:22:58.431Z",
                "filter_due_date": "2020-10-14T09:22:58.431Z",
                "floorId": "-M8op_BSEnPr4ccQoITD",
                "floor_name": "test1112",
                "groupId": "-M8tcVdtAlnqpHljBiVq",
                "group_name": "Group 2",
                "last_modified": "2020-06-07T12:29:54.303Z",
                "locationId": "-Lp2LeDOb8SdpqYU1Wpw12",
                "location_name": "Building 2",
                "room": "Living Room"
            },
            "25002e001147383531363134": {
                "_id": "25002e001147383531363134",
                "created_at": "2020-05-14T09:22:58.431Z",
                "filter_due_date": "2020-10-14T09:22:58.431Z",
                "floorId": "-M8opVbcMkKAXZGCJt2l",
                "floor_name": "test1112",
                "groupId": "ooxyyZz1",
                "group_name": "Group 2",
                "last_modified": "2020-06-04T10:42:53.289Z",
                "locationId": "-Lp2LeDOb8SdpqYU1Wpw",
                "location_name": "Building 1",
                "room": "Conference Room roei"
            }
            },
        "email": "jbronaldo131@gmail.com",
        "floors": {
            "-M8tVY8qZaSrXtrUzG80": {
                "_id": "-M8tVY8qZaSrXtrUzG80",
                "created_at": "2020-06-03T09:27:55.319Z",
                "last_modified": "2020-06-03T09:27:55.319Z",
                "locationId": "-M7qh60FjNWsDVfEuD6Z",
                "name": "floor ne",
                "reminderDay": "1"
            },
            "-MAQ4XeE2mdDkDmq2bva": {
                "_id": "-MAQ4XeE2mdDkDmq2bva",
                "created_at": "2020-06-22T08:12:42.549Z",
                "last_modified": "2020-06-22T08:12:42.549Z",
                "locationId": "-M7qh60FjNWsDVfEuD6Z",
                "name": "floor 2",
                "reminderDay": "1"
            },
        },
        "groups": {
            "-M8tcHwxWOGJtVAZI14G": {
                "_id": "-M8tcHwxWOGJtVAZI14G",
                "created_at": "2020-06-03T10:01:46.121Z",
                "last_modified": "2020-06-03T10:01:46.121Z",
                "locationId": "-Lp2LeDOb8SdpqYU1Wpw13",
                "name": "test32"
            },
            "-M8tcVdtAlnqpHljBiVq": {
                "_id": "-M8tcVdtAlnqpHljBiVq",
                "created_at": "2020-06-03T10:02:42.246Z",
                "last_modified": "2020-06-03T10:02:51.571Z",
                "locationId": "-Lp2LeDOb8SdpqYU1Wpw12",
                "name": "build123"
            },
            "-duueAXXsohvcsdLKNHHXOM": {
                "_id": "-duueAXXsohvcsdLKNHHXOM",
                "locationId": "-M7qh60FjNWsDVfEuD6Z",
                "name": "group shel hagvarim"
            },
            "-fgruxpFWQCjeikmfUERJG": {
                "_id": "-fgruxpFWQCjeikmfUERJG",
                "locationId": "-M7qh60FjNWsDVfEuD6Z",
                "name": "group shel hagvarim"
            }
        },
        "last_login": "2020-05-14T09:22:58.431Z",
        "last_modified": "2020-05-14T09:22:58.431Z",
        "locations": {
            "-Lp2LeDOb8SdpqYU1Wpw12": {
                "_id": "-Lp2LeDOb8SdpqYU1Wpw12",
                "address": "Hamiphras 6",
                "altitude": 0,
                "aura_daily_report": "true",
                "bad_aqi_event": false,
                "city": "Yavne",
                "components": {
                    "administrative_area": "Merkaz",
                    "country_iso_3": "ISR",
                    "locality": "Yavne",
                    "postal_code": "81000",
                    "postal_code_short": "81000",
                    "premise": "6",
                    "premise_number": "6",
                    "sub_administrative_area": "Rehovot",
                    "thoroughfare": "Hamifras",
                    "thoroughfare_name": "Hamiphras"
                },
                "created_at": 1577098253453,
                "last_modified": 1577098253453,
                "latitude": 31.86777,
                "longitude": 34.733457,
                "name": "Building 2",
                "state": "Israel",
                "zipcode": "8101306"
            },
            "-M7qh60FjNWsDVfEuD6Z": {
                "_id": "-M7qh60FjNWsDVfEuD6Z",
                "address": "Saknai 4",
                "aura_daily_report": true,
                "city": "hod hasharon",
                "components": {
                    "ISO_3166-1_alpha-2": "US",
                    "ISO_3166-1_alpha-3": "USA",
                    "_category": "place",
                    "_type": "village",
                    "continent": "North America",
                    "country": "United States of America",
                    "country_code": "us",
                    "country_iso_3": "USA",
                    "county": "Maricopa County",
                    "hamlet": "Kaka",
                    "state": "Arizona",
                    "state_code": "AZ"
                },
                "created_at": 1590055694668,
                "is_shared": false,
                "last_modified": "2020-07-09T09:00:13.914Z",
                "latitude": 32.1420858,
                "longitude": 34.8918504,
                "name": "Aura Office",
                "state": "israel",
                "zipcode": "453535"
            },
        },
        "logo_url": "https://firebasestorage.googleapis.com/v0/b/aura-b2b.appspot.com/o/auralogo.png?alt=media&token=a5039565-d626-415c-99ac-616136b2ddb1",
        "name": "Aura Business",
        "rules": {
            "-MBiq1XyBRNfdfassw9g": "e1x0wflkfkflkfffifjffefyMxg2",
            "-MDAKu4GMnlnDQ8ohAO8": "whvuygfigrnbifhjpjyjikpewxl1"
        },
        "temperature_unit": "C",
        "api":{
          "use_count": 234,
        },
        "viewers": {
            "-MBiq1XyBRNfdjtO1d9g": "e1x0LZdTemRqyW0mz0S3FctyMxg2",
            "-MDAKu4GMnlnDQ8ohAO8": "whJ6LU6AAobTBmXKNu1k0ABZAxl1"
        }
    }
}

Give your organizations information The organization object will get the following keys :

key value
id a string , the id of the organization
viewers an object , the list of all the customers Ids of the organization
devices an object , the list of devices of the organization
locations an object , the list of locations of the organization
floors an object , the list of floors of the organization
groups an object , the list of groups of the organization
last_modified an ISO date , the last time , the last time the organization object was modified
rules an object , the list of rules Id of the organization,
logo_url a string , the url of the pictures of your logo
name a string , the name of the organization

HTTP REQUEST

GET https://aura-b2b-rest.web.app/api/v1/org/{{orgId}}

parameter value
orgId your organization Id

Errors

The Aura B2B API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong or you do not have the right to access this data.
403 Forbidden -- You don't have the right to access this data.
404 Not Found -- The specified request could not be found.
405 Method Not Allowed -- You tried to access the Api endpoint with an invalid method.
418 I'm a teapot.
429 Too Many Requests -- You're requesting too many information! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.