Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Method: projects.agent.restore not working properly

Hi Team, right now I'm trying to restore an agent using this method.
When I do it from the documentation It works, but when I do it from the curl Google provide, I get the same server response, but the restore doesn't happen.

Example:

Empty Bot

Mizar_0-1694865651219.png

Executing from google documentation.

got 200 from server

Mizar_1-1694865713734.png

 

And the chatbot was restored with just this test intent.

Mizar_2-1694865750920.png

then I delete the same intent, and if I call again the method from the documentation will load again this test intent.

Now we are calling the curl, and when executing it, I got the same response format

Mizar_3-1694865853835.png

but when reloading the bot, the restoration hasn't happened.
so server response from curl is telling me, the restoration was fine but when loading the bot, it is not.

Mizar_4-1694865911446.png

Any suggestions?



Solved Solved
0 7 540
1 ACCEPTED SOLUTION

yup, and that is correct. it creates a LONG TIME OPERATION. You have to check the output of that long-time operation to see why is the import failing: https://cloud.google.com/dialogflow/es/docs/how/long-running-operations

So once you call the import endpoint, you have to call the long-time operation that it returns to check the operation itself. 

View solution in original post

7 REPLIES 7

So what you see as a result of your call is a 200 OK and a link to a Long Time Operation. This does not mean that your agent was restored, this means that the long-time operation was successfully created. The long-time operation is the one that imports the agent, you have to query that operation to check the actual status and the errors.

Check these docs: https://cloud.google.com/dialogflow/es/docs/how/long-running-operations

Hi @xavidop both calls take just 3 seconds. There are not differences between then, just that one is from Google Doc and another is a cUrl

yup, and that is correct. it creates a LONG TIME OPERATION. You have to check the output of that long-time operation to see why is the import failing: https://cloud.google.com/dialogflow/es/docs/how/long-running-operations

So once you call the import endpoint, you have to call the long-time operation that it returns to check the operation itself. 

I already see that this starts an Operation and won't send a false even if the import had an error.

So after checking operations, we are able to see the error and fix it after fixing its working fine.

that is awesome! so happy that you figured it out!! I'm curious, what was the issue?

Credentials, when the OAUTH token was created I was using Dialogflow scope instead of Google Auth in general, so after changing the scope it worked

that makes sense! thanks for the input!