Closed fabltd closed 4 years ago
Are you using both an API key and a service account key?
I have tried Just API Key. Just Service account and both. It all cases this command fails.
reportState works with no issue.
Here is my function:
`function testsync() {
const { smarthome } = require('actions-on-google');
const app = smarthome({
key: 'AIAAASyBiHC1G4SXefqsbYxUHIawAAAAAAA' // Changed from Actual Key
});
// ...
// New device is added for user
app.requestSync('1NMWK8AAAEVscJzceSJuLmvGAAA') // Changed from Actual UID
.then((res) => {
console.log('Worked', res)
})
.catch((res) => {
console.log('Failed', res)
});
}`
Further Testing:
With incorrect UID:
Failed {
"error": {
"code": 404,
"message": "Requested entity was not found.",
"status": "NOT_FOUND"
}
}
With Incorrect API KEY:
Failed {
"error": {
"code": 400,
"message": "API key not valid. Please pass a valid API key.",
"status": "INVALID_ARGUMENT",
To add to the error message. The Sync Event Occurs. Stack driver shows the following error:
SYNC: Request ID 337219942982431064 failed with code: OPEN_AUTH_FAILURE
To Add account linking works fine. The device is sync is working the device can be controlled from home. The command errors but the sync occurs and home is updated.
Help...
I was able to have it work fine when using the sample with just a service account key.
It works but I get the error above along with the OPEN_AUTH_FAILURE in stackdriver. I have no idea why and there seems to be very little debugging ? Where are the permissions it is referring to?
Open Auth Failure refers to some issue with the account linking.
This issue has been migrated to the public issue tracker: https://issuetracker.google.com/issues/142048841
When trying to call requestSync in NodeJS the follow undocumented error is shown:
Operation is the same with an API key and Service account.
The same API Key and agentUserId will work with curl!