All URIs are relative to https://ext-api.airthings.com/v1
Method | HTTP request | Description |
---|---|---|
device_info | GET /devices/{serialNumber} | |
device_samples_latest_values | GET /devices/{serialNumber}/latest-samples | |
devices_list | GET /devices |
device_info(serial_number, opts)
Get info about a specific Device
require 'time'
require 'airthings'
# setup authorization
Airthings.configure do |config|
# Configure OAuth2 access token for authorization: AirthingsAccounts
config.access_token = 'YOUR ACCESS TOKEN'
end
api_instance = Airthings::DevicesApi.new
serial_number = 'serial_number_example' # String |
opts = {
organization_id: 'organization_id_example', # String |
user_group_id: 'user_group_id_example' # String |
}
begin
result = api_instance.device_info(serial_number, opts)
p result
rescue Airthings::ApiError => e
puts "Error when calling DevicesApi->device_info: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> device_info_with_http_info(serial_number, opts)
begin
data, status_code, headers = api_instance.device_info_with_http_info(serial_number, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetDeviceDetailedResponse>
rescue Airthings::ApiError => e
puts "Error when calling DevicesApi->device_info_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
serial_number | String | ||
organization_id | String | [optional] | |
user_group_id | String | [optional] |
- Content-Type: Not defined
- Accept: application/json
device_samples_latest_values(serial_number, opts)
Get latest Samples belonging to a specific Device (latest segment)
require 'time'
require 'airthings'
# setup authorization
Airthings.configure do |config|
# Configure OAuth2 access token for authorization: AirthingsAccounts
config.access_token = 'YOUR ACCESS TOKEN'
end
api_instance = Airthings::DevicesApi.new
serial_number = 'serial_number_example' # String |
opts = {
organization_id: 'organization_id_example', # String |
user_group_id: 'user_group_id_example' # String |
}
begin
result = api_instance.device_samples_latest_values(serial_number, opts)
p result
rescue Airthings::ApiError => e
puts "Error when calling DevicesApi->device_samples_latest_values: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> device_samples_latest_values_with_http_info(serial_number, opts)
begin
data, status_code, headers = api_instance.device_samples_latest_values_with_http_info(serial_number, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <SingleSampleResponse>
rescue Airthings::ApiError => e
puts "Error when calling DevicesApi->device_samples_latest_values_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
serial_number | String | ||
organization_id | String | [optional] | |
user_group_id | String | [optional] |
- Content-Type: Not defined
- Accept: application/json
devices_list(opts)
Get Devices belonging to the Account
require 'time'
require 'airthings'
# setup authorization
Airthings.configure do |config|
# Configure OAuth2 access token for authorization: AirthingsAccounts
config.access_token = 'YOUR ACCESS TOKEN'
end
api_instance = Airthings::DevicesApi.new
opts = {
show_inactive: true, # Boolean |
organization_id: 'organization_id_example', # String |
user_group_id: 'user_group_id_example' # String |
}
begin
result = api_instance.devices_list(opts)
p result
rescue Airthings::ApiError => e
puts "Error when calling DevicesApi->devices_list: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> devices_list_with_http_info(opts)
begin
data, status_code, headers = api_instance.devices_list_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetDevicesResponse>
rescue Airthings::ApiError => e
puts "Error when calling DevicesApi->devices_list_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
show_inactive | Boolean | [optional][default to false] | |
organization_id | String | [optional] | |
user_group_id | String | [optional] |
- Content-Type: Not defined
- Accept: application/json