Custom start point for axis labels in echart - echarts

I have a chart where I've spaced the x-axis labels three months apart. However, I would like that pattern to start in January so that the labels are January [year], April [year], July [year], October [year], etc. How do I define the start point for the labels (not the axis itself)? I have looked through the documentation but didn't have any luck finding a solution.
Here is the code for the chart.
option = {
"yAxis": [
{
"show": true
}
],
"xAxis": [
{
"data": ["2017-06-01", "2017-07-01", "2017-08-01", "2017-09-01", "2017-10-01", "2017-11-01", "2017-12-01", "2018-01-01", "2018-02-01", "2018-03-01", "2018-04-01", "2018-05-01", "2018-06-01", "2018-07-01", "2018-08-01", "2018-09-01", "2018-10-01", "2018-11-01", "2018-12-01", "2019-01-01", "2019-02-01", "2019-03-01", "2019-04-01", "2019-05-01", "2019-06-01", "2019-07-01", "2019-08-01", "2019-09-01", "2019-10-01", "2019-11-01", "2019-12-01", "2020-01-01", "2020-02-01"],
"type": "time",
"boundaryGap": true,
//min: 1496323473000,
maxInterval: 7776000000,
minInterval: 7776000000,
"axisLabel": {
rotate: 90,
formatter: function (value) {
var d = new Date(value);
var months = ['Jan', "/Feb/", "/Mar/", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec"];
return (months[d.getMonth()] + ' ' + d.getFullYear());}
}
}
],
"legend": {
"data": [
"Category 1",
"Category 2",
"Category 3",
"Category 4",
"Category 5"
]
},
"series": [
{
"data": [
{
"value": ["2017-06-01", " 62"]
},
{
"value": ["2017-07-01", " 66"]
},
{
"value": ["2017-08-01", " 55"]
},
{
"value": ["2017-09-01", " 58"]
},
{
"value": ["2017-10-01", " 47"]
},
{
"value": ["2017-11-01", "196"]
},
{
"value": ["2017-12-01", "161"]
},
{
"value": ["2018-01-01", " 53"]
},
{
"value": ["2018-02-01", " 28"]
},
{
"value": ["2018-03-01", " 24"]
},
{
"value": ["2018-04-01", " 38"]
},
{
"value": ["2018-05-01", " 49"]
},
{
"value": ["2018-06-01", " 45"]
},
{
"value": ["2018-07-01", " 41"]
},
{
"value": ["2018-08-01", " 60"]
},
{
"value": ["2018-09-01", " 40"]
},
{
"value": ["2018-10-01", " 49"]
},
{
"value": ["2018-11-01", "206"]
},
{
"value": ["2018-12-01", "167"]
},
{
"value": ["2019-01-01", " 60"]
},
{
"value": ["2019-02-01", " 38"]
},
{
"value": ["2019-03-01", " 44"]
},
{
"value": ["2019-04-01", " 43"]
},
{
"value": ["2019-05-01", " 50"]
},
{
"value": ["2019-06-01", " 58"]
},
{
"value": ["2019-07-01", " 60"]
},
{
"value": ["2019-08-01", " 49"]
},
{
"value": ["2019-09-01", " 63"]
},
{
"value": ["2019-10-01", " 50"]
},
{
"value": ["2019-11-01", "155"]
},
{
"value": ["2019-12-01", "180"]
},
{
"value": ["2020-01-01", " 77"]
},
{
"value": ["2020-02-01", " 47"]
}
],
"yAxisIndex": 0,
"xAxisIndex": 0,
"name": "Category 1",
"type": "line",
"coordinateSystem": "cartesian2d"
},
{
"data": [
{
"value": ["2017-06-01", "11"]
},
{
"value": ["2017-07-01", " 7"]
},
{
"value": ["2017-08-01", " 5"]
},
{
"value": ["2017-09-01", " 6"]
},
{
"value": ["2017-10-01", " 9"]
},
{
"value": ["2017-11-01", "33"]
},
{
"value": ["2017-12-01", "42"]
},
{
"value": ["2018-01-01", " 6"]
},
{
"value": ["2018-02-01", " 3"]
},
{
"value": ["2018-03-01", " 3"]
},
{
"value": ["2018-04-01", " 6"]
},
{
"value": ["2018-05-01", "10"]
},
{
"value": ["2018-06-01", " 4"]
},
{
"value": ["2018-07-01", "11"]
},
{
"value": ["2018-08-01", " 7"]
},
{
"value": ["2018-09-01", " 2"]
},
{
"value": ["2018-10-01", " 7"]
},
{
"value": ["2018-11-01", "36"]
},
{
"value": ["2018-12-01", "28"]
},
{
"value": ["2019-01-01", " 9"]
},
{
"value": ["2019-02-01", " 9"]
},
{
"value": ["2019-03-01", " 8"]
},
{
"value": ["2019-04-01", " 7"]
},
{
"value": ["2019-05-01", " 6"]
},
{
"value": ["2019-06-01", " 6"]
},
{
"value": ["2019-07-01", " 5"]
},
{
"value": ["2019-08-01", " 4"]
},
{
"value": ["2019-09-01", " 5"]
},
{
"value": ["2019-10-01", " 8"]
},
{
"value": ["2019-11-01", "15"]
},
{
"value": ["2019-12-01", "24"]
},
{
"value": ["2020-01-01", "10"]
},
{
"value": ["2020-02-01", " 6"]
}
],
"yAxisIndex": 0,
"xAxisIndex": 0,
"name": "Category 2",
"type": "line",
"coordinateSystem": "cartesian2d"
},
{
"data": [
{
"value": ["2017-06-01", "149"]
},
{
"value": ["2017-07-01", "158"]
},
{
"value": ["2017-08-01", "142"]
},
{
"value": ["2017-09-01", "133"]
},
{
"value": ["2017-10-01", "129"]
},
{
"value": ["2017-11-01", "693"]
},
{
"value": ["2017-12-01", "680"]
},
{
"value": ["2018-01-01", "189"]
},
{
"value": ["2018-02-01", "103"]
},
{
"value": ["2018-03-01", " 97"]
},
{
"value": ["2018-04-01", "103"]
},
{
"value": ["2018-05-01", "117"]
},
{
"value": ["2018-06-01", "146"]
},
{
"value": ["2018-07-01", "138"]
},
{
"value": ["2018-08-01", "144"]
},
{
"value": ["2018-09-01", "137"]
},
{
"value": ["2018-10-01", "140"]
},
{
"value": ["2018-11-01", "611"]
},
{
"value": ["2018-12-01", "722"]
},
{
"value": ["2019-01-01", "195"]
},
{
"value": ["2019-02-01", "124"]
},
{
"value": ["2019-03-01", "124"]
},
{
"value": ["2019-04-01", "127"]
},
{
"value": ["2019-05-01", "140"]
},
{
"value": ["2019-06-01", "169"]
},
{
"value": ["2019-07-01", "176"]
},
{
"value": ["2019-08-01", "132"]
},
{
"value": ["2019-09-01", "126"]
},
{
"value": ["2019-10-01", "128"]
},
{
"value": ["2019-11-01", "325"]
},
{
"value": ["2019-12-01", "516"]
},
{
"value": ["2020-01-01", "257"]
},
{
"value": ["2020-02-01", "118"]
}
],
"yAxisIndex": 0,
"xAxisIndex": 0,
"name": "Category 3",
"type": "line",
"coordinateSystem": "cartesian2d"
},
{
"data": [
{
"value": ["2017-06-01", "10"]
},
{
"value": ["2017-07-01", " 8"]
},
{
"value": ["2017-08-01", " 8"]
},
{
"value": ["2017-09-01", "10"]
},
{
"value": ["2017-10-01", " 4"]
},
{
"value": ["2017-11-01", "66"]
},
{
"value": ["2017-12-01", "66"]
},
{
"value": ["2018-01-01", "11"]
},
{
"value": ["2018-02-01", "10"]
},
{
"value": ["2018-03-01", " 3"]
},
{
"value": ["2018-04-01", " 5"]
},
{
"value": ["2018-05-01", " 9"]
},
{
"value": ["2018-06-01", "16"]
},
{
"value": ["2018-07-01", " 3"]
},
{
"value": ["2018-08-01", "11"]
},
{
"value": ["2018-09-01", "13"]
},
{
"value": ["2018-10-01", "12"]
},
{
"value": ["2018-11-01", "52"]
},
{
"value": ["2018-12-01", "60"]
},
{
"value": ["2019-01-01", "19"]
},
{
"value": ["2019-02-01", " 9"]
},
{
"value": ["2019-03-01", " 5"]
},
{
"value": ["2019-04-01", " 6"]
},
{
"value": ["2019-05-01", "12"]
},
{
"value": ["2019-06-01", "11"]
},
{
"value": ["2019-07-01", "11"]
},
{
"value": ["2019-08-01", " 8"]
},
{
"value": ["2019-09-01", " 9"]
},
{
"value": ["2019-10-01", " 5"]
},
{
"value": ["2019-11-01", "23"]
},
{
"value": ["2019-12-01", "32"]
},
{
"value": ["2020-01-01", "18"]
},
{
"value": ["2020-02-01", "15"]
}
],
"yAxisIndex": 0,
"xAxisIndex": 0,
"name": "Category 4",
"type": "line",
"coordinateSystem": "cartesian2d"
},
{
"data": [
{
"value": ["2017-06-01", "19"]
},
{
"value": ["2017-07-01", "25"]
},
{
"value": ["2017-08-01", "11"]
},
{
"value": ["2017-09-01", "19"]
},
{
"value": ["2017-10-01", "21"]
},
{
"value": ["2017-11-01", "42"]
},
{
"value": ["2017-12-01", "45"]
},
{
"value": ["2018-01-01", "21"]
},
{
"value": ["2018-02-01", "11"]
},
{
"value": ["2018-03-01", "15"]
},
{
"value": ["2018-04-01", "19"]
},
{
"value": ["2018-05-01", "24"]
},
{
"value": ["2018-06-01", "28"]
},
{
"value": ["2018-07-01", "24"]
},
{
"value": ["2018-08-01", "26"]
},
{
"value": ["2018-09-01", "26"]
},
{
"value": ["2018-10-01", "20"]
},
{
"value": ["2018-11-01", "65"]
},
{
"value": ["2018-12-01", "82"]
},
{
"value": ["2019-01-01", "39"]
},
{
"value": ["2019-02-01", "19"]
},
{
"value": ["2019-03-01", "30"]
},
{
"value": ["2019-04-01", "24"]
},
{
"value": ["2019-05-01", "35"]
},
{
"value": ["2019-06-01", "35"]
},
{
"value": ["2019-07-01", "45"]
},
{
"value": ["2019-08-01", "38"]
},
{
"value": ["2019-09-01", "26"]
},
{
"value": ["2019-10-01", "19"]
},
{
"value": ["2019-11-01", "65"]
},
{
"value": ["2019-12-01", "85"]
},
{
"value": ["2020-01-01", "44"]
},
{
"value": ["2020-02-01", "28"]
}
],
"yAxisIndex": 0,
"xAxisIndex": 0,
"name": "Category 5",
"type": "line",
"coordinateSystem": "cartesian2d"
}
]
}

If you want to show empty interval from January to June just add to xAxis option min: '2017-01-01'

Related

how to find selected fields from sample data in nested array in mongodb

I have sample collection of data
[
{
data: [
{
"id": "0001",
"type": "donut",
"name": "Cake",
"ppu": 0.55,
"batters": {
"batter": [
{
"id": "1001",
"type": "Regular"
},
{
"id": "1002",
"type": "Chocolate"
},
{
"id": "1003",
"type": "Blueberry"
},
{
"id": "1004",
"type": "Devil's Food"
}
]
},
"topping": [
{
"id": "5001",
"type": "None"
},
{
"id": "5002",
"type": "Glazed"
},
{
"id": "5005",
"type": "Sugar"
},
{
"id": "5007",
"type": "Powdered Sugar"
},
{
"id": "5006",
"type": "Chocolate with Sprinkles"
},
{
"id": "5003",
"type": "Chocolate"
},
{
"id": "5004",
"type": "Maple"
}
]
},
{
"id": "0002",
"type": "donut",
"name": "Raised",
"ppu": 0.55,
"batters": {
"batter": [
{
"id": "1001",
"type": "Regular"
}
]
},
"topping": [
{
"id": "5001",
"type": "None"
},
{
"id": "5002",
"type": "Glazed"
},
{
"id": "5005",
"type": "Sugar"
},
{
"id": "5003",
"type": "Chocolate"
},
{
"id": "5004",
"type": "Maple"
}
]
},
{
"id": "0003",
"type": "donut",
"name": "Old Fashioned",
"ppu": 0.55,
"batters": {
"batter": [
{
"id": "1001",
"type": "Regular"
},
{
"id": "1002",
"type": "Chocolate"
}
]
},
"topping": [
{
"id": "5001",
"type": "None"
},
{
"id": "5002",
"type": "Glazed"
},
{
"id": "5003",
"type": "Chocolate"
},
{
"id": "5004",
"type": "Maple"
}
]
}
]
}
]
and I need data only in this formate of a specific id.
[
{
"id": "0001",
"type": "donut",
"name": "Cake",
"ppu": 0.55
}
]
aggregate
db.collection.aggregate({
"$unwind": "$data"
},
{
"$match": {
"data.id": "0001"
}
},
{
"$project": {
"_id": "$data.id",
"type": "$data.type",
"name": "$data.name",
"ppu": "$data.ppu"
}
})
mongoplayground

Querying a map (<String, Object>) in JSON through MongoDB

How to query a map of type Map<String, List> in JSON form, in MongoDB?
Sample JSON:
{
"WIDTH": 810,
"HEIGHT": 465,
"MODULES": {
"23": {
"XNAME": "COMP1",
"PARAMS": {
"_Klockers": {
"TYPE": "text",
"VALUE": "Klocker#3"
},
"SUBSYS": {
"TYPE": "text",
"VALUE": "2"
},
"EP": {
"TYPE": "integer",
"VALUE": "2"
}
}
},
"24": {
"XNAME": "COMP2",
"PARAMS": {
"_Rockers": {
"TYPE": "text",
"VALUE": "Rocker#3"
},
"Driver": {
"TYPE": "binary",
"VALUE": 1
},
"EP": {
"TYPE": "long",
"VALUE": "233"
}
}
},
"25": {
"XNAME": "COMP3",
"PARAMS": {
"_Mockers": {
"TYPE": "text",
"VALUE": "Mocker#3"
},
"SYSMain": {
"TYPE": "text",
"VALUE": "2342"
},
"TLP": {
"TYPE": "double",
"VALUE": "2.3"
}
}
}
}
}
Basically I want to :
List all the "XNAME" field values of all keys in "MODULES".
Expected output : {"COMP1", "COMP2", "COMP3"}
List all the "TYPE" in "PARAMS" object within each key of "MODULES".
Expected output : {"text", "text", "integer", "text", "binary", "long", "text", "text", "double"}
I am new to MongoDB and any help or redirection is appreciated.
You can use this
db.collection.aggregate([
{
$project: {//You require this as your data is dynamic
"modules": {
"$objectToArray": "$MODULES"
}
}
},
{//Destruct the array
"$unwind": "$modules"
},
{
"$project": {//Again, requires the same as keys are dynamic
"types": {
"$objectToArray": "$modules.v.PARAMS"
},
xname: "$modules.v.XNAME"
}
},
{//Destruct the types
$unwind: "$types"
},
{//Get the distinct values
$group: {
"_id": null,
"xname": {
"$addToSet": "$xname"
},
"types": {
"$addToSet": "$types.v.TYPE"
},
}
}
])

"Client invalid path, not found in rest table" does anyone know what this Sabre's error means

I want to use this API service:
https://developer.sabre.com/docs/read/rest_apis/air/book/create_passenger_name_record
and the server responds with this json:
{
"status": "NotProcessed",
"type": "Application",
"errorCode": "ERR.2SG.CLIENT.INVALID_REQUEST",
"timeStamp": "2017-09-12T13:21:29.522-05:00",
"message": "Client invalid path, not found in rest table"
}
As mentioned in the comments, the endpoint is not right. After fixing that you'd get many different errors, for example you are referencing a Profile ID ABCDEF that doesn't exist.
I've modified that request so you'd get a successful response.
v2.0.0/passenger/records?mode=create
{
"CreatePassengerNameRecordRQ": {
"targetCity": "XXXX",
"TravelItineraryAddInfo": {
"AgencyInfo": {
"Ticketing": {
"TicketType": "7TAW/"
}
},
"CustomerInfo": {
"ContactNumbers": {
"ContactNumber": [
{
"Phone": "817-555-1212",
"PhoneUseType": "H"
}
]
},
"PersonName": [
{
"GivenName": "TEST",
"Surname": "TEST"
}
]
}
},
"AirBook": {
"OriginDestinationInformation": {
"FlightSegment": [
{
"ArrivalDateTime": "2018-07-20T14:20",
"DepartureDateTime": "2018-07-20T12:57",
"FlightNumber": "2404",
"NumberInParty": "1",
"ResBookDesigCode": "Y",
"Status": "NN",
"DestinationLocation": {
"LocationCode": "LAX"
},
"MarketingAirline": {
"Code": "AA",
"FlightNumber": "2404"
},
"MarriageGrp": "O",
"OriginLocation": {
"LocationCode": "DFW"
}
}
]
}
},
"AirPrice": {
"PriceRequestInformation": {
"OptionalQualifiers": {
"PricingQualifiers": {
"PassengerType": [
{
"Code": "ADT",
"Quantity": "1"
}
]
}
}
}
},
"MiscSegment": {
"DepartureDateTime": "2018-10-29",
"NumberInParty": 1,
"Status": "NN",
"Type": "OTH",
"OriginLocation": {
"LocationCode": "LAS"
},
"Text": "TEST",
"VendorPrefs": {
"Airline": {
"Code": "AA"
}
}
},
"SpecialReqDetails": {
"AddRemark": {
"RemarkInfo": {
"FOP_Remark": {
"Type": "CHECK",
"CC_Info": {
"Suppress": true,
"PaymentCard": {
"AirlineCode": "YY",
"CardSecurityCode": "1234",
"Code": "VI",
"ExpireDate": "2012-12",
"ExtendedPayment": "12",
"ManualApprovalCode": "123456",
"Number": "4123412341234123",
"SuppressApprovalCode": true
}
}
},
"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": "1"
}
]
}
},
"SpecialService": {
"SpecialServiceInfo": {
"Service": [
{
"SSR_Code": "OSI",
"PersonName": {
"NameNumber": "1.1"
},
"Text": "TEST",
"VendorPrefs": {
"Airline": {
"Code": "UA"
}
}
}
]
}
}
},
"PostProcessing": {
"RedisplayReservation": true,
"EndTransaction": {
"Source": {
"ReceivedFrom": "SWS TEST"
}
}
}
}
}

Acumatica Rest API to get sales order with line item detail

I was doing a demo and could easily create and retrieve orders but was not able to get the expand parameter to work
For example
I created order SO003615 with:
URI http://localhost/Acumatica6/entity/Default/6.00.001/SalesOrder
{
"OrderType": { value: "SO" },
"CustomerID" : { value : "ACTIVESTAF" } ,
"LocationID" : { value : "MAIN" },
"Description" : { value : "Sample Order"},
"Details" :
[
{
"InventoryID" : {value: "AACOMPUT01"},
"Quantity" : {value: 2},
"UOM" : {value: "EA"},
"UnitPrice" : {value: 1000.99}
},
{
"InventoryID" : {value: "AALEGO500"},
"Quantity" : {value: 1}
}
]
}
Then I tried to get order with
URI http://localhost/Acumatica6/entity/Default/6.00.001/SalesOrder/SO/SO003615?expand=Details
But the line items are not in the result. What am I missing?
{
"id": "37c15980-f71d-4496-882d-6e05e4a50061",
"rowNumber": 1,
"note": "",
"BillingAddressOverride": {
"value": false
},
"BillingContactOverride": {
"value": false
},
"CreditHold": {
"value": false
},
"Currency": {
"value": "USD"
},
"CustomerID": {
"value": "ACTIVESTAF"
},
"CustomerOrder": {},
"Date": {
"value": "2017-03-16T00:00:00-04:00"
},
"Description": {
"value": "Sample Order 6"
},
"DestinationWarehouseID": {},
"ExternalReference": {},
"Hold": {
"value": false
},
"IsTaxValid": {
"value": false
},
"LastModified": {
"value": "2017-03-17T01:05:56.74-04:00"
},
"LocationID": {
"value": "MAIN"
},
"NewCard": {
"value": false
},
"OrderedQty": {
"value": 3
},
"OrderNbr": {
"value": "SO003615"
},
"OrderTotal": {
"value": 2101.98
},
"OrderType": {
"value": "SO"
},
"PaymentCardIdentifier": {},
"PaymentMethod": {
"value": "CHECK"
},
"PaymentRef": {},
"PreferredWarehouseID": {},
"Project": {
"value": "X"
},
"RequestedOn": {
"value": "2017-03-16T00:00:00-04:00"
},
"ShippingAddressOverride": {
"value": false
},
"ShippingContactOverride": {
"value": false
},
"ShipVia": {},
"Status": {
"value": "Open"
},
"TaxTotal": {
"value": 0
},
"custom": {},
"files": []
}
It is $expand, not expand. Try using the following
http://localhost/Acumatica6/entity/Default/6.00.001/SalesOrder/SO/003615?$expand=Details

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.