Google-assistant integration dialog flow: List not working in google assistant - actions-on-google

I am sending both simple_response and list_card in messages to dialog flow but google assistant stops responding
After response from webhook my json in dialog flow looks like:
{
"id": "c8d70d1a-fe39-4417-94a8-f586db516961",
"timestamp": "2017-12-04T09:40:11.687Z",
"lang": "en",
"result": {
"source": "agent",
"resolvedQuery": "Popular Science",
"action": "searchWithCategory",
"actionIncomplete": false,
"parameters": {
"any": "Popular Science"
},
"contexts": [
{
"name": "filter",
"parameters": {
"item": "library",
"any.original": "Popular Science",
"any": "Popular Science"
},
"lifespan": 5
}
],
"metadata": {
"intentId": "12a29272-a89d-4fae-b4f8-497f75f6f1d1",
"webhookUsed": "true",
"webhookForSlotFillingUsed": "false",
"webhookResponseTime": 331,
"intentName": "searchStoriesWithCategory"
},
"fulfillment": {
"speech": "We have found 2 articles for you",
"source": "webhook",
"displayText": "We have found 2 articles for you",
"messages": [
{
"speech": "We have found 2 articles for you",
"type": 0
},
{
"textToSpeech": "We have found 2 articles for you",
"type": "simple_response",
"platform": "google"
},
{
"title": "We have found 2 articles for you",
"type": "list_card",
"items": [
{
"image": {
"url": "http://image1.example.png"
},
"optionInfo": {
"synonyms": [
"P"
],
"key": "PubMed: Swine Flu"
},
"description": "PubMed: Swine Flu",
"title": "PubMed: Swine Flu"
},
{
"image": {
"url": "http://image1.example.png"
},
"optionInfo": {
"synonyms": [
"L"
],
"key": "Local Level - Resolving community Issues"
},
"description": "Local Level - Resolving community Issues",
"title": "Local Level - Resolving community Issues"
}
],
"platform": "google"
}
]
},
"score": 1
},
"status": {
"code": 200,
"errorType": "success",
"webhookTimedOut": false
},
"sessionId": "002e6053-78c1-49ee-a9dc-76df21fac798"
}

Related

Sabre BargainFinderMax REST API error for /offers/shop for southwest airlines (IATA code: WN)

We are trying to use BargainFinderMax REST API v3/offers/shop and /v4/offers/shop for southwest airlines (WN) but getting errors for the following requests in the CERT environment
We have tied both the old & new domain name endpoints (as per https://developer.sabre.com/guides/travel-agency/developer-guides/api-endpoints) but still throwing the error
New Endpoints:
https://api.cert.platform.sabre.com/v4/offers/shop
https://api.cert.platform.sabre.com/v3/offers/shop
Old Endpoints:
https://api-crt.cert.havail.sabre.com/v4/offers/shop
https://api-crt.cert.havail.sabre.com/v3/offers/shop
Request#1:
{
"OTA_AirLowFareSearchRQ": {
"MaxResponses": "10",
"OriginDestinationInformation": [{
"RPH": "1",
"DepartureDateTime": "2022-08-19T00:00:00",
"OriginLocation": {
"LocationCode": "SFO"
},
"DestinationLocation": {
"LocationCode": "LAX"
},
"TPA_Extensions": {
"SegmentType": {
"Code": "O"
}
}
}],
"POS": {
"Source": [{
"PseudoCityCode": "xxxx",
"RequestorID": {
"CompanyName": {
"Code": "TN"
},
"ID": "xxx.xx",
"Type": "x.xxx.x"
}
}]
},
"TravelPreferences": {
"MaxStopsQuantity": 99,
"TPA_Extensions": {
"DataSources": {
"ATPCO": "Enable",
"LCC": "Disable",
"NDC": "Disable"
},
"NumTrips": {
"Number": 10
}
},
"VendorPref": [{
"Code": "WN"
}]
},
"TravelerInfoSummary": {
"AirTravelerAvail": [{
"PassengerTypeQuantity": [{
"Code": "ADT",
"Quantity": 1
}]
}],
"PriceRequestInformation": {
"TPA_Extensions": {}
},
"SeatsRequested": [1]
},
"TPA_Extensions": {
"IntelliSellTransaction": {
"RequestType": {
"Name": "xxxITINS"
}
}
},
"Version": "3"
}
}
Request#2:
{
"OTA_AirLowFareSearchRQ": {
"MaxResponses": "10",
"OriginDestinationInformation": [{
"RPH": "1",
"DepartureDateTime": "2022-08-20T00:00:00",
"OriginLocation": {
"LocationCode": "SFO"
},
"DestinationLocation": {
"LocationCode": "LAX"
},
"TPA_Extensions": {
"SegmentType": {
"Code": "O"
}
}
}],
"POS": {
"Source": [{
"PseudoCityCode": "xxxx",
"RequestorID": {
"CompanyName": {
"Code": "TN"
},
"ID": "xx.xx",
"Type": "x.xxx.x"
}
}]
},
"TravelPreferences": {
"MaxStopsQuantity": 99,
"TPA_Extensions": {
"DataSources": {
"ATPCO": "Enable",
"LCC": "Disable",
"NDC": "Disable"
},
"NumTrips": {
"Number": 10
}
},
"VendorPref": [{
"Code": "WN"
}]
},
"TravelerInfoSummary": {
"AirTravelerAvail": [{
"PassengerTypeQuantity": [{
"Code": "ADT",
"Quantity": 1
}]
}],
"PriceRequestInformation": {
"TPA_Extensions": {}
},
"SeatsRequested": [1]
},
"TPA_Extensions": {
"IntelliSellTransaction": {
"RequestType": {
"Name": "xxxITINS"
}
}
},
"Version": "3"
}
}
Response#1:
{
"groupedItineraryResponse": {
"version": "6.6.1",
"messages": [{
"severity": "Info",
"type": "SERVER",
"code": "ASE032LPSCIL672.ATSE.CERT.ASCINT.SABRECIRRUS.COM",
"text": "27040"
}, {
"severity": "Info",
"type": "WORKERTHREAD",
"code": "TRANSACTIONID",
"text": "3620995504794847122"
}, {
"severity": "Info",
"type": "DRE",
"code": "RULEID",
"text": "13292"
}, {
"severity": "Info",
"type": "DEFAULT",
"code": "RULEID",
"text": "25238"
}, {
"severity": "Info",
"type": "SCHEDULES",
"code": "MSG",
"text": "NO FLIGHT SCHEDULES FOR QUALIFIERS USED"
}, {
"severity": "Error",
"type": "IF2",
"code": "PROCESS",
"text": "No complete journey can be built in IF2/ADVJR1."
}, {
"severity": "Error",
"type": "ERR",
"code": "ERR",
"text": "Error during Processing"
}],
"statistics": {
"itineraryCount": 0
}
}
}
Response#2:
{
"groupedItineraryResponse": {
"version": "6.3.0",
"messages": [{
"severity": "Info",
"type": "SERVER",
"code": "ASE032LPSCIL744.ATSE.CERT.ASCINT.SABRECIRRUS.COM",
"text": "27035"
}, {
"severity": "Info",
"type": "WORKERTHREAD",
"code": "TRANSACTIONID",
"text": "3623196258955057549"
}, {
"severity": "Info",
"type": "DRE",
"code": "RULEID",
"text": "13292"
}, {
"severity": "Info",
"type": "DEFAULT",
"code": "RULEID",
"text": "25238"
}, {
"severity": "Info",
"type": "SCHEDULES",
"code": "MSG",
"text": "NO FLIGHT SCHEDULES FOR QUALIFIERS USED"
}, {
"severity": "Error",
"type": "IF2",
"code": "PROCESS",
"text": "No complete journey can be built in IF2/ADVJR1."
}, {
"severity": "Error",
"type": "ERR",
"code": "ERR",
"text": "Error during Processing"
}],
"statistics": {
"itineraryCount": 0
}
}
}
Also, tested this using /v1/offers/shop/ in PROD environment using old endpoint and still see the same issue.
Endpoint: https://api.havail.sabre.com/v1/offers/shop,
{
"groupedItineraryResponse": {
"version": "5.2.0",
"messages": [{
"severity": "Info",
"type": "SERVER",
"code": "ASE032LPSPIL9BE.IDM.SGDCPROD.SABRE.COM",
"text": "27041"
}, {
"severity": "Info",
"type": "WORKERTHREAD",
"code": "TRANSACTIONID",
"text": "3629312323318444028"
}, {
"severity": "Info",
"type": "DRE",
"code": "RULEID",
"text": "15943"
}, {
"severity": "Info",
"type": "DEFAULT",
"code": "RULEID",
"text": "17500"
}, {
"severity": "Info",
"type": "SCHEDULES",
"code": "MSG",
"text": "NO FLIGHT SCHEDULES FOR QUALIFIERS USED"
}, {
"severity": "Error",
"type": "IF2",
"code": "PROCESS",
"text": "No complete journey can be built in IF2/ADVJR1."
}, {
"severity": "Error",
"type": "ERR",
"code": "ERR",
"text": "Error during Processing"
}],
"statistics": {
"itineraryCount": 0
}
}
}
Same API call is working fine for other airline codes like Delta Airlines ('DL'), American Airlines ('AA'), United Airlines ('UA'), etc.
Can anyone share any insight on why this is happening and how can we fix this behaviour ?
This error possibly means there’s no flights for this route on WN for this dates.
Try checking WN website and try different dates.
Here's the approach we followed to fix this
In order for us to get southwest airlines(WN) content, the PCC we use has to be whitelisted and southwest airlines(WN) does that by whitelisting using the actual ARC numbers. We have an active ARC number and requested that it be added to the PCC by Sabre as it's already been whitelisted by Southwest. Once Sabre made the changes, the WN content became available for PCC and we could see WN flights being listed when we hit Sabre BFM REST API v4.
FYI - https://developer.sabre.com/guides/travel-agency/concepts/glossary

How to do Generic Template of messenger Facebook with IBM Watson Assistant Dialog

I have a working Assistant from IBM Watson I want to show multiple choices as Image, Description, and Link combinations this feature is available for messenger under Generic Template but I cant find an option at dialog responses that can get me do this image
{
"output": {
"generic": [
{
"values": [
{
"text": "I got that"
}
],
"response_type": "text",
"selection_policy": "sequential"
}
],
"facebook": {
"message": {
"attachment": {
"type": "template",
"payload": {
"template_type": "generic",
"elements": [
{
"title": "Welcome!",
"image_url": "https://petersfancybrownhats.com/company_image.png",
"subtitle": "We have the right hat for everyone.",
"default_action": {
"type": "web_url",
"url": "https://petersfancybrownhats.com/view?item=103",
"webview_height_ratio": "tall"
},
"buttons": [
{
"type": "web_url",
"url": "https://petersfancybrownhats.com",
"title": "View Website"
},
{
"type": "postback",
"title": "Start Chatting",
"payload": "DEVELOPER_DEFINED_PAYLOAD"
}
]
}
]
}
}
}
}
}
}
I have used this JSON at the dialog node with no success
If any one is facing the same problem you should do it as output.integrations.facebook not output.facebook
so the object will be mothing like that
{
"output": {
"generic": [
{
"values": [
{
"text": "I got that"
}
],
"response_type": "text",
"selection_policy": "sequential"
}
],
"facebook": {
"message": {
"attachment": {
"type": "template",
"payload": {
"template_type": "generic",
"elements": [
{
"title": "Welcome!",
"image_url": "https://petersfancybrownhats.com/company_image.png",
"subtitle": "We have the right hat for everyone.",
"default_action": {
"type": "web_url",
"url": "https://petersfancybrownhats.com/view?item=103",
"webview_height_ratio": "tall"
},
"buttons": [
{
"type": "web_url",
"url": "https://petersfancybrownhats.com",
"title": "View Website"
},
{
"type": "postback",
"title": "Start Chatting",
"payload": "DEVELOPER_DEFINED_PAYLOAD"
}
]
}
]
}
}
}
}
}
}

Transaction API doesn't work with the payment

Since two weeks we are trying to implement transaction api v3. with Google
payment option. Once we did a transaction the receipt has been displayed.
When we pressed "order" button we got confirmation that the transaction is
being confirmed but in developer Dotpay panel there were no visible
payments.
After a few transactions action stopped displaying the receipt and it
informed that "something went wrong. Try again later". When we removed googlePaymentOption from
TransactionDecision the receipt has been displayed but we were still not
able to make any transactions.
It lasted for a few days and after that we were able to make transactions again but there were
still no payments visible.
Can you please have a look?
Hereby you can find our transaction logs:
{
"conversationToken": "[\"_actions_on_google\",\"podsumowanie\",\"rezerwuj_dostawe\",\"zmien_zamowienie_lista\",\"start_index\",\"modyfikuj_koszyk\",\"dodaj_produkt\"]",
"expectUserResponse": true,
"expectedInputs": [{
"inputPrompt": {
"richInitialPrompt": {
"items": [{
"simpleResponse": {
"textToSpeech": "Transaction Decision Placeholder."
}
}]
}
},
"possibleIntents": [{
"intent": "actions.intent.TRANSACTION_DECISION",
"inputValueData": {
"#type": "type.googleapis.com/google.actions.transactions.v3.TransactionDecisionValueSpec",
"order": {
"merchantOrderId": "9g1blj8rmvo",
"userVisibleOrderId": "9g1blj8rmvo",
"buyerInfo": {
"email": "janedoe#gmail.com",
"firstName": "Jane",
"lastName": "Doe",
"displayName": "Jane Doe"
},
"createTime": "2020-06-09T14:02:08.812Z",
"lastUpdateTime": "2020-06-09T14:02:08.812Z",
"transactionMerchant": {
"id": "book_store_1",
"name": "Book Store"
},
"contents": {
"lineItems": [{
"id": "memoirs_4",
"name": "Our memoirs",
"priceAttributes": [{
"type": "REGULAR",
"name": "Item Price",
"state": "ACTUAL",
"amount": {
"currencyCode": "PLN",
"amountInMicros": "1000000"
},
"taxIncluded": true
}, {
"type": "TOTAL",
"name": "Total Price",
"state": "ACTUAL",
"amount": {
"currencyCode": "PLN",
"amountInMicros": "1000000"
},
"taxIncluded": true
}],
"notes": ["Special introduction by author."],
"purchase": {
"quantity": 1
}
}]
},
"priceAttributes": [{
"type": "SUBTOTAL",
"name": "Subtotal",
"state": "ESTIMATE",
"amount": {
"currencyCode": "PLN",
"amountInMicros": "1000000"
},
"taxIncluded": true
}, {
"type": "DELIVERY",
"name": "Delivery",
"state": "ACTUAL",
"amount": {
"currencyCode": "PLN"
},
"taxIncluded": true
}, {
"type": "TAX",
"name": "Tax",
"state": "ESTIMATE",
"amount": {
"currencyCode": "PLN"
},
"taxIncluded": true
}, {
"type": "TOTAL",
"name": "Total Price",
"state": "ESTIMATE",
"amount": {
"currencyCode": "PLN",
"amountInMicros": "1000000"
},
"taxIncluded": true
}],
"followUpActions": [{
"type": "VIEW_DETAILS",
"title": "View details",
"openUrlAction": {
"url": "http://example.com"
}
}, {
"type": "CALL",
"title": "Call us",
"openUrlAction": {
"url": "tel:+16501112222"
}
}, {
"type": "EMAIL",
"title": "Email us",
"openUrlAction": {
"url": "mailto:person#example.com"
}
}],
"termsOfServiceUrl": "http://www.example.com",
"note": "The Memoir collection",
"purchase": {
"status": "CREATED",
"type": "RETAIL",
"returnsInfo": {
"daysToReturn": 1,
"policyUrl": "http://www.example.com"
},
"fulfillmentInfo": {
"id": "FULFILLMENT_SERVICE_ID",
"fulfillmentType": "DELIVERY",
"expectedFulfillmentTime": {
"timeIso8601": "2025-09-25T18:00:00.877Z"
},
"price": {
"type": "REGULAR",
"name": "Delivery Price",
"state": "ACTUAL",
"amount": {
"currencyCode": "PLN"
},
"taxIncluded": true
},
"fulfillmentContact": {
"email": "janedoe#gmail.com",
"firstName": "Jane",
"lastName": "Doe",
"displayName": "Jane Doe"
}
},
"purchaseLocationType": "ONLINE_PURCHASE",
"userVisibleStatusLabel": "CREATED"
}
},
"orderOptions": {
"userInfoOptions": {
"userInfoProperties": ["EMAIL"]
}
},
"paymentParameters": {
"googlePaymentOption": {
"facilitationSpec": "{\"apiVersion\":2,\"apiVersionMinor\":0,\"merchantInfo\":{\"merchantName\":\"Frisco\"},\"allowedPaymentMethods\":[{\"type\":\"CARD\",\"parameters\":{\"allowedAuthMethods\":[\"PAN_ONLY\"],\"allowedCardNetworks\":[\"MASTERCARD\",\"VISA\"]},\"tokenizationSpecification\":{\"type\":\"PAYMENT_GATEWAY\",\"parameters\":{\"gateway\":\"dotpay\",\"gatewayMerchantId\":\"705777\"}}}],\"transactionInfo\":{\"totalPriceStatus\":\"FINAL\",\"totalPrice\":\"1.00\",\"currencyCode\":\"PLN\"}}"
}
},
"presentationOptions": {
"actionDisplayName": "PLACE_ORDER"
}
}
}],
"speechBiasingHints": ["$usun", "$dalej", "$events", "$wroc", "$product", "$deleteProduct", "$sztuka", "$dodaj", "$ilosc", "$produkty", "$deleteOrder"]
}],
"responseMetadata": {
"status": {
"message": "Success (200)"
},
"queryMatchInfo": {
"queryMatched": true,
"intent": "777d19a8-c59a-46d2-ae22-212827b5726e"
}
}
} ```
Currently, Google is working with a limited number of partners that can get access to the production Google Pay API. If you're not one of those partners, you're welcome to read the documentation and test the integration using the sandbox environment.
https://developers.google.com/assistant/transactions/physical/dev-guide-physical-gpay
If you are indeed one of these partners, please reach out to your Google contact.

Gupshup consume post to create Embedding form

im working with Gupshup and I want to add subview in my chat.
To make this I create this vars:
var url="https://api.gupshup.io/sm/api/facebook/smartmsg/form/create";
var header = {"apikey":"xxxxxxxxxxxxxxxxxxx","Content-Type": "application/x-www-form-urlencoded","Accept":"application/json"};
var param={"formJSON":{
"title": "This is a test.",
"autoClose": false,
"message": "Thank You",
"callback-url": "https://www.gupshup.io/developer/bot/Cotizador/public",
"fields": [{
"type": "fbid",
"name": "fbname",
"label": "fbName"
}, {
"type": "input",
"name": "name",
"label": "Name",
"validations": [{
"regex": "^[A-Z a-z]+$",
"msg": "Only alphabets are allowed in this field"
}, {
"regex": "^[A-Z a-z]{6,}$",
"msg": "Minimum 6 characters required"
}]
}, {
"type": "radio",
"name": "gender",
"label": "Gender",
"options": [
"Male",
"Female"
],
"validations": [{
"regex": "",
"msg": ""
}]
}, {
"type": "select",
"name": "account",
"label": "AccountType",
"options": [
"current",
"savings"
],
"validations": [{
"regex": "",
"msg": ""
}]
}, {
"type": "checkbox",
"name": "interest",
"label": "Interests",
"options": [
"Cooking",
"Reading"
],
"validations": [{
"regex": "",
"msg": ""
}]
}],
"users": [
"Testing"
]
}}
And call post with:
context.simplehttp.makePost(url,JSON.stringify(param),header,parser);
And my call back
function parser(context, event) {
context.console.log("Handler https")
var result= JSON.parse(event.getresp);
if(result=="success"){
context.sendResponse("We have successfully stored your data");
}else{
context.sendResponse("We dont shoot");
}
}
But when, make the request post, but don't show me response in chat or in callback. What im doing wrong?
Sohan from Gupshup here.
The result from the API that you are using is this:
[{
"embedlink": "https://api.gupshup.io/sm/api/facebook/smartmsg/embed/66438dde-ec76-4d6e-a0d0-8cfc0c730e57",
"expired": false,
"fb-button": {
"title": "This is a test.",
"type": "web_url",
"url": "https://api.gupshup.io/sm/api/facebook/smartmsg/embed/66438dde-ec76-4d6e-a0d0-8cfc0c730e57",
"webview_height_ratio": "tall"
},
"id": "66438dde-ec76-4d6e-a0d0-8cfc0c730e57",
"signed-for": {
"display": "Testing",
"subdisplay": "Testing"
},
"smid": "1009"
}]
Thus when you do:
var result= JSON.parse(event.getresp);
if(result=="success"){
context.sendResponse(result) will display the entire JSON that you see above. To display the 'expired' field you can use result.expired.
Check this document for more information.

I need receive the messages created in response texts in some intentions of the API.AI

My issue:
I have two responses, but my chat return only one specified "the speech", but i need that return the two, like do the console of api
example of response JSON from API:
{
"id": "XXXXXXXXXXX",
"timestamp": "2017-07-12T20:08:48.101Z",
"lang": "es",
"result": {
"source": "agent",
"resolvedQuery": "Hello how are you?",
"action": "",
"actionIncomplete": false,
"parameters": {},
"contexts": [
{
"name": "intent",
"parameters": {},
"lifespan": 1
}
],
"metadata": {
"intentId": "XXXXXXXXXXXXXXXXXXXXXXXX",
"webhookUsed": "false",
"webhookForSlotFillingUsed": "false",
"intentName": "welcome"
},
"fulfillment": {
"speech": "Hello!",
"messages": [
{
"type": 0,
"speech": "Hello!"
},
{
"type": 0,
"speech": "Bye!"
}
]
},
"score": 1
},
"status": {
"code": 200,
"errorType": "success"
},
"sessionId": ""
}
I need show the black messages.