I've a json object below and passed it as urlParameter
{
"end": {
"dateTime": "2017-10-09T13:30:00",
"timeZone": "America/Denver"
},
"start": {
"dateTime": "2017-10-09T12:00:00",
"timeZone": "America/Denver"
},
"description": "Added through API",
"summary": "Lecture on Global Warming",
"location": "Denver"
}
I've also set the Content-Type as application/json. But I get the error as
{
"error":
{
"errors": [ {
"domain": "global",
"reason": "parseError",
"message": "Parse Error" } ],
"code": 400,
"message": "Parse Error"
}
}
When I send the same request through Try this API its working fine. Please Help!!!
If you're going to do that in actual coding, use 'apostrophes' and not "double quotes" like what's indicated in the Events.insert sample :
var event = {
'summary': 'Google I/O 2015',
'location': '800 Howard St., San Francisco, CA 94103',
'description': 'A chance to hear more about Google\'s developer products.',
'start': {
'dateTime': '2015-05-28T09:00:00-07:00',
'timeZone': 'America/Los_Angeles',
},
'end': {
'dateTime': '2015-05-28T17:00:00-07:00',
'timeZone': 'America/Los_Angeles',
},
'recurrence': [
'RRULE:FREQ=DAILY;COUNT=2'
],
'attendees': [
{'email': 'lpage#example.com'},
{'email': 'sbrin#example.com'},
],
'reminders': {
'useDefault': false,
'overrides': [
{'method': 'email', 'minutes': 24 * 60},
{'method': 'popup', 'minutes': 10},
],
},
};
Related
I am trying to make a few QR buttons appear in my FBM bot app. Everything is working fine, webhook returns text messages to FBM no issue and they are rendered.
However, when I paste in the JSON for the QR buttons, they does not appear in FBM. No errors are recorded.
Oddly if I try some sample JSON for a card it all works !!
Here is the QR JSON snippet I am using. I generated from the dialogflow app.
"fulfillmentMessages": [
{
"quickReplies": {
"title": "Alternative Names",
"quickReplies": [
"Maroon",
"Rouge",
"Rot",
"Reed",
"Fushcia",
"Cyan"
]
},
"platform": "FACEBOOK"
}
]
Here is the code snippet that I used for the card - this works :
"fulfillmentMessages": [
{
"text": {
"text": [
fulfilmsg
]
}
},
{
"text": {
"text": [
"Sorry. xxxxxxxxx"
]
}
},
{
"text": {
"text": [
"Just type xxxxxx again."
]
}
},
{
"card": {
"title": "Available Slots",
"subtitle": "pick one of the slots...",
"imageUri": "https://github.com/fluidicon.png",
"buttons": [
{
"text": "Go to Google",
"postback": "www.google.com"
},
{
"text": "Go to Dialogflow",
"postback": "www.dialogflow.com"
},
{
"text": "Go to Slack",
"postback": "www.slack.com"
}
]
},
"platform": "FACEBOOK"
}
]
Ideally this is what I am expecting to work but doesn't :
"fulfillmentMessages": [
{
"text": {
"text": [
fulfilmsg
]
}
},
{
"text": {
"text": [
"Sorry. This slot xxxxxxx."
]
}
},
{
"text": {
"text": [
"Just type xxxxxx."
]
}
},
{
"quickReplies": {
"title": "Alternative Names",
"quickReplies": [
"Maroon",
"Rouge",
"Rot",
"Reeed",
"Fuscia",
"Cyan"
]
},
"platform": "FACEBOOK"
},
]
Thanks in advance for any consideration.
Here is the payload you can try,
const payloadJson = {
text: 'Quick replies!',
quick_replies: [
{
content_type: 'text',
title: 'How to book order',
payload: 'How to book order'
},
{
content_type: 'text',
title: 'Shipping charges',
payload: 'Shipping charges'
},
{
content_type: 'text',
title: 'Exchange policy',
payload: 'Exchange policy'
},
]
}
Then,
const { Payload } = require('dialogflow-fulfillment')
const payload = new Payload(agent.FACEBOOK, payloadJson, { sendAsMessage: true, rawPayload: false })
agent.add(payload)
I try to process my Azure Analysis Service Cube via logic APP:
In HTTP action I have the following body:
{
"inputs": {
"method": "POST",
"uri": "https://northeurope.asazure.windows.net/servers/xxx/models/xxx/refreshes",
"body": {
"refresh": {
"objects": [
{
"database": "ModelName",
"table": "TableName"
}
],
"type": "full"
}
},
"authentication": {
"type": "ActiveDirectoryOAuth",
"authority": "https://login.windows.net",
"tenant": "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"audience": "https://*.asazure.windows.net",
"clientId": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
"secret": "xxxxYjxx7y5xxskHxxxxxxznxxxxxxxxODX+xxxxxxxx"
}
}
}
After runningthis logic app, I get the following error:
{
"statusCode": 400,
"headers": {
"Strict-Transport-Security": "max-age=xxxxxx00; includeSubDomains",
"x-ms-root-activity-id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
"x-ms-current-utc-date": "2/7/2019 9:25:05 AM",
"x-ms-xmlaerror-extended": "Request parameter RefreshType is not in correct format.",
"Date": "Thu, 07 Feb 2019 09:25:05 GMT",
"Server": "Microsoft-HTTPAPI/2.0",
"Content-Length": "294",
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"code": "BadRequest",
"subCode": 2,
"message": "Request parameter RefreshType is not in correct format.",
"timeStamp": "2019-02-07T09:25:05.4650388Z",
"httpStatusCode": 400,
"details": [
{
"code": "RootActivityId",
"message": "353ab74e-2793-4ee5-954f-819c851f4cb6"
},
{
"code": "Param1",
"message": "RefreshType"
}
]
}
}
Do you have any Idea, why I get this error message? and How can I solve this problem
Refresh Type is an ENUM which only takes values from below list, Can you make the type to Full and check if works:
Hope it helps.
I am trying to integrate my application with Dialogflow and Sending the request to Mulesoft and from there it is sending back the response in format mentioned in Webhook guide.
Below is the API request and response that is shown in Diagnostic info:-
Fulfillment Request:-
{
"responseId": "da851e5f-b6c3-4a17-bfdf-ad935d5003f6",
"queryResult": {
"queryText": "Open the report opportunity by Type where Type equals to New Customer",
"parameters": {
"reportName": "opportunity by Type",
"filterField": "Type",
"filterOperator": "equals",
"filterValue": "New Customer"
},
"allRequiredParamsPresent": true,
"fulfillmentText": "Displaying the report opportunity by Type where Type equals New Customer",
"fulfillmentMessages": [
{
"platform": "ACTIONS_ON_GOOGLE",
"simpleResponses": {
"simpleResponses": [
{
"textToSpeech": "Displaying the report opportunity by Type where Type equals New Customer"
}
]
}
},
{
"platform": "ACTIONS_ON_GOOGLE",
"simpleResponses": {
"simpleResponses": [
{
"textToSpeech": "Displaying the requested report on CRM"
}
]
}
},
{
"text": {
"text": [
"Displaying the report opportunity by Type where Type equals New Customer"
]
}
}
],
"intent": {
"name": "projects/sfdcconnect-68886/agent/intents/ef6d8d78-4dbf-4fb5-b647-4b427ca4dfa5",
"displayName": "show.report"
},
"intentDetectionConfidence": 1,
"languageCode": "en"
},
"originalDetectIntentRequest": {
"payload": {}
},
"session": "projects/sfdcconnect-68886/agent/sessions/4c9c3310-52ab-dbb5-73a8-b104ba55676e"
}
Fulfillment Response:-
{
"fulfillmentText": "This is a text response from Mulesoft",
"fulfillmentMessages": [
{
"card": {
"title": "card title",
"subtitle": "card text",
"imageUri": "https://assistant.google.com/static/images/molecule/Molecule-Formation-stop.png",
"buttons": [
{
"text": "button text",
"postback": "https://assistant.google.com/"
}
]
}
}
],
"source": "example.com",
"payload": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "this is a simple response from Mulesoft"
}
}
]
}
},
"facebook": {
"text": "Hello, Facebook!"
},
"slack": {
"text": "This is a text response for Slack."
}
},
"outputContexts": [
{
"name": "projects/sfdcconnect-68886/agent/sessions/4c9c3310-52ab-dbb5-73a8-b104ba55676e/contexts/context name",
"lifespanCount": 5,
"parameters": {
"param": "param value"
}
}
],
"followupEventInput": {
"name": "event name",
"languageCode": "en-US",
"parameters": {
"param": "param value"
}
}
}
Under Raw API response:-
"webhookStatus": {
"code": 3,
"message": "Webhook call failed. Error: Webhook response was empty."
}
Fulfillment Status:-
Webhook call failed. Error: Webhook response was empty.
I have gone through multiple articles and validated that JSOn response is also correct. Also tried deleting the existing project and created a new one.
When testing this in Google actions, due to this error it is showing below error there as well:-
MalformedResponse
'final_response' must be set.
Is there any way to fix this error.
The action is being performed on Mulesoft end and response is being sent, it is just that it is not able to display the response under textToSpeech section to Google action/dialogflow.
Regards,
Rajat
The problem seems to be with the followUpEventInput / outputContexts, remove them as they're optional, or fill them properly.
WebHook Response Format
Below is the payload generated for SYNC intent. When tested in smart home validator it parses the json without any issue.
Sync Response Payload:
{
"payload": {
"agentUserId": "myhome",
"devices": [
{
"traits": [
"action.devices.traits.OnOff"
],
"willReportState": false,
"name": {
"defaultNames": [],
"name": "Sky Light",
"nicknames": []
},
"attributes": [],
"customData": "",
"id": "BED_LIGHT",
"type": "action.devices.types.LIGHT",
"deviceInfo": {
"swVersion": "1.0",
"model": "Light",
"manufacturer": "Connected Smart Life",
"hwVersion": "1.0"
}
},
{
"traits": [
"action.devices.traits.OnOff"
],
"willReportState": false,
"name": {
"defaultNames": [],
"name": "Ruthu Room Round Light",
"nicknames": []
},
"attributes": [],
"customData": "",
"id": "SWITCH94",
"type": "action.devices.types.LIGHT",
"deviceInfo": {
"swVersion": "1.0",
"model": "Light",
"manufacturer": "Connected Smart Life",
"hwVersion": "1.0"
}
}
]
},
"requestId": "18338945788402571764"
}
But, Google Assistant Actions failed to parse this and the log shows below erros:
{
insertId: "1ha0kvhg1kf0a0t"
logName: "projects/connectedghome/logs/actions.googleapis.com%2Factions"
receiveTimestamp: "2018-05-05T21:04:27.318451222Z"
resource: {…}
severity: "ERROR"
textPayload: "SYNC: Request ID 18338945788402571764 update devices failed: INVALID_ARGUMENT. Detail: Error: [Expect a map object but found: []] while parsing JSON [{"payload":{"agentUserId":"myhome","devices":[{"attributes":[],"customData":"","deviceInfo":{"hwVersion":"1.0","manufacturer":"Connected Smart Life","model":"Light","swVersion":"1.0"},"id":"BED_LIGHT","name":{"defaultNames":[],"name":"Sky Light","nicknames":[]},"traits":["action.devices.traits.OnOff"],"type":"action.devices.types.LIGHT","willReportState":false},{"attributes":[],"customData":"","deviceInfo":{"hwVersion":"1.0","manufacturer":"Connected Smart Life","model":"Light","swVersion":"1.0"},"id":"SWITCH94","name":{"defaultNames":[],"name":"Ruthu Room Round Light","nicknames":[]},"traits":["action.devices.traits.OnOff"],"type":"action.devices.types.LIGHT","willReportState":false}]},"requestId":"18338945788402571764"}]"
timestamp: "2018-05-05T21:04:27.284259780Z"
}
Am I missing something here?
Attributes should be a JSON object or not defined.
I've been struggling with getting an assistant app to respond correctly.
This app is written with Google Actions SDK (there are no other components such as Dialogflow or Converse.ai).
The action package for the app looks something like this:
{
"actions":[
{
"description": "Default Welcome Intent",
"name": "MAIN",
"fulfillment": {
"conversationName": "ACTION_INTENT_MAIN"
},
"intent": {
"name": "actions.intent.MAIN",
"trigger": {
"queryPatterns": [
"talk to gactions integration"
]
}
}
}
],
"conversations":{
"ACTION_INTENT_MAIN": {
"name": "ACTION_INTENT_MAIN",
"url": "https://my.custom.end/point"
}
},
"locate":"en"
}
This is the JSON request that I recieve on https://my.custom.end/pont:
{
"user": {
"userId": "<a-user-id-sent-by-GOOG>",
"locale": "en-US",
"lastSeen": "2018-01-31T09:33:07Z"
},
"conversation": {
"conversationId": "1517393479793",
"type": "NEW"
},
"inputs": [
{
"intent": "actions.intent.MAIN",
"rawInputs": [
{
"inputType": "KEYBOARD",
"query": "Talk to Gactions Integration"
}
]
}
],
"surface": {
"capabilities": [
{
"name": "actions.capability.AUDIO_OUTPUT"
},
{
"name": "actions.capability.SCREEN_OUTPUT"
},
{
"name": "actions.capability.MEDIA_RESPONSE_AUDIO"
},
{
"name": "actions.capability.WEB_BROWSER"
}
]
},
"isInSandbox": true,
"availableSurfaces": [
{
"capabilities": [
{
"name": "actions.capability.AUDIO_OUTPUT"
},
{
"name": "actions.capability.SCREEN_OUTPUT"
}
]
}
]
}
An on the simulator, I end up getting this response: API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: ": Cannot find field.".
I can confirm that the incoming request has the google-actions-api-version set to 2.
This is the sharedDebugInfo section from the Actions on Google simulator:
[
{
"name": "ResponseValidation",
"subDebugEntry": [
{
"debugInfo": "API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: \": Cannot find field.\".",
"name": "UnparseableJsonResponse"
}
]
}
]
The oh-so-informative error message lacks the name of the field that cannot be found.
And this is when I'm doing everything described here
UPDATE - 01 February, 2018, 11:52 AM
These are the full contents of the debug tab:
{
"audioResponse": "//NExAAQaE...",
"conversationToken": "GidzaW11bG...",
"debugInfo": {
"agentToAssistantDebug": {
"agentToAssistantJson": "{\"conversationToken\":\"{\\\"state\\\":null,\\\"data\\\":{}}\",\"expectUserResponse\":true,\"expectedInputs\":[{\"inputPrompt\":{\"noInputPrompts\":[],\"richInitialPrompt\":{\"items\":[{\"simpleResponse\":{\"textToSpeech\":\"You're now talking to GActions Integration\",\"displayText\":\"You're now talking to GActions Integration\"}},{\"basicCard\":{\"buttons\":[{\"title\":\"Some Reddit to chill\",\"openUrlAction\":{\"url\":\"https://www.reddit.com\"}}],\"formattedText\":\"Here's some simp-wave to relax and chill out to\",\"image\":{\"url\":\"http://tracks.arte.tv/sites/default/files/styles/jscrop_1007x566/public/c_simpsons_2.jpg?itok=INzKpsvK\",\"accessibilityText\":\"A World of Simpsonwave\"},\"title\":\"A World of Simpsonwave\",\"imageDisplayOptions\":\"CROPPED\"}}],\"suggestions\":[]}},\"possibleIntents\":[{\"intent\":\"actions.intent.TEXT\"}]}],\"resetUserStorage\":false,\"userStorage\":\"{}\",\"finalResponse\":null,\"isInSandbox\":true,\"customPushMessage\":null,\"speech\":\"You're now talking to GActions Integration. \",\"displayText\":\"You're now talking to GActions Integration. \"}"
},
"assistantToAgentDebug": {
"assistantToAgentJson": "{\"user\":{\"userId\":\"ABwppHHHw9N9TYh-scJ5GhZtmpfFcQU2xbQBAgW1qhdllI45fimQ5QKFEVRfs2iMm6uCDJIQMApo1UZLmmnif8wqlNARnsVH744\",\"locale\":\"en-US\",\"lastSeen\":\"2018-02-01T06:04:59Z\"},\"conversation\":{\"conversationId\":\"1517465629416\",\"type\":\"NEW\"},\"inputs\":[{\"intent\":\"actions.intent.MAIN\",\"rawInputs\":[{\"inputType\":\"VOICE\",\"query\":\"Talk to Gactions Integration\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.WEB_BROWSER\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.MEDIA_RESPONSE_AUDIO\"}]},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"}]}]}",
"curlCommand": "curl -v https://firedev.arrowai.com/integrations/goog-actions/messages/59f6b4bf8d16126f008b456a/5a619bf72c971189008b4569 -H 'Content-Type: application/json;charset=UTF-8' -H 'Google-Actions-API-Version: 2' -H 'Authorization: eyJhbGciOiJSUzI1NiIsImtpZCI6IjI2YzAxOGIyMzNmZTJlZWY0N2ZlZGJiZGQ5Mzk4MTcwZmM5YjI5ZDgifQ.eyJhdWQiOiJnYWN0aW9ucy1hcnJvd2FpLWludGVncmF0ZSIsImF6cCI6IjQ2NDA5MDk1NDc2Ny0xOWl2bnUxdjFwYXFpdWdodDJqYXJwcTJwaGtmNGRyMS5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbSIsImV4cCI6MTUxNzQ2NTc0OSwiaXNzIjoiaHR0cHM6Ly9hY2NvdW50cy5nb29nbGUuY29tIiwianRpIjoiZTgxNzlmN2FkZGYwYWZmYjYwNzk0MDg5MzIyN2E0MWU1NDZkZWMyOCIsImlhdCI6MTUxNzQ2NTYyOSwibmJmIjoxNTE3NDY1MzI5fQ.rmUxBhIirV0UnZvTLYYw4AtRQfNDF-3O6CaoXxD2BDZSufgfKFHz7aIUgJzUillBm4zOLFiV6SnXndIoYCG6JK60YK5tHLpqbV-P3C-5U3N05RuY7hpj1Q_B027bgUv-p7QWlg-7DmPkROmN3b3a_FsUeWqTxx5Bu5M551k_CpKvSSBzPMEB2Cw9TzGkiY9avYrISTLLxWl2JE7qKAT6P0zBbE6cdO04CxGddGNmEPkckRICsdSJ5j_wmjy3I-ItAgx3dKoDfFLW6gCI4y5MFsGFJY6cFc2e01nodslf9GlQzAhR_a4aHRRIDl47HT_b9aKpyULV3kiRR41mUkyYZw' -A 'Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)' -X POST -d '{\"user\":{\"userId\":\"ABwppHHHw9N9TYh-scJ5GhZtmpfFcQU2xbQBAgW1qhdllI45fimQ5QKFEVRfs2iMm6uCDJIQMApo1UZLmmnif8wqlNARnsVH744\",\"locale\":\"en-US\",\"lastSeen\":\"2018-02-01T06:04:59Z\"},\"conversation\":{\"conversationId\":\"1517465629416\",\"type\":\"NEW\"},\"inputs\":[{\"intent\":\"actions.intent.MAIN\",\"rawInputs\":[{\"inputType\":\"VOICE\",\"query\":\"Talk to Gactions Integration\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.WEB_BROWSER\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.MEDIA_RESPONSE_AUDIO\"}]},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"}]}]}'"
},
"sharedDebugInfo": [
{
"name": "ResponseValidation",
"subDebugEntry": [
{
"debugInfo": "API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: \": Cannot find field.\".",
"name": "UnparseableJsonResponse"
}
]
}
]
},
"response": "Gactions integration isn't responding right now. Try again soon.",
"visualResponse": {
"visualElements": []
}
}
This the agentToAssistantDebug object:
{
"conversationToken": "{\"state\":null,\"data\":{}}",
"expectUserResponse": true,
"expectedInputs": [
{
"inputPrompt": {
"noInputPrompts": [],
"richInitialPrompt": {
"items": [
{
"simpleResponse": {
"textToSpeech": "You're now talking to GActions Integration",
"displayText": "You're now talking to GActions Integration"
}
},
{
"basicCard": {
"buttons": [
{
"title": "Some Reddit to chill",
"openUrlAction": {
"url": "https://www.reddit.com"
}
}
],
"formattedText": "Here's some simp-wave to relax and chill out to",
"image": {
"url": "http://tracks.arte.tv/sites/default/files/styles/jscrop_1007x566/public/c_simpsons_2.jpg?itok=INzKpsvK",
"accessibilityText": "A World of Simpsonwave"
},
"title": "A World of Simpsonwave",
"imageDisplayOptions": "CROPPED"
}
}
],
"suggestions": []
}
},
"possibleIntents": [
{
"intent": "actions.intent.TEXT"
}
]
}
],
"resetUserStorage": false,
"userStorage": "{}",
"finalResponse": null,
"isInSandbox": true,
"customPushMessage": null,
"speech": "You're now talking to GActions Integration. ",
"displayText": "You're now talking to GActions Integration. "
}
Additionally, this is the JSON response that is being generated:
{
"conversationToken": "{\"state\":null,\"data\":{}}",
"expectUserResponse": true,
"expectedInputs": [
{
"inputPrompt": {
"noInputPrompts": [],
"richInitialPrompt": {
"items": [
{
"simpleResponse": {
"textToSpeech": "You're now talking to GActions Integration",
"displayText": "You're now talking to GActions Integration"
}
},
{
"basicCard": {
"buttons": [
{
"title": "Some Reddit to chill",
"openUrlAction": {
"url": "https://www.reddit.com"
}
}
],
"formattedText": "Here's some simp-wave to relax and chill out to",
"image": {
"url": "http://tracks.arte.tv/sites/default/files/styles/jscrop_1007x566/public/c_simpsons_2.jpg?itok=INzKpsvK",
"accessibilityText": "A World of Simpsonwave"
},
"title": "A World of Simpsonwave",
"imageDisplayOptions": "CROPPED"
}
}
],
"suggestions": []
}
},
"possibleIntents": [
{
"intent": "actions.intent.TEXT"
}
]
}
],
"resetUserStorage": false,
"userStorage": "{}",
"finalResponse": null,
"isInSandbox": true,
"customPushMessage": null,
"speech": "You're now talking to GActions Integration. ",
"displayText": "You're now talking to GActions Integration. "
}
The issue seems to be related with your response JSON. As you can see in the documentation regarding the response JSON.
"speech": "You're now talking to GActions Integration. ",
"displayText": "You're now talking to GActions Integration. "
The above are not valid parameters. Instead your response JSON should look like:
{
"conversationToken": "{\"state\":null,\"data\":{}}",
"expectUserResponse": true,
"expectedInputs": [
{
"inputPrompt": {
"noInputPrompts": [],
"richInitialPrompt": {
"items": [
{
"simpleResponse": {
"textToSpeech": "You're now talking to GActions Integration",
"displayText": "You're now talking to GActions Integration"
}
},
{
"basicCard": {
"buttons": [
{
"title": "Some Reddit to chill",
"openUrlAction": {
"url": "https://www.reddit.com"
}
}
],
"formattedText": "Here's some simp-wave to relax and chill out to",
"image": {
"url": "http://tracks.arte.tv/sites/default/files/styles/jscrop_1007x566/public/c_simpsons_2.jpg?itok=INzKpsvK",
"accessibilityText": "A World of Simpsonwave"
},
"title": "A World of Simpsonwave",
"imageDisplayOptions": "CROPPED"
}
}
],
"suggestions": []
}
},
"possibleIntents": [
{
"intent": "actions.intent.TEXT"
}
]
}
],
"resetUserStorage": false,
"userStorage": "{}",
"finalResponse": null,
"isInSandbox": true,
"customPushMessage": null
}
Edit if you use the nodejs sdk check if the response from the google sdk function is correct json and if your server answer with correct json. maybe its change the format etc?
Try it with an action.json style like the first. And the more important question how is your response to the request looking? try that json in the style the last code below creates
{
"locale": "en",
"actions": [
{
"name": "text",
"intent": {
"name": "actions.intent.TEXT",
"trigger": {
"queryPatterns": [
"some text"
]
}
},
"fulfillment": {
"conversationName": "conv name"
}
},
{
"description": "Default Welcome Intent",
"name": "MAIN",
"fulfillment": {
"conversationName": "conv name"
},
"intent": {
"name": "actions.intent.MAIN",
"trigger": {
"queryPatterns": [
"open my test app",
"open hi fish"
]
}
}
}
],
"types": [],
"conversations": {
"conv name": {
"name": "conv name",
"url": "https://yourendpoint.com/something",
"fulfillmentApiVersion": 2,
"in_dialog_intents": [
{
"name": "actions.intent.NO_INPUT"
},
]
}
}
}
this here is a function that create an valid response:
/**
message = string
slots = array
state = object
**/
function answerWithMessage(message,slots,state){
let display = message.replace(/<[^>]*>/g, '');
let voicemessage = message.toLowerCase();
let jsonResponse = {
conversationToken: JSON.stringify(state),
expectUserResponse: true,
expectedInputs: [
{
inputPrompt: {
richInitialPrompt: {
items: [
{
simpleResponse: {
ssml: voicemessage,
displayText: display,
},
}
],
}
},
possibleIntents: [
{
intent: "actions.intent.TEXT"
}
],
speechBiasingHints: slots
}
]
};
return JSON.stringify(jsonResponse,null, 4);
}
And here is a repro with example google actions sdk: https://github.com/haukedau/googleActionsInit but the answer there is not completly correct but it will do the work as well above response message style is better.
Hi I think your issue is just you call an object
"inputPrompt": {
and an array but both are in the same position look in the explanation below.
"noInputPrompts": [],
https://developers.google.com/actions/assistant/helpers#calling_the_helper_1
I hope I could help you.
Best regards
Patrick