- HTTP request
- Request body
- Response body
- Authorization Scopes
- QueryRequestInput
- QueryRequestPayload
- AgentDeviceId
- QueryResponsePayload
Gets the current states in Home Graph for the given set of the third-party user's devices.
The third-party user's identity is passed in via the agentUserId
(see QueryRequest
). This request must be authorized using service account credentials from your Actions console project.
HTTP request
POST https://homegraph.googleapis.com/v1/devices:query
The URL uses gRPC Transcoding syntax.
Request body
The request body contains data with the following structure:
JSON representation |
---|
{
"requestId": string,
"agentUserId": string,
"inputs": [
{
object ( |
Fields | |
---|---|
requestId |
Request ID used for debugging. |
agentUserId |
Required. Third-party user ID. |
inputs[] |
Required. Inputs containing third-party device IDs for which to get the device states. |
Response body
If successful, the response body contains data with the following structure:
Response type for the devices.query
call. This should follow the same format as the Google smart home action.devices.QUERY
response.
Example:
{
"requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
"payload": {
"devices": {
"123": {
"on": true,
"online": true
},
"456": {
"on": true,
"online": true,
"brightness": 80,
"color": {
"name": "cerulean",
"spectrumRGB": 31655
}
}
}
}
}
JSON representation |
---|
{
"requestId": string,
"payload": {
object ( |
Fields | |
---|---|
requestId |
Request ID used for debugging. Copied from the request. |
payload |
Device states for the devices given in the request. |
Authorization Scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/homegraph
For more information, see the OAuth 2.0 Overview.
QueryRequestInput
Device ID inputs to QueryRequest
.
JSON representation |
---|
{
"payload": {
object ( |
Fields | |
---|---|
payload |
Payload containing third-party device IDs. |
QueryRequestPayload
Payload containing device IDs.
JSON representation |
---|
{
"devices": [
{
object ( |
Fields | |
---|---|
devices[] |
Third-party device IDs for which to get the device states. |
AgentDeviceId
Third-party device ID for one device.
JSON representation |
---|
{ "id": string } |
Fields | |
---|---|
id |
Third-party device ID. |
QueryResponsePayload
Payload containing device states information.
JSON representation |
---|
{ "devices": { string: { object }, ... } } |
Fields | |
---|---|
devices |
States of the devices. Map of third-party device ID to struct of device states. An object containing a list of |