Coder Social home page Coder Social logo

Comments (20)

mishushakov avatar mishushakov commented on August 15, 2024

@atulep could you assist? thanks

from assistant-actions-nodejs.

ujja avatar ujja commented on August 15, 2024

@mishushakov I have the same problem. Do you have any progress there?

from assistant-actions-nodejs.

mishushakov avatar mishushakov commented on August 15, 2024

@ujja nope 😞

from assistant-actions-nodejs.

ujja avatar ujja commented on August 15, 2024

@mishushakov I have just a very basic action. I did not publish it.

I called just the writePreview endpoint (which fails now with internal error, but last week was working), then tried the sendInteraction endpoint.

I suppose now that there is some missing magical property/setting. Is yours published?

from assistant-actions-nodejs.

mishushakov avatar mishushakov commented on August 15, 2024

my action is not published
i don't know what causes the error and there is no explanation anywhere to be found on the internet

from assistant-actions-nodejs.

atulep avatar atulep commented on August 15, 2024

Hello @mishushakov, I apologize for a late reply here. It's not clear to me what's wrong yet. Typically, 400 error messages contain some useful info in details, which is how I usually debug. Is there a way you can inspect a response object?

from assistant-actions-nodejs.

mishushakov avatar mishushakov commented on August 15, 2024

full response body from auth.client

{
  "response":{
    "config":{
      "url":"https://actions.googleapis.com/v2/projects/action-builder-test-40291:sendInteraction",
      "method":"POST",
      "data":{
        "input":{
          "query":"Talk to Action builder test",
          "type":"KEYBOARD"
        },
        "deviceProperties":{
          "surface":"PHONE",
          "location":{
            "coordinates":{
              "latitude":-90,
              "longitude":-90
            },
            "formattedAddress":"1600 Amphitheatre Pkwy, Mountain View, CA 94043",
            "zipCode":"94043",
            "city":"Mountain View"
          },
          "locale":"en",
          "timeZone":"America/New_York"
        },
        "conversationToken":"test"
      },
      "headers":{
        "Authorization":"Bearer ya29.c.KqAB_gcwDaaI8ZOg9Xcf_uYVjTaRaCXYYBIZpkxRIHmDPY36vQzeIn1T8w8WQzk33RFQc7J1NGru8GCUkYp86b44YjImPY2AydaVjCxbpbV6DZqRHJht47Vwu_BGVBxXjAxU6zPRspJlLkfqRauKYr_HE3aqaGtFJutl7U_NaoQpIR476Wel04862oaakiA3GRhwW-CaZzGCJECUgqMURH9OvA",
        "User-Agent":"google-api-nodejs-client/7.0.4",
        "x-goog-api-client":"gl-node/14.15.5 auth/7.0.4",
        "Content-Type":"application/json",
        "Accept":"application/json"
      },
      "body":"{\"input\":{\"query\":\"Talk to Action builder test\",\"type\":\"KEYBOARD\"},\"deviceProperties\":{\"surface\":\"PHONE\",\"location\":{\"coordinates\":{\"latitude\":-90,\"longitude\":-90},\"formattedAddress\":\"1600 Amphitheatre Pkwy, Mountain View, CA 94043\",\"zipCode\":\"94043\",\"city\":\"Mountain View\"},\"locale\":\"en\",\"timeZone\":\"America/New_York\"},\"conversationToken\":\"test\"}",
      "responseType":"json"
    },
    "data":{
      "error":{
        "code":400,
        "message":"Interaction did not trigger the preview of an action.",
        "errors":[
          {
            "message":"Interaction did not trigger the preview of an action.",
            "domain":"global",
            "reason":"badRequest"
          }
        ],
        "status":"INVALID_ARGUMENT"
      }
    },
    "headers":{
      "alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"",
      "cache-control":"private",
      "connection":"close",
      "content-encoding":"gzip",
      "content-type":"application/json; charset=UTF-8",
      "date":"Tue, 11 May 2021 10:11:20 GMT",
      "server":"ESF",
      "transfer-encoding":"chunked",
      "vary":"Origin, X-Origin, Referer",
      "x-content-type-options":"nosniff",
      "x-frame-options":"SAMEORIGIN",
      "x-xss-protection":"0"
    },
    "status":400,
    "statusText":"Bad Request",
    "request":{
      "responseURL":"https://actions.googleapis.com/v2/projects/action-builder-test-40291:sendInteraction"
    }
  },
  "config":{
    "url":"https://actions.googleapis.com/v2/projects/action-builder-test-40291:sendInteraction",
    "method":"POST",
    "data":{
      "input":{
        "query":"Talk to Action builder test",
        "type":"KEYBOARD"
      },
      "deviceProperties":{
        "surface":"PHONE",
        "location":{
          "coordinates":{
            "latitude":-90,
            "longitude":-90
          },
          "formattedAddress":"1600 Amphitheatre Pkwy, Mountain View, CA 94043",
          "zipCode":"94043",
          "city":"Mountain View"
        },
        "locale":"en",
        "timeZone":"America/New_York"
      },
      "conversationToken":"test"
    },
    "headers":{
      "Authorization":"Bearer ya29.c.KqAB_gcwDaaI8ZOg9Xcf_uYVjTaRaCXYYBIZpkxRIHmDPY36vQzeIn1T8w8WQzk33RFQc7J1NGru8GCUkYp86b44YjImPY2AydaVjCxbpbV6DZqRHJht47Vwu_BGVBxXjAxU6zPRspJlLkfqRauKYr_HE3aqaGtFJutl7U_NaoQpIR476Wel04862oaakiA3GRhwW-CaZzGCJECUgqMURH9OvA",
      "User-Agent":"google-api-nodejs-client/7.0.4",
      "x-goog-api-client":"gl-node/14.15.5 auth/7.0.4",
      "Content-Type":"application/json",
      "Accept":"application/json"
    },
    "body":"{\"input\":{\"query\":\"Talk to Action builder test\",\"type\":\"KEYBOARD\"},\"deviceProperties\":{\"surface\":\"PHONE\",\"location\":{\"coordinates\":{\"latitude\":-90,\"longitude\":-90},\"formattedAddress\":\"1600 Amphitheatre Pkwy, Mountain View, CA 94043\",\"zipCode\":\"94043\",\"city\":\"Mountain View\"},\"locale\":\"en\",\"timeZone\":\"America/New_York\"},\"conversationToken\":\"test\"}",
    "responseType":"json"
  },
  "code":400,
  "errors":[
    {
      "message":"Interaction did not trigger the preview of an action.",
      "domain":"global",
      "reason":"badRequest"
    }
  ]
}

from assistant-actions-nodejs.

mishushakov avatar mishushakov commented on August 15, 2024

is there anything i'd need to do on the actions side?

from assistant-actions-nodejs.

ujja avatar ujja commented on August 15, 2024
{
    "code": 3,
    "details": "Interaction did not trigger the preview of an action.",
    "metadata": {
        "internalRepr": {},
        "options": {}
    }
}

from assistant-actions-nodejs.

ujja avatar ujja commented on August 15, 2024

I have created more projects with dialogflow, and with actions sdk.

Has tried with my company account and with my private one. Everyone failed with the same result.

Maybe it is possible to reproduce it on a new project (I have used Conversation Components sample).

from assistant-actions-nodejs.

atulep avatar atulep commented on August 15, 2024

@mishushakov,

It appears to be the reference docs are missing one field in the SendInteractionRequest: project. It should be a string in the following format: projects/{projectId}. Can you include that in your request and try again?

We'll update the reference. However, I'd also recommend checkout out googleapis repo as it contains Actions API protos and is updated automatically when we make public facing changes. For example, the project field is listed there.

I was only able to figure this out by looking at server logs, so I'll see if we can improve the error message in the API response.

from assistant-actions-nodejs.

mishushakov avatar mishushakov commented on August 15, 2024

hey,
i have added project field to my SendInteractionRequest, but i still get the same error

from assistant-actions-nodejs.

atulep avatar atulep commented on August 15, 2024

@mishushakov, I apologize for delayed reply here - I'm just coming back from vacation.

Did you call WritePreview endpoint before invoking SendInteraction?

from assistant-actions-nodejs.

mishushakov avatar mishushakov commented on August 15, 2024

hey, i didn't call WritePreview

from assistant-actions-nodejs.

atulep avatar atulep commented on August 15, 2024

Can you try that? Calling WritePreview is a prerequisite for calling SendInteraction.

from assistant-actions-nodejs.

mishushakov avatar mishushakov commented on August 15, 2024

sorry, can i call WritePreview method from the actions console?
docs didn't mention it was a prerequisite for SendInteraction...

from assistant-actions-nodejs.

atulep avatar atulep commented on August 15, 2024

I don't think you can call it from the Console. You should use WritePreview in your code. The README in this repo shows some sample code - https://github.com/actions-on-google/assistant-actions-nodejs#using-the-client-library.

from assistant-actions-nodejs.

mishushakov avatar mishushakov commented on August 15, 2024

thanks a lot, i tried a bit harder this time and was finally able to trigger my action!

Screenshot 2021-06-07 at 14 52 29

thanks for all your support 👍

from assistant-actions-nodejs.

ujja avatar ujja commented on August 15, 2024

@mishushakov What did you changed?

from assistant-actions-nodejs.

mishushakov avatar mishushakov commented on August 15, 2024

@ujja i have called WritePreview in my code, after that i was able to trigger the interaction

from assistant-actions-nodejs.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.