actions on google - Request Sync always returns 404 : "Error: Requested entity was not found."


Question: 

I'm having a hard time implementing requestSync. It always returns

  "error": {
    "code": 404,
    "message": "Requested entity was not found.",
    "status": "NOT_FOUND"
  }

I use Node.js/Express for the backend. The linking/unlinking with the Google Home app work and my actions work as well. It's really the requestSync part that fails.

The closest ticket I've found, though not exactly the same, is this one.

Things I've tried

  • agentUserId is a string, but if I pass it a number it returns a 400 with the message "Invalid value at 'agent_user_id'".

  • tried sending agent_user_id instead of agentUserId, this returns a 404 the same error as when I send a agentUserId

  • tried removing the "async:true" part of the body. did not notice a difference.
  • during SYNC, hardcoded the value of the agentUserId to eliminate possibility that I'm sending the wrong one. I use that same agentUserId during requestSync and this fails.
  • tried linking/unlinking multiple times in the google home app
  • another interesting thing to note : when opening up the "Test Suite" from the actions on google console, I put in that same agentUserId + service account key, and it registers it well : I'm able to see my devices listed correctly. Which leads me to believe that my agentUserId is correct (this may be a false assumption)
  • I'm 100% sure HomeGraph is enabled as I can see data on the charts in the "Overview" section of the HomeGraph API part of the console.

This is what the curl looks like (same as from the example)

curl -i -s -X POST -H "Content-Type: application/json" -d "{agent_us
er_id: \"1\"}" "https://homegraph.googleapis.com/v1/devices:requestSyn
c?key=API_KEY"

(my agentUserId is 1 in this case)

And this is what it looks like in code :

    const res = await fetch(
      `https://homegraph.googleapis.com/v1/devices:requestSync?key=${config.googleApiKey}`,
      {
        method: 'POST',
        body: JSON.stringify({
          agentUserId: String(userId),
          async: true,
        }),
        headers: { 'Content-Type': 'application/json' },
      },
    );

Regardless of what I do, the result is always :

  "error": {
    "code": 404,
    "message": "Requested entity was not found.",
    "status": "NOT_FOUND"
  }

I don't know where else to look to identify this problem. Any pointers would help. Thank you




1 Answer: 

Finally found the answer.

It wasn't too far from the one I had posted above. Although my problem is that when I generated an API key, the google home cloud console opened the wrong project by default. I had the wrong API key all along.

 

More Articles


java - Paypal expressCheckout integration (DoExpressCheckout) error

I have a ExpressCheckout integration setup in java google app engine and it working up to GetExpresschekout .but in finall call(DoExpressCheckout) I am unable to Authorize payment .it returnsan errorRESULT=1000&PNREF=E24P1FBB8FA4&RESPMSG=Generic processor error: 13116-The transaction is in p

actions on google - Implementing Conversation Webhook as Azure Function App

I have an azure function app that I am using as a webhook for my google assistant action. I've tried to follow the documentation for the proper response but I continually get the following error in the simulator when testing my webhook. Is there anything in my response message that looks wrong?Fai

node.js - Correct way to send response when using Actions-on-google with koa.js

I'm trying to use actions-on-google with koa framework. I can't understand which request and response to use with AoG constructor in koa middleware. This is my code:const Koa = require( 'koa' )const koaBody = require('koa-body')const { DialogflowApp } = require('actions-on-google')const koaApp = new


Logs showing WARNING when trying to credit bank accounts with Balanced Payments

Been seeing this in my logs today. ############################################################# # WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! # ############################################################# Using positional arguments is **DEPRECATED**. Please use the keyword optio

node.js - BotBuilder TypeError: builder.ConsoleConnector is not a constructor

I'm following the official quick start of Microsoft Bot Builder(SDK v3) for NodeJs: Create a bot with the Bot Builder SDK for Node.js 1- I made a new project with npm init2- then npm install --save botbuilder3- then I created a new file "app.js"var builder = require('botbuilder');var connector =

java - How can I use the response from a JOptionPane?

This is the first time I have used a confirm box and I'd like some advice on how to use it please, I want to use the users input of "Yes or No" but not sure how to do it? If I wanted to reference the input from the JOptionPane in an if statement how would go about it?JOptionPane.showConfirmDialog(nu


dialogflow - how to define 'App' statement in firestore database?

I have to define 'app' inorder to store user details from dialogflow to firestore databaseconst app = new App({request:request, response:response});inorder to use this line of code i need 'App' to be defined in firestore code,for which i have used this line,const App = require('firebase-functions')

Magento: Where does Magento 1.8 store payment method options in the database?

Where does Magento store payment method options in the database?I looked around and did not find it.

java - JFrame as a dialog

I want to customize the jframe and that frame should work like a joptionpane. which is relative with parent. can i do like this. if it is possible please any one help me.

Magento Payment methods are not showing in checkout

I have a website in magento. iam using payment methods paypal, bank transfer and stripe. using multi store view(3)Except paypal remaning payment methods are not showing in checkout process. i dont know what to do. please help me any one,Thanks,