Sending WhatsApp interactive message of list type fails when sent with image header - facebook

I am able to send interactive message with "button" type and 3 buttons with image header.
But sending interactive message with "list" type and same image header fails with error:
{
"meta": {
"api_status": "stable",
"version": "2.39.4"
},
"errors": [
{
"code": 1008,
"title": "Required parameter is missing",
"details": "Failed building interactive message. Invalid Header."
}
]
}
Is it possible that "list" interactive messages doesn't support "image" header without stating it in documentation?
Successful "button" interactive payload (image URL changed):
{
"to": "972000000000",
"type": "interactive",
"interactive": {
"body": {
"text": "Select a branch for the takeaway by writing the name/number"
},
"action": {
"buttons": [
{
"reply": {
"id": "MQ==",
"title": "1"
},
"type": "reply"
},
{
"reply": {
"id": "Mg==",
"title": "2"
},
"type": "reply"
}
]
},
"type": "button",
"header": {
"image": {
"link": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_light_color_272x92dp.png"
},
"type": "image"
}
}
}
Successful "button" interactive message result:
Failed "list" interactive payload (image URL changed):
{
"to": "972000000000",
"type": "interactive",
"interactive": {
"body": {
"text": "Select a branch for the takeaway by writing the name/number"
},
"action": {
"button": "Options",
"sections": [
{
"rows": [
{
"id": "MQ==",
"title": "1"
},
{
"id": "Mg==",
"title": "2"
},
{
"id": "Mw==",
"title": "3"
},
{
"id": "NA==",
"title": "4"
},
{
"id": "NQ==",
"title": "5"
},
{
"id": "Ng==",
"title": "6"
},
{
"id": "Nw==",
"title": "7"
},
{
"id": "OA==",
"title": "8"
},
{
"id": "OQ==",
"title": "9"
},
{
"id": "MTA=",
"title": "10"
}
]
}
]
},
"type": "list",
"header": {
"image": {
"link": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_light_color_272x92dp.png"
},
"type": "image"
}
}
}

Well, it does state it in the docs. I'm just blind:
Kinda weird though "image" header not supported for "list".

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

Why does Adaptive Card Input.Date subtract 1 day from the selected date?

Using botframework with msteams channel.
The adaptive card. Nothing special, just a few textblocks and date inputs. The input values are saved to memory.
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.3",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"style": "emphasis",
"width": 2,
"items": [
{
"type": "TextBlock",
"text": "Please enter the information below",
"size": "Large"
},
{
"type": "Container",
"style": "emphasis",
"items": [
{
"type": "TextBlock",
"text": "End Of Last Month",
"wrap": true
},
{
"type": "Input.Date",
"id": "Date_EndOfLastMonth",
"value": "${dialog.requestForm.Date_EndOfLastMonth}",
"placeholder": ""
},
{
"type": "TextBlock",
"text": "${dialog.requestForm.Date_EndOfLastMonthError}",
"size": "small",
"wrap": true,
"color": "attention"
}
]
},
{
"type": "Container",
"style": "emphasis",
"items": [
{
"type": "TextBlock",
"text": "End Of Last Year",
"wrap": true
},
{
"type": "Input.Date",
"id": "Date_EndOfLastYear",
"value": "${dialog.requestForm.Date_EndOfLastYear}",
"placeholder": ""
},
{
"type": "TextBlock",
"text": "${dialog.requestForm.Date_EndOfLastYearError}",
"size": "small",
"wrap": true,
"color": "attention"
}
]
},
{
"type": "Container",
"style": "emphasis",
"items": [
{
"type": "TextBlock",
"text": "Valuation Key Date",
"wrap": true
},
{
"type": "Input.Date",
"id": "ValuationKeyDate",
"value": "${dialog.requestForm.ValuationKeyDate}",
"placeholder": ""
},
{
"type": "TextBlock",
"text": "${dialog.requestForm.ValuationKeyDateError}",
"size": "small",
"wrap": true,
"color": "attention"
}
]
},
{
"type": "Container",
"style": "emphasis",
"items": [
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Submit",
"data": {
"msteams": {
"type": "messageBack",
"displayText": "Form Submitted",
"text": "submitform"
}
}
}
]
}
]
}
]
}
]
}
]
}
The code that goes with the card. I save the input values to memory, so when there is a reprompt happening, I can fill them back to the form. In the last part are the lines for debugging. I am printing out the values directly from the activity, so nothing happens between the submission and the debug.
new CodeAction(async (dc, options) =>
{
dc.State.SetValue("dialog.requestForm.Date_EndOfLastMonth", "");
dc.State.SetValue("dialog.requestForm.Date_EndOfLastYear", "");
dc.State.SetValue("dialog.requestForm.ValuationKeyDate", ""); //ValuationKeyDate
dc.State.SetValue("dialog.requestForm.Date_EndOfLastMonthError", "");
dc.State.SetValue("dialog.requestForm.Date_EndOfLastYearError", "");
dc.State.SetValue("dialog.requestForm.ValuationKeyDateError", "");
return await dc.EndDialogAsync();
}),
new TextInput()
{
Id = "repromptTRT",
Prompt = new ActivityTemplate("${TreasuryCase()}"),
AllowInterruptions = true,
MaxTurnCount = "if(turn.activity.text != 'submitform', '0', '100')",
},
// deal with interrupt, cancel everything else
new IfCondition()
{
Condition = "turn.activity.text != 'submitform'",
Actions = new List<Dialog>()
{
new EndDialog()
}
},
// save form
new CodeAction(async (dc, options) =>
{
var json = JsonConvert.SerializeObject(dc.Context.Activity.Value);
await dc.Context.SendActivityAsync(MessageFactory.Text(json));
var d = JsonConvert.SerializeObject(DateTime.Now);
await dc.Context.SendActivityAsync(MessageFactory.Text(d));
var o = JsonConvert.DeserializeObject<TC>(json);
dc.State.SetValue("dialog.requestForm", o);
return await dc.EndDialogAsync();
}),
For more visibility, adding answer here from comment section:
The fix should be rolling through the rings, so the change should manifest in public clients in a couple of weeks.

Sabre Unable to use "Revalidate Itinerary" REST API

I am trying to follow the developer guide for a air booking process found in the documentation. https://developer.sabre.com/guides/travel-agency/workflows/air-booking
Here, I have used token based authentication (v2) and I could successfully search and book using the rest api. However, Upon hitting the revalidate itinerary api with the example found in the documentation https://developer.sabre.com/docs/rest_apis/air/search/revalidate_itinerary/reference-documentation
Here, I am getting following error. (Note: I have changed the pcc code in here. The original request uses the correct pnr.)
Response:
{
"groupedItineraryResponse": {
"version": "6.3.0",
"messages": [
{
"severity": "Info",
"type": "WORKERTHREAD",
"code": "TRANSACTIONID",
"text": "3019835637227710880"
},
{
"severity": "Info",
"type": "SERVER",
"code": "ASE032LPSCIL668.ATSE.CERT.ASCINT.SABRECIRRUS.COM",
"text": "27038"
},
{
"severity": "Info",
"type": "DRE",
"code": "RULEID",
"text": "25961"
},
{
"severity": "Info",
"type": "DEFAULT",
"code": "RULEID",
"text": "25959"
},
{
"severity": "Error",
"type": "IF2",
"code": "PROCESS",
"text": "PCC EPCC: Revalidate Itinerary not requested."
},
{
"severity": "Error",
"type": "ERR",
"code": "ERR",
"text": "Error during Processing"
}
],
"statistics": {
"itineraryCount": 0
}
}
}
API URL: https://api-crt.cert.havail.sabre.com/v3/shop/flights/revalidate
Request json:
{
"OTA_AirLowFareSearchRQ": {
"OriginDestinationInformation": [
{
"RPH": "0",
"DepartureDateTime": "2021-08-14T00:00:00",
"OriginLocation": {
"LocationCode": "KRK"
},
"DestinationLocation": {
"LocationCode": "WAW"
}
}
],
"POS": {
"Source": [
{
"PseudoCityCode": "EPCC",
"RequestorID": {
"CompanyName": {
"Code": "TN"
},
"ID": "1",
"Type": "1"
}
}
]
},
"TPA_Extensions": {
"IntelliSellTransaction": {
"RequestType": {
"Name": "200ITINS"
}
}
},
"TravelPreferences": {
"TPA_Extensions": {
"DataSources": {
"NDC": "Disable",
"ATPCO": "Enable",
"LCC": "Disable"
},
"NumTrips": {}
}
},
"TravelerInfoSummary": {
"AirTravelerAvail": [
{
"PassengerTypeQuantity": [
{
"Code": "ADT",
"Quantity": 1
}
]
}
],
"SeatsRequested": [
1
]
},
"Version": "3"
}
}
You need to list all the flights with booking classes in TPA_Extension under OriginDestinationInformation.
So, your OriginDestinationInformation should look something like this:
"OriginDestinationInformation": [
{
"RPH": "0",
"DepartureDateTime": "2021-10-11T14:50:00",
"OriginLocation": {
"LocationCode": "BEG"
},
"DestinationLocation": {
"LocationCode": "ZRH"
},
"TPA_Extensions": {
"SegmentType": {
"Code": "O"
},
"Flight": [
{
"Number": 1417,
"DepartureDateTime": "2021-10-11T14:50:00",
"ArrivalDateTime": "2021-10-11T16:40:00",
"Type": "A",
"ClassOfService": "K",
"OriginLocation": {
"LocationCode": "BEG"
},
"DestinationLocation": {
"LocationCode": "ZRH"
},
"Airline": {
"Operating": "LX",
"Marketing": "LX"
}
}
]
}
}
],

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.

How to get the facebook fan page private messages through fql or graph

I have tried Page Messages
with the all the required permission i.e read_mailbox, read_page_mailboxes, etc (all the extended permission)
at length I get tried as
https://graph.facebook.com/456330641095467/conversations?access_token=BAAGgcfpJgfUBAHdKaE6KxMWo4rU6VU7psX7Ip4cLbG1yIvX80fkkTXm3ZApdYHmcISmqfnns1gPYZAHXWD2cXX7nMBcj4AK31uptfqJUjNAGXan1ftOK4Tw3sY1WsZD
but i get response as
{
"error": {
"message": "(#210) Subject must be a page.",
"type": "OAuthException",
"code": 210
}
}
I am unable to find out the issue. Please help.
Just use the access_token of page and you are done
yours output would be like this
{
"data": [
{
"id": "t_id.615971188431960",
"snippet": "ok fine reply on test 5:15",
"updated_time": "2013-04-16T12:15:12+0000",
"message_count": 8,
"tags": {
"data": [
{
"name": "inbox"
},
{
"name": "read"
},
{
"name": "seen"
},
{
"name": "sent"
},
{
"name": "source:web"
}
]
},
"participants": {
"data": [
{
"name": "Pragati Singh",
"email": "100000441901858\u0040facebook.com",
"id": "100000441901858"
},
{
"name": "Devdemo",
"email": "456330641095467\u0040facebook.com",
"id": "456330641095467"
}
]
},
"senders": {
"data": [
{
"name": "Devdemo",
"email": "456330641095467\u0040facebook.com",
"id": "456330641095467"
},
{
"name": "Pragati Singh",
"email": "100000441901858\u0040facebook.com",
"id": "100000441901858"
}
]
},