Device Info (HTTP)
In addition to the SDK API (action) to retrieve device information, there also is an HTTP API which also returns substantially more information about your device.
Helper Method Available
Included in the Relay SDK is a function that makes it easy to create and send an HTTP device info request, in a way that hides the network operations and authentication mechanics. The content below describes how to do it manually, but you'll probably want to use this helper method instead. See the
fetchDevice
method in the "Special Utilities" section on the Helper Methods page.
To do so, you'll need your device ID and subscriber ID. You'll also need to provide an Auth header (to learn how to create the Auth header and User-Agent header, follow the link). Here is an example using curl
:
$ curl -X GET \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "User-Agent: my_client" \
"https://all-main-pro-ibot.relaysvr.com/relaypro/api/v1/device/990007560023456?subscriber_id=ab28d9b0-4b46-41f8-910c-bcf8da123456"
This returns a JSON payload, the following is an example.
{
"ibot_node":"ibot@ibot-pro-awsoh05",
"device_id":"990007560023456",
"session_id":"4BxluUMwkWVv6DpS",
"device_name":"user:9",
"device_label":"Alice",
"disable_sos":true,
"emergency_info":null,
"background_audio":false,
"mode":"undefined",
"device_status":"online",
"last_connect_timestamp":"2022-04-03T14:50:39",
"disable_location":false,
"device_details":{
"location":{
"lat":35.771867,
"long":-78.678118,
"address":"1010 Main Campus Dr, Raleigh, NC 27606",
"timestamp":"2022-04-04T20:50:11",
"timestamp_z":"2022-04-04T20:50:11Z",
"accuracy":14,
"geofence_state":"outside",
"geofence_events":[
{
"timestamp":"2022-03-30T19:09:42",
"timestamp_z":"2022-03-30T19:09:42Z",
"type":"entry",
"geofence_id":"to2XUGpaGSx636WpPpz14C",
"label":"Security Solutions"
},
{
"timestamp":"2022-03-30T20:09:30",
"timestamp_z":"2022-03-30T20:09:30Z",
"type":"exit",
"geofence_id":"to2XUGpaGSx636WpPpz14C",
"label":"Security Solutions"
}
],
"indoor_position":{
"alt":-86.25,
"alt_match":[
"floor 1",
"conference room"
],
"alt_match_id":"Nq3EDJ0vXBOezdlyogHPNC",
"alt_match_mac":"c88d",
"alt_match_venue":"office",
"best":-83.8,
"best_match":[
"floor 1",
"lab"
],
"best_match_id":"ITd5AS8CJYfs9BdDOPKfZOC",
"best_match_mac":"df31",
"best_match_venue":"office",
"confidence":"medium",
"other_macs":{
"0xd761_n20":-90.0,
"0xf7b2_n20":-90.0,
"0xf6c8_n20":-90.66666666666667,
"0xd763_n20":-91.33333333333333,
"0xd762_n20":-92.0,
"0xfa78_n20":-93.0
}
}
},
"device_info":{
"battery_level":71,
"battery_status":"not_charging",
"volume_level":3,
"network_status":{
"cell_bars":2,
"connection_type":"cell",
"connections":{
"cell_error":{
"reason":"NO_INTERNET",
"timestamp":"2022-03-31T22:58:11.017Z"
},
"cell_success":{
"timestamp":"2022-04-03T14:50:39.669Z"
},
"wifi_error":{
"ssid":""
},
"wifi_success":{
"ssid":""
}
},
"wifi_bars":0
},
"rom_version":"565",
"app_version":"3.12.2.2",
"iccid":"",
"imei":"990007560023456",
"fcc_id":"2AMBHRW2266",
"ic_id":"25353-RW2266",
"product_name":"Relay+",
"build_id":"V03M012P0",
"model":"RW2266",
"wifi_mac":"a4:a4:d3:c3:98:93",
"bluetooth_status":"off",
"bluetooth_info":{
}
}
},
"groups":[
{
"group_id":"wnrKdVle5K84vpqC",
"name":"security"
},
{
"group_id":"Ci47d88Dt2mD3F6S",
"name":"notify"
},
{
"group_id":"9PkiIvf9OFik3nLn",
"name":"main"
}
],
"rendezvous":[
],
"active_channel":"assistant",
"features":{
"lora_features":{
"enabled":false,
"lora_config":[
],
"send_sos":false
},
"access_point_match_metric":"avg",
"use_ibot_transcriptions":false,
"calling_notifications":true,
"beacon_match_metric":"low_power_avg",
"sensors_enabled":[
"nfc"
],
"home_channel_timeout":60,
"sos_support_enabled":false,
"dnd_support_enabled":true,
"config_namespace":[
"__account__"
],
"home_channel_name":null,
"assistant_namespace":[
"com.relaygo.default",
"__account__",
"wf_sounde_a10iPAweL2cCiKblW9CBbRC",
"wf_slack_U4AZ5KAkWVGwEdn8aWzYjA"
],
"calling":true,
"location_config":{
"bt_config":{
"match_mode":"aggressive",
"report_mode":"all",
"scan_mode":"low_latency",
"timeout":5000
},
"gps_config":{
"bg_scan":false,
"mode":"scan",
"num_fixes":10
},
"interval":600000,
"timeout":30000,
"wifi_config":{
"scan_wifi":true
}
},
"sensor_config":{
"batch":0,
"sensors":[
{
"continuous":{
"id":"nfccontinuous"
},
"type":"nfc",
"upload_criteria":{
"types":[
"tnf_well_known"
]
}
}
]
},
"analytics_config":{
"location":false,
"pii":true
},
"indoor_positioning":true,
"tracelog":"info",
"gps_positioning":true,
"cell_config":{
"advanced_sims_available":[
{
"activation_code":"1$twl.prod.ondemandconnectivity.com$",
"iccid":"",
"priority":2
},
{
"iccid":"",
"priority":1
}
],
"sims_available":[
1
],
"stop_fixes_on_any_connect":false,
"switch_delay":240000,
"switch_max":2,
"toggle_data":true
},
"auto_dnd_when_charging":false,
"channel_display":false,
"es_limit_concurrency":true,
"ping_interval":60,
"prefer_cell":true,
"location_polling_interval":600,
"background_notification_repeat_interval":600000,
"foreground_notification_repeat_interval":30000,
"indoor_position_algorithm":"beacon_match",
"location":true,
"cache_wifi_for_location":true,
"background_audio":false,
"sos":false,
"dnd":true
},
"capabilities":{
"sip_register":true,
"enable_audit_logs":true,
"escalated_sos":false,
"group_transcriptions":true,
"group_translations":false,
"remote_push_notifications":false,
"sos":false,
"ui_nfc":true,
"ui_user_profiles":false,
"devmon_event_support":true,
"dnd":true,
"eavesdrop_support":true,
"enable_team_support":false,
"intent_support":true,
"calling_between_devices_support":true,
"allow_sos_override":false,
"group_persistence":true,
"ui_translate":false,
"audit_rich_logging":true,
"calling":true,
"geofencing":true,
"indoor_positioning":true,
"offnet_calling":true,
"pstn_calling":true,
"ui_work_tracking":true,
"virtual_device_location_reporting":false,
"location_history":true,
"workflow_sdk":true,
"location":true,
"ui_allow_incident_resolution":true,
"ui_summon":false,
"background_audio":false,
"low_latency_audio":true
},
"channels":[
{
"channel_id":"pTgVAyIfEwxo0pUvctDXVA==",
"type_id":"9PkiIvf9OFik3nLn",
"name":"main",
"type":"group",
"catalog_type":"group",
"force_switch_on_page":false,
"params":[
],
"is_hidden":false,
"color":"0000ff"
},
{
"channel_id":"e9WDhk9ZSaoxTGfUfz9hPw==",
"type_id":"Ci47d88Dt2mD3F6S",
"name":"notify",
"type":"group",
"catalog_type":"group",
"force_switch_on_page":false,
"params":[
],
"is_hidden":false,
"color":"0000ff"
},
{
"channel_id":"PF9pPK3ptaT0S3O6IvAdpg==",
"name":"assistant",
"type":"relay_assistant",
"catalog_type":"relay_assistant",
"force_switch_on_page":false,
"params":[
],
"is_hidden":false,
"color":"0000ff"
},
{
"channel_id":"CU99wWMBenbrcttp4OcqgQ==",
"type_id":"wnrKdVle5K84vpqC",
"name":"security",
"type":"group",
"catalog_type":"group",
"force_switch_on_page":false,
"params":[
],
"is_hidden":false,
"color":"0000ff"
},
{
"channel_id":"B7Vtnx7uLnFnfTkwmHVZnQ==",
"type_id":"pnFz8VH09CdG5FtUuPo7bPA",
"name":"Console",
"type":"direct_message",
"catalog_type":"direct_message",
"force_switch_on_page":false,
"params":{
"target_stream_name":"Jim",
"target_user_id":"VIRT6LLh9s9pUIjPjuUat9W1MD"
},
"is_hidden":false,
"color":"0000ff"
}
]
}
Updated about 1 year ago