Google smart home action always failing on command execution - actions-on-google

I am developing fanSpeed and colorSetting trait for Google Actions, but whenever I execute command for setting fan speed or setting light colour, it fails. Here is my JSON for sync,query and execute step:
sync
{
"requestId":"d25ty67q-98jui-581aa-j891-b1f6dhuas"
"payload":{
"devices": [
{
"id": "AA96A0#16",
"type": "action.devices.types.FAN",
"traits": [
"action.devices.traits.OnOff",
"action.devices.traits.FanSpeed"
],
"roomHint": "ROOM",
"deviceInfo": {
"manufacturer": "smart Homes"
},
"name": {
"defaultNames": [
"fan"
],
"name": "fan"
},
"willReportState": true,
"customData": {
},
"attributes": {
"commandOnlyOnOff": false,
"commandOnlyFanSpeed": false,
"reversible": false,
"availableFanSpeeds": {
"speeds": [
{"speed_name": "speed_low", "speed_values": [{"speed_synonym": ["low", "low speed", "slow"], "lang": "en"}]},
{"speed_name": "speed_medium", "speed_values": [{"speed_synonym": ["medium", "medium speed", "med"], "lang": "en"}]},
{"speed_name": "speed_high", "speed_values": [{"speed_synonym": [ "high speed", "high"], "lang": "en"}]},
{"speed_name": "speed_highest", "speed_values": [{"speed_synonym": [ "highest speed", "highest"], "lang": "en"}]}
],
"ordered": true
}
}
},
{
"id": "240A50#0",
"type": "action.devices.types.LIGHT",
"traits": [
"action.devices.traits.OnOff",
"action.devices.traits.ColorSetting"
],
"roomHint": "ROOM",
"deviceInfo": {
"manufacturer": "smart Homes"
},
"name": {
"defaultNames": [
"light"
],
"name": "light"
},
"willReportState": false,
"customData": {
},
"attributes": {
"commandOnlyColorSetting": true,
"colorModel": "hsv"
}
}
],
"agentUserId": "Home555"
}
}
Execute Fan:
{
"commands": [
{
"ids": [
"AA96A0#16"
],
"status": "SUCCESS",
"states": {
"online": true,
"on": true,
"currentFanSpeedSetting": "speed_highest"
}
}
]
}
Query Fan:
{
"requestId":"167278043664013971",
"payload":{
"devices": {
"AA96A0#16": {
"status": "SUCCESS",
"online": true,
"on": true,
"currentFanSpeedSetting": "speed_highest"
}
}
}
}
Execute color-light:
{
"commands": [
{
"ids": [
"240A50#0"
],
"status": "SUCCESS",
"states": {
"online": true,
"on": true,
"color": {
"spectrumHSV": {
"hue": 120,
"saturation": 1,
"value": 1
}
}
}
}
]
}
Query color-light:
{
"requestId":"167278043664013971",
"payload":{
"devices": {
"240A50#0": {
"status": "SUCCESS",
"online": true,
"on": true,
"color": {
"spectrumHSV": {
"hue": 0,
"saturation": 0,
"value": 1
}
}
}
}
}
}
Speaker response: Sorry, it looks like smart homes is unavailable right now.
However my request is always executing and I can see state change on my device. Can anyone point out Why it is failing?

The json for execute for both the fan and the bulb has missing values for requestId. This might be causing the failures with the execution commands.

Related

can't able to store fhir resource in mongodb using asymmetrik mongodb fhir-core-server

i'm running node-fhir-server-mongo(Asymmetrik github repo)..when i put resource using PUT method and it stores in mongodb...everything works fine...but the data is partially stored...when i try to access the data i stored in database it only shows few pieces only...
below code is the data i want to store..
{
"resourceType": "Patient",
"id": "example3",
"text": {
"status": "generated",
},
"identifier": [
{
"use": "usual",
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "MR"
}
]
},
"system": "urn:oid:1.2.36.146.595.217.0.1",
"value": "12345",
"period": {
"start": "2001-05-06"
},
"assigner": {
"display": "Acme Healthcare"
}
}
],
"active": true,
"name": [
{
"use": "official",
"family": "Chalmers",
"given": [
"Peter",
"James"
]
},
{
"use": "usual",
"given": [
"Jim"
]
},
{
"use": "maiden",
"family": "Windsor",
"given": [
"Peter",
"James"
],
"period": {
"end": "2002"
}
}
],
"telecom": [
{
"use": "home"
},
{
"system": "phone",
"value": "(03) 5555 6473",
"use": "work",
"rank": 1
},
{
"system": "phone",
"value": "(03) 3410 5613",
"use": "mobile",
"rank": 2
},
{
"system": "phone",
"value": "(03) 5555 8834",
"use": "old",
"period": {
"end": "2014"
}
}
],
"gender": "male",
"birthDate": "1974-12-25",
"_birthDate": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/patient-birthTime",
"valueDateTime": "1974-12-25T14:35:45-05:00"
}
]
},
"deceasedBoolean": false,
"address": [
{
"use": "home",
"type": "both",
"text": "534 Erewhon St PeasantVille, Rainbow, Vic 3999",
"line": [
"534 Erewhon St"
],
"city": "PleasantVille",
"district": "Rainbow",
"state": "Vic",
"postalCode": "3999",
"period": {
"start": "1974-12-25"
}
}
],
"contact": [
{
"relationship": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0131",
"code": "N"
}
]
}
],
"name": {
"family": "du Marché",
"_family": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/humanname-own-prefix",
"valueString": "VV"
}
]
},
"given": [
"Bénédicte"
]
},
"telecom": [
{
"system": "phone",
"value": "+33 (237) 998327"
}
],
"address": {
"use": "home",
"type": "both",
"line": [
"534 Erewhon St"
],
"city": "PleasantVille",
"district": "Rainbow",
"state": "Vic",
"postalCode": "3999",
"period": {
"start": "1974-12-25"
}
},
"gender": "female",
"period": {
"start": "2012"
}
}
],
"managingOrganization": {
"reference": "Organization/1"
} }
and the actual data is stored on the mongodb is....
_id: "example3" id: "example3" meta: Object versionId: "1" lastUpdated: "2022-06-28T08:44:44+00:00" resourceType: "Patient"
if anyone know the answer or how to solve please let me know....thanks in advance!

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"
}
}
]
}
}
],

DialogFlow: Missing "user" property in JSON after successful Google Account linking

So after successful Google Account linking in my app, I tested it using an Android device without any problem. I used the "in conversation prompt" technique to request the user to authenticate to proceed further. In other words, I was successfully able to receive the "user" property of response from Dialogflow with valid accessToken (among other info).
Now, I tried it on a Google Home device. The device is configured with the same email Id I used on the Android mobile device. The G.Home successfully loads the app when I invoke it. But the missing part here is the accessToken in the user property (JSON below). I have assumed the following in the above scenario:
Since I have already signed in successfully on the Android mobile device, the next time I try to invoke the app on the same device, the app doesn't prompts for the "sign in" because it already has the accessToken (until it is expired). And since I am using the same gmail address on the G. Home device, I should have gotten the same accessToken as well.
As long as the same gmail address is used, it doesn't matter what device/surface I use to Google auth myself, I will always get the accessToken if it has not expired.
The setup/configuration for the whole Google Account linking is detailed in the above link I've shared. Here is the JSON I've received on G. Home and Android device respectively:
{
"originalRequest": {
"source": "google",
"version": "2",
"data": {
"isInSandbox": true,
"surface": {
"capabilities": [
{
"name": "actions.capability.MEDIA_RESPONSE_AUDIO"
},
{
"name": "actions.capability.AUDIO_OUTPUT"
}
]
},
"inputs": [
{
"rawInputs": [
{
"query": "continue",
"inputType": "VOICE"
}
],
"arguments": [
{
"rawText": "continue",
"textValue": "continue",
"name": "text"
}
],
"intent": "actions.intent.TEXT"
}
],
"user": {
"lastSeen": "2018-07-17T10:33:57Z",
"locale": "en-US",
"userId": "15229245xxx"
},
"conversation": {
"conversationId": "153182806xxx",
"type": "ACTIVE",
"conversationToken": "[\"disclaimer_option\"]"
},
"availableSurfaces": [
{
"capabilities": [
{
"name": "actions.capability.SCREEN_OUTPUT"
},
{
"name": "actions.capability.AUDIO_OUTPUT"
},
{
"name": "actions.capability.WEB_BROWSER"
}
]
}
]
}
},
"id": "9459d297-4746-4ffe-99fa-xxx",
"timestamp": "2018-07-17T11:49:02.693Z",
"lang": "en-us",
"result": {
"source": "agent",
"resolvedQuery": "continue",
"speech": "",
"action": "v00.authentication.pin",
"actionIncomplete": false,
"parameters": {
"CallEnum": "Login"
},
"contexts": [
{
"name": "disclaimer_option",
"parameters": {
"CallEnum": "Login",
"CallEnum.original": ""
},
"lifespan": 0
},
{
"name": "pin",
"parameters": {
"CallEnum": "Login",
"CallEnum.original": ""
},
"lifespan": 1
},
{
"name": "google_assistant_input_type_voice",
"parameters": {
"CallEnum": "Login",
"CallEnum.original": ""
},
"lifespan": 0
},
{
"name": "actions_capability_audio_output",
"parameters": {
"CallEnum": "Login",
"CallEnum.original": ""
},
"lifespan": 0
},
{
"name": "actions_capability_media_response_audio",
"parameters": {
"CallEnum": "Login",
"CallEnum.original": ""
},
"lifespan": 0
}
],
"metadata": {
"intentName": "v00.authentication.pin",
"isResponseToSlotfilling": false,
"intentId": "146f0d7d-0194-43cb-90e4-xxx",
"webhookUsed": "true",
"webhookForSlotFillingUsed": "false",
"nluResponseTime": 87
},
"fulfillment": {
"speech": "",
"messages": []
},
"score": 1
},
"status": {
"code": 200,
"errorType": "success"
},
"sessionId": "15318280xxx"
}
and
{
"originalRequest": {
"source": "google",
"version": "2",
"data": {
"isInSandbox": true,
"surface": {
"capabilities": [
{
"name": "actions.capability.MEDIA_RESPONSE_AUDIO"
},
{
"name": "actions.capability.WEB_BROWSER"
},
{
"name": "actions.capability.AUDIO_OUTPUT"
},
{
"name": "actions.capability.SCREEN_OUTPUT"
}
]
},
"inputs": [
{
"rawInputs": [
{
"query": "Continue",
"inputType": "TOUCH"
}
],
"arguments": [
{
"rawText": "Continue",
"textValue": "Continue",
"name": "text"
}
],
"intent": "actions.intent.TEXT"
}
],
"user": {
"lastSeen": "2018-07-17T09:44:08Z",
"accessToken": "6IlPNz0YFb_stP0quM1xxx",
"locale": "en-US",
"userId": "15229245xxx"
},
"conversation": {
"conversationId": "153182082xxx",
"type": "ACTIVE",
"conversationToken": "[\"disclaimer_option\"]"
},
"availableSurfaces": [
{
"capabilities": [
{
"name": "actions.capability.WEB_BROWSER"
},
{
"name": "actions.capability.AUDIO_OUTPUT"
},
{
"name": "actions.capability.SCREEN_OUTPUT"
}
]
}
]
}
},
"id": "ae2e3ff8-f351-497b-9429-xxx",
"timestamp": "2018-07-17T09:47:54.999Z",
"lang": "en-us",
"result": {
"source": "agent",
"resolvedQuery": "Continue",
"speech": "",
"action": "v00.authentication.pin",
"actionIncomplete": false,
"parameters": {
"CallEnum": "Login"
},
"contexts": [
{
"name": "google_assistant_input_type_touch",
"parameters": {
"CallEnum": "Login",
"CallEnum.original": ""
},
"lifespan": 0
},
{
"name": "pin",
"parameters": {
"CallEnum": "Login",
"CallEnum.original": ""
},
"lifespan": 1
},
{
"name": "disclaimer_option",
"parameters": {
"CallEnum": "Login",
"CallEnum.original": ""
},
"lifespan": 0
},
{
"name": "actions_capability_screen_output",
"parameters": {
"CallEnum": "Login",
"CallEnum.original": ""
},
"lifespan": 0
},
{
"name": "actions_capability_audio_output",
"parameters": {
"CallEnum": "Login",
"CallEnum.original": ""
},
"lifespan": 0
},
{
"name": "actions_capability_media_response_audio",
"parameters": {
"CallEnum": "Login",
"CallEnum.original": ""
},
"lifespan": 0
},
{
"name": "actions_capability_web_browser",
"parameters": {
"CallEnum": "Login",
"CallEnum.original": ""
},
"lifespan": 0
}
],
"metadata": {
"intentName": "v00.authentication.pin",
"isResponseToSlotfilling": false,
"intentId": "146f0d7d-0194-43cb-90e4-xxx",
"webhookUsed": "true",
"webhookForSlotFillingUsed": "false",
"nluResponseTime": 87
},
"fulfillment": {
"speech": "",
"messages": []
},
"score": 1
},
"status": {
"code": 200,
"errorType": "success"
},
"sessionId": "153182082xxx"
}
My question is, where can I get the accessToken when I am using the Google Home device?

REST API 'Create Passenger Name Record' Warning and errors

The below attached warnings and error occurred while testing Booking seat.
There is no any proper documentation of Create Passenger Name Record REST API Call, the description and schema are meaning less. In description there are 266 parameters are required true to send a request.
Do you have any proper documentation where i can get all the required parameters detailed information? Like What is SegmentNumber how can i get?
Working flow( For Single trip) :
Get the origin, destination, date, number of seats required.
Send all required parms to Bargain Finder Max, get the response
Send Require params to book a seat. Create Passenger Name Record
Request
{
"CreatePassengerNameRecordRQ": {
"targetCity": "3QND",
"Profile": {
"UniqueID": {
"ID": "ABCD1EF"
}
},
"AirBook": {
"OriginDestinationInformation": {
"FlightSegment": [{
"ArrivalDateTime": "2017-04-30",
"DepartureDateTime": "2017-04-30T13:55",
"FlightNumber": "309",
"NumberInParty": "1",
"ResBookDesigCode": "V",
"Status": "NN",
"DestinationLocation": {
"LocationCode": "KHI"
},
"MarketingAirline": {
"Code": "PK",
"FlightNumber": "309"
},
"MarriageGrp": "O",
"OriginLocation": {
"LocationCode": "ISB"
}
}]
}
},
"AirPrice": {
"PriceRequestInformation": {
"OptionalQualifiers": {
"MiscQualifiers": {
"TourCode": {
"Text": "TEST1212"
}
},
"PricingQualifiers": {
"PassengerType": [{
"Code": "CNN",
"Quantity": "1"
}]
}
}
}
},
"MiscSegment": {
"DepartureDateTime": "2017-04-30",
"NumberInParty": 1,
"Status": "NN",
"Type": "OTH",
"OriginLocation": {
"LocationCode": "ISB"
},
"Text": "TEST",
"VendorPrefs": {
"Airline": {
"Code": "PK"
}
}
},
"SpecialReqDetails": {
"AddRemark": {
"RemarkInfo": {
"FOP_Remark": {
"Type": "CHECK",
"CC_Info": {
"Suppress": true,
"PaymentCard": {
"AirlineCode": "PK",
"CardSecurityCode": "1234",
"Code": "VI",
"ExpireDate": "2012-12",
"ExtendedPayment": "12",
"ManualApprovalCode": "123456",
"Number": "4123412341234123",
"SuppressApprovalCode": true
}
}
},
"FutureQueuePlaceRemark": {
"Date": "12-21",
"PrefatoryInstructionCode": "11",
"PseudoCityCode": "IPCC1",
"QueueIdentifier": "499",
"Time": "06:00"
},
"Remark": [{
"Type": "Historical",
"Text": "TEST HISTORICAL REMARK"
},
{
"Type": "Invoice",
"Text": "TEST INVOICE REMARK"
},
{
"Type": "Itinerary",
"Text": "TEST ITINERARY REMARK"
},
{
"Type": "Hidden",
"Text": "TEST HIDDEN REMARK"
}]
}
},
"AirSeat": {
"Seats": {
"Seat": [{
"NameNumber": "1.1",
"Preference": "AN",
"SegmentNumber": "0"
},
{
"NameNumber": "2.1",
"Preference": "AN",
"SegmentNumber": "1"
},
{
"NameNumber": "3.1",
"Preference": "AN",
"SegmentNumber": "1"
}]
}
},
"SpecialService": {
"SpecialServiceInfo": {
"Service": [{
"SSR_Code": "OSI",
"PersonName": {
"NameNumber": "testing"
#},
"Text": "TEST1",
"VendorPrefs": {
"Airline": {
"Code": "PK"
}
}
}]
}
}
},
"PostProcessing": {
"RedisplayReservation": true,
"ARUNK": "",
"QueuePlace": {
"QueueInfo": {
"QueueIdentifier": [{
"Number": "100",
"PrefatoryInstructionCode": "11"
}]
}
},
"EndTransaction": {
"Source": {
"ReceivedFrom": "SWS TEST"
}
}
}
}
}
Response:
{
"CreatePassengerNameRecordRS": {
"ApplicationResults": {
"status": "NotProcessed",
"Error": [
{
"type": "Application",
"timeStamp": "2017-03-08T04:10:41.317-06:00",
"SystemSpecificResults": [
{
"Message": [
{
"code": "ERR.SP.BUSINESS_ERROR",
"content": "PNR has not been created successfully, see remaining messages for details"
}
]
}
]
}
],
"Warning": [
{
"type": "BusinessLogic",
"timeStamp": "2017-03-08T04:10:40.628-06:00",
"SystemSpecificResults": [
{
"Message": [
{
"code": "WARN.SP.PROVIDER_ERROR",
"content": "NO PROFILE FOUND FOR NAME"
}
]
}
]
},
{
"type": "Validation",
"timeStamp": "2017-03-08T04:10:40.655-06:00",
"SystemSpecificResults": [
{
"Message": [
{
"code": "WARN.SWS.CLIENT.VALIDATION_FAILED",
"content": "Request contains incorrect values: Wrong dateTime format"
}
]
}
]
},
{
"type": "BusinessLogic",
"timeStamp": "2017-03-08T04:10:40.919-06:00",
"SystemSpecificResults": [
{
"Message": [
{
"code": "WARN.SWS.HOST.ERROR_IN_RESPONSE",
"content": "FORMAT, CHECK SEGMENT NUMBER-0003"
}
]
}
]
},
{
"type": "BusinessLogic",
"timeStamp": "2017-03-08T04:10:41.024-06:00",
"SystemSpecificResults": [
{
"Message": [
{
"code": "WARN.SWS.HOST.ERROR_IN_RESPONSE",
"content": ".DTE.NOT ENT BGNG WITH"
}
]
}
]
},
{
"type": "BusinessLogic",
"timeStamp": "2017-03-08T04:10:41.062-06:00",
"SystemSpecificResults": [
{
"Message": [
{
"code": "WARN.SWS.HOST.ERROR_IN_RESPONSE",
"content": "\u0087ND NAMES\u0087"
}
]
}
]
},
{
"type": "BusinessLogic",
"timeStamp": "2017-03-08T04:10:41.096-06:00",
"SystemSpecificResults": [
{
"Message": [
{
"code": "WARN.SWS.HOST.ERROR_IN_RESPONSE",
"content": "\u0087ND NAMES\u0087"
}
]
}
]
},
{
"type": "BusinessLogic",
"timeStamp": "2017-03-08T04:10:41.129-06:00",
"SystemSpecificResults": [
{
"Message": [
{
"code": "WARN.SWS.HOST.ERROR_IN_RESPONSE",
"content": "\u0087ND NAMES\u0087"
}
]
}
]
},
{
"type": "BusinessLogic",
"timeStamp": "2017-03-08T04:10:41.166-06:00",
"SystemSpecificResults": [
{
"Message": [
{
"code": "WARN.SWS.HOST.ERROR_IN_RESPONSE",
"content": "NO ARNK INSERTED"
}
]
}
]
},
{
"type": "BusinessLogic",
"timeStamp": "2017-03-08T04:10:41.229-06:00",
"SystemSpecificResults": [
{
"Message": [
{
"code": "WARN.SWS.HOST.ERROR_IN_RESPONSE",
"content": "NEED PHONE FIELD - USE 9"
}
]
}
]
}
]
},
"TravelItineraryRead": {
"TravelItinerary": {
"CustomerInfo": {
},
"ItineraryInfo": {
"ReservationItems": {
"Item": [
{
"RPH": "1",
"MiscSegment": {
"DayOfWeekInd": "7",
"DepartureDateTime": "04-30",
"NumberInParty": "01",
"SegmentNumber": "0001",
"Status": "NN",
"Type": "OTH",
"IsPast": false,
"OriginLocation": {
"LocationCode": "ISB"
},
"Text": [
"TEST"
],
"Vendor": {
"Code": "PK"
}
}
}
]
}
},
"ItineraryRef": {
"AirExtras": false,
"InhibitCode": "U",
"PartitionID": "AA",
"PrimeHostID": "1B",
"Header": [
"CURRENTLY DISPLAYING A PNR OWNED BY THE SABRE PRIME HOST",
"RULES AND FUNCTIONALITY FOR THAT PRIME HOST WILL APPLY"
],
"Source": {
"PseudoCityCode": "3QND",
"ReceivedFrom": "SWS TEST"
}
},
"SpecialServiceInfo": [
{
"RPH": "001",
"Type": "GFX",
"Service": {
"SSR_Code": "OSI",
"Airline": {
"Code": "PK"
},
"Text": [
"TEST1-TESTING"
]
}
}
]
}
}
},
"Links": [
{
"rel": "self",
"href": "https:\/\/api.sabre.com\/v1.0.0\/passenger\/records?mode=create"
},
{
"rel": "linkTemplate",
"href": "https:\/\/api.sabre.com\/\/passenger\/records?mode="
}
]
}
Please avoid posting the same questions. Here's an answer I just posted regarding the required elements: https://stackoverflow.com/a/42671412/3701641
About the segment number, they represent the itinerary segments, you are adding one flight segment, so the segment number associated with that would be 1.

Need help in mongodb $pull

I have a mongodb document that is like this:
{
"_id": ObjectId("5231718f042f8bc215000007"),
"ApplicationId": "YVo9bEQiDLg2",
"Network": {
"Millennial Media": {
"Active": true,
"RefreshInterval": 300000,
"NetworkId": 352,
"App": [
{
"AppId": "APID - Banner",
"AppValue": "76970",
"Priority": 100
}
]
},
"Buzzcity": {
"Active": true,
"RefreshInterval": 300000,
"NetworkId": 353,
"App": [
{
"AppId": "Partner ID",
"AppValue": "80624",
"Priority": 100
}
]
},
"Adiquity": {
"Active": true,
"RefreshInterval": 300000,
"NetworkId": 354,
"App": [
{
"AppId": "package",
"AppValue": "com.ristomobile.giftntake",
"Priority": 0
},
{
"AppId": "Site ID",
"AppValue": "adqkkqkk-14eo91zj-qv6qt",
"Priority": 100
},
{
"AppId": "appName",
"AppValue": "Gift&Take",
"Priority": 0
}
]
},
"Smaato": {
"Active": true,
"RefreshInterval": 300000,
"NetworkId": 351,
"App": [
{
"AppId": "Adspace ID",
"AppValue": "65766605",
"Priority": 100
}
],
"Partner": [
{
"PartnerId": "Publisher ID",
"PartnerValue": "923862008"
}
]
},
"AdNear": {
"Active": true,
"RefreshInterval": 300000,
"NetworkId": 367,
"Partner": [
{
"PartnerId": "pubid",
"PartnerValue": "rs-1328"
},
{
"PartnerId": "api_key",
"PartnerValue": "RSW78:QH8HHM389M7YP"
}
]
},
"twinpine": {
"Active": true,
"RefreshInterval": 300000,
"NetworkId": 371,
"Partner": [
{
"PartnerId": "pid",
"PartnerValue": "1551a74d1df075a"
},
{
"PartnerId": "alid",
"PartnerValue": "405"
}
]
},
"Vserv.mobi": {
"Active": true,
"RefreshInterval": 300000,
"NetworkId": 370,
"Partner": [
{
"PartnerId": "Zone Id",
"PartnerValue": "32024"
},
{
"PartnerId": "Publisher Id",
"PartnerValue": "12649"
}
]
}
},
"LastUpdate": ISODate("2013-06-24T01:44:22.865Z")
}
and i tried to pull away the Millenial Media data:
db.MediationSetup.update(
{
ApplicationId: "YVo9bEQiDLg2"
},
{
$pull: {
Network: {
"Millennial Media": {
"Active": true,
"RefreshInterval": 300000,
"NetworkId": 352,
"App": [
{
"AppId": "APID - Banner",
"AppValue": "76970",
"Priority": 100
}
]
}
}
}
})
but it gives
Cannot apply $pull/$pullAll modifier to non-array
I am puzzled, I am indeed pulling an array! so what is going on?
When I understood you correctly, you want to remove an entry from the array in Network.Millennial Media.App. In that case you have to reference a field nested in sub-documents by using the dot-notation:
db.MediationSetup.update(
{
ApplicationId: "YVo9bEQiDLg2"
},
{
$pull: { "Network.Millennial Media.App": {
"AppId": "APID - Banner",
"AppValue": "76970",
"Priority": 100
}
}
});