Low-Fare endpoint returning JSON with missing operating.carrierCode - amadeus

The Low-fare endpoint just recently started returning JSON with some flight segments missing a key-value pair for operating.carrierCode, for example:
"operating": {
"number": “5898"
This was the second flight segment of the first result (data[0].offerItems[0].services[0].segments[1].flightSegment) when yesterday I searched:
https://test.api.amadeus.com/v1/shopping/flight-offers?origin=LON&destination=PAE&departureDate=2019-10-29&returnDate=2019-11-13&adults=1&nonStop=false&max=50
Here it is in context:
{
"data": [
{
"type": "flight-offer",
"id": "1564934270644-1482530186",
"offerItems": [
{
"services": [
{
"segments": [
{
"flightSegment": {
"departure": {
"iataCode": "LHR",
"terminal": "2",
"at": "2019-10-29T09:20:00Z"
},
"arrival": {
"iataCode": "SFO",
"terminal": "I",
"at": "2019-10-29T13:30:00-07:00"
},
"carrierCode": "SN",
"number": "9101",
"aircraft": {
"code": "777"
},
"operating": {
"carrierCode": "UA",
"number": "9101"
},
"duration": "0DT11H10M"
},
"pricingDetailPerAdult": {
"travelClass": "ECONOMY",
"fareClass": "K",
"availability": 4,
"fareBasis": "KLP5ULGT"
}
},
{
"flightSegment": {
"departure": {
"iataCode": "SFO",
"terminal": "3",
"at": "2019-10-29T16:15:00-07:00"
},
"arrival": {
"iataCode": "PAE",
"at": "2019-10-29T18:32:00-07:00"
},
"carrierCode": "UA",
"number": "5898",
"aircraft": {
"code": "E7W"
},
"operating": {
"number": “5898”
},
"duration": "0DT2H17M"
},
"pricingDetailPerAdult": {
"travelClass": "ECONOMY",
"fareClass": "K",
"availability": 9,
"fareBasis": "KLP5ULGT"
}
}
]
…
Is this a known bug? It was pretty easy to write a workaround, but I was surprised that this data was missing since it had been working correctly for months.

This is a common issue with the operating carrier even in cryptic mode
FLT/DATE RTNG CKIN TM DEP ARR TM EQP ML DURA DIST
UA5898 Y 29OCT SFOPAE 3 415P 632P E7W G 2:17 711
SFOPAE OPERATED BY SKYWEST DBA UNITED EXPRES
>
Whilst at shopping using enterprise apis you can use the same text describing the schedule data resumed by flight number.
Dont know of any parameter to get it in the api response too.

Related

Strange prices from Amadeus

I am checking the Amadeus about flight tickets and a little confused about the prices that I get. I expected to see prices from Amadeus closer to airline website prices or a little cheaper. But, I see that prices are incredibly high. For example, I made the following request:
https://api.amadeus.com/v2/shopping/flight-offers?originLocationCode=SGN&destinationLocationCode=DAD&departureDate=2020-05-29&adults=1&nonStop=true&currencyCode=VND
Flight at Amadeus Price In USD Airline price in USD
11:45 ~70.41 ~38.72
13:50 ~70.41 ~34.43
18:00 ~70.41 ~42.93
Prices are higher significantly. Moreover, prices from Amadeus are the same for a lot of flights for the same air company.
Do I do something wrong or I skipped something?
PS: Response for first flight:
{
"type": "flight-offer",
"id": "1",
"source": "GDS",
"instantTicketingRequired": false,
"nonHomogeneous": false,
"oneWay": false,
"lastTicketingDate": "2020-05-29",
"numberOfBookableSeats": 4,
"itineraries": [{
"duration": "PT1H20M",
"segments": [{
"departure": {
"iataCode": "SGN",
"terminal": "1",
"at": "2020-05-29T11:15:00"
},
"arrival": {
"iataCode": "DAD",
"terminal": "1",
"at": "2020-05-29T12:35:00"
},
"carrierCode": "VJ",
"number": "628",
"aircraft": {
"code": "321"
},
"operating": {
"carrierCode": "VJ"
},
"duration": "PT1H20M",
"id": "9",
"numberOfStops": 0,
"blacklistedInEU": false
}]
}],
"price": {
"currency": "VND",
"total": "1640000.00",
"base": "1381000.00",
"fees": [{
"amount": "0.00",
"type": "SUPPLIER"
},
{
"amount": "0.00",
"type": "TICKETING"
}
],
"grandTotal": "1640000.00"
},
"pricingOptions": {
"fareType": [
"PUBLISHED"
],
"includedCheckedBagsOnly": true
},
"validatingAirlineCodes": [],
"travelerPricings": [{
"travelerId": "1",
"fareOption": "STANDARD",
"travelerType": "ADULT",
"price": {
"currency": "VND",
"total": "1640000.00",
"base": "1381000.00"
},
"fareDetailsBySegment": [{
"segmentId": "9",
"cabin": "ECONOMY",
"fareBasis": "JSP",
"class": "J",
"includedCheckedBags": {
"weight": 20,
"weightUnit": "KG"
}
}]
}]
},
Keep in mind that right now the only source for prices in the API is GDS. Many LCCs don't / only load their more expensive fares into GDS, as it costs them money.
Lately, many "normal" airlines have also added fees when booking from a GDS compared to directly on their website / or other direct distribution methods.
I assume VietJet is one of those carriers, as it is a low-cost airline.
Regarding your second question: That is because of the fare system in the airline industry. Airlines load so called "fares", which specifies the price of a ticket for a given route within a date window.
An example: VietJet offers SGN-DAD for a base fare of 55EUR ( without taxes& fees ). You can choose any flight by VJ on any date within the window of the fare, and the price will be the same, as long as there is availability in the booking class J , which the fare is for.

Amadeus: How to get a successful response from the GET /shopping/hotel-offers/by-hotel endpoint?

Seems like no matter what hotel or check-in check-out dates I try, the GET /shopping/hotel-offers/by-hotel endpoint always returns no availability. The GET /shopping/hotel-offers for a city always returns one or more hotels that have availability. I understand that these can be cached results but then using any of those hotels in the GET /shopping/hotel-offers/by-hotel endpoint returns no availability
Example 1
GET https://test.api.amadeus.com/v2/shopping/hotel-offers?cityCode=NYC
(RESPONSE TRUNCATED FOR READABILITY)
{
"data": [
{
"type": "hotel-offers",
"hotel": {
"type": "hotel",
"hotelId": "BWNYC133",
"chainCode": "BW",
"dupeId": "700101379",
"name": "BEST WESTERN BOWERY HANBEE HTL"
...
"available": true,
"offers": [
{
"id": "15F1E33CA0571B94E27F2BA26CA4319C8A097B500D737AB68088E93AC813D2BC",
"rateCode": "SRS",
"rateFamilyEstimated": {
"code": "SRS",
"type": "C"
},
"boardType": "BREAKFAST",
"room": {
"type": "A1Q",
"typeEstimated": {
"category": "ACCESSIBLE_ROOM",
"beds": 1,
"bedType": "QUEEN"
},
}
...
],
...
}
Immediately followed by
GET https://test.api.amadeus.com/v2/shopping/hotel-offers/by-hotel?hotelId=BWNYC133
RESPONSE
{
"errors": [
{
"status": 400,
"code": 3664,
"title": "NO ROOMS AVAILABLE AT REQUESTED PROPERTY"
}
]
}
The same is true no matter what hotel in any city I try. Am I doing something wrong? I've been playing with the endpoints for a few hours now and have only been able to get a successful response from the hotels by city endpoint.
Appreciate any help provided.
EDIT
My issues are continuing in production now. I am getting no availability from /shopping/hotel-offers/by-hotel or /shopping/hotel-offers/{offerId} endpoints.
GET https://api.amadeus.com/v2/shopping/hotel-offers?cityCode=NYC&hotelIds=XTNYC130,ONNYCMIM,DSNYC132&checkInDate=2020-05-01&checkOutDate=2020-05-03&roomQuantity=1&adults=2&radius=5&radiusUnit=KM&paymentPolicy=NONE&includeClosed=false&bestRateOnly=true&view=FULL&sort=NONE
(RESPONSE TRUNCATED FOR READABILITY)
{
"data": [
{
"type": "hotel-offers",
"hotel": {
"type": "hotel",
"hotelId": "XTNYC130",
"chainCode": "XT",
"dupeId": "700070576"
"name": "DUANE STREET HOTEL",
},
"available": true,
"offers": [
{
"id": "394DF124A254A86DD6DA5D1A3084B543DFA462740EDAE34023151D479266C4DE",
"rateCode": "GMT"
}
],
"self": "https://api.amadeus.com/v2/shopping/hotel-offers/by-hotel?hotelId=XTNYC130&adults=2&checkInDate=2020-05-01&checkOutDate=2020-05-03&paymentPolicy=NONE&roomQuantity=1&view=FULL"
},
{
"type": "hotel-offers",
"hotel": {
"type": "hotel",
"hotelId": "ONNYCMIM",
"chainCode": "ON",
"dupeId": "700128992",
"name": "HOTEL MIMOSA"
},
"available": true,
"offers": [
{
"id": "547EA4B5F7F716DF083DFD19D857DAE0F1B6820E753D080F310737C5374AF857",
"rateCode": "BAR"
}
],
"self": "https://api.amadeus.com/v2/shopping/hotel-offers/by-hotel?hotelId=ONNYCMIM&adults=2&checkInDate=2020-05-01&checkOutDate=2020-05-03&paymentPolicy=NONE&roomQuantity=1&view=FULL"
},
{
"type": "hotel-offers",
"hotel": {
"type": "hotel",
"hotelId": "DSNYC132",
"chainCode": "DS",
"dupeId": "700224946",
"name": "The Ludlow Hotel"
},
"available": true,
"offers": [
{
"id": "CC8CD3A64562527B6330E1A317584E78B68537B1E682115497037D28CB466FDE",
"rateCode": "RAC"
}
],
"self": "https://api.amadeus.com/v2/shopping/hotel-offers/by-hotel?hotelId=DSNYC132&adults=2&checkInDate=2020-05-01&checkOutDate=2020-05-03&paymentPolicy=NONE&roomQuantity=1&view=FULL"
}
]
}
GET https://api.amadeus.com/v2/shopping/hotel-offers/by-hotel?hotelId=XTNYC130&adults=2&checkInDate=2020-05-01&checkOutDate=2020-05-03&paymentPolicy=NONE&roomQuantity=1&view=FULL
RESPONSE
{
"errors": [
{
"status": 400,
"code": 3664,
"title": "NO ROOMS AVAILABLE AT REQUESTED PROPERTY"
}
]
}
GET https://api.amadeus.com/v2/shopping/hotel-offers/by-hotel?hotelId=ONNYCMIM&adults=2&checkInDate=2020-05-01&checkOutDate=2020-05-03&paymentPolicy=NONE&roomQuantity=1&view=FULL
RESPONSE
{
"errors": [
{
"status": 400,
"code": 3664,
"title": "NO ROOMS AVAILABLE AT REQUESTED PROPERTY"
}
]
}
GET https://api.amadeus.com/v2/shopping/hotel-offers/by-hotel?hotelId=DSNYC132&adults=2&checkInDate=2020-05-01&checkOutDate=2020-05-03&paymentPolicy=NONE&roomQuantity=1&view=FULL
RESPONSE
{
"errors": [
{
"status": 400,
"code": 3664,
"title": "NO ROOMS AVAILABLE AT REQUESTED PROPERTY"
}
]
}
GET https://api.amadeus.com/v2/271FFDEF4E7FD5E1EEB10BFE59B0880B5F6AF4DCA73BA57E5489FDFE7E95AFCD
{
"errors": [
{
"status": 400,
"code": 477,
"title": "INVALID FORMAT"
}
]
}
We are experiencing temporary problems with some of our hotel providers test systems which is leading to slower than usual response times or timeouts as in your example. We tried the same request, and for most of the time, it does work, so while we are working with our providers to resolve this issue, you can try to do the request a few times until you have a response.
Sorry for the inconvenience!

eBay API issues - cannot publish an offer

All of the following is being performed in eBay's API sandbox.
I am attempting to list an item by using the inventory API. Specifically, I have created an inventory item and a relevant offer for that item. When I make a POST request to the publish offer endpoint, I get the following error:
{
"errors": [
{
"errorId": 25016,
"domain": "API_INVENTORY",
"subdomain": "Selling",
"category": "REQUEST",
"message": "The title value is invalid. Seller Provided Title Value is missing."
},
{
"errorId": 25002,
"domain": "API_INVENTORY",
"subdomain": "Selling",
"category": "REQUEST",
"message": "A user error has occurred. The duration \"GTC\" day(s) is not available for this listing type, or invalid for category \"49996\".",
"parameters": [
{
"name": "0",
"value": "GTC"
},
{
"name": "1",
"value": "49996"
}
]
}
]
}
I can't see any reference in any of the API documentation to a "Seller Provided Title". The duration error is also confusing as the API says it only supports "GTC" listings. The product has a title so it must be in reference to something else.
My inventory item is as follows:
{
"sku": "13725",
"product": {
"title": "Harley Davidson bike",
"aspects": {
"Year": [
"2016"
],
"Model": [
"Road Glide Special"
],
"Manufacurer": [
"Harley-Davidson®"
],
"Type": [
"Touring"
],
"For Sale By": [
"Dealer"
],
"Vehicle Title": [
"Clear"
],
"Mileage": [
"13393"
],
"VIN (Vehicle Identification Number)": [
"1HD1KTM10GB627264"
],
"Color": [
"Black Quartz"
]
},
"description": "Item description goes here",
"imageUrls": [
"https://dw4i9za0jmiyk.cloudfront.net/2018/01/12/pre_ic60e5df584b870c3d2a55c86800eede_70618b24eb08.jpg"
]
},
"condition": "USED_EXCELLENT",
"availability": {
"pickupAtLocationAvailability": [
{
"quantity": 1,
"merchantLocationKey": "425",
"availabilityType": "IN_STOCK",
"fulfillmentTime": {
"value": 1,
"unit": "DAY"
}
}
]
}
}
And my offer object is as follows:
{
"offerId": "5852159010",
"sku": "13725",
"marketplaceId": "EBAY_MOTORS",
"format": "FIXED_PRICE",
"availableQuantity": 0,
"pricingSummary": {
"price": {
"value": "18294.0",
"currency": "USD"
}
},
"listingPolicies": {
"paymentPolicyId": "5807565000",
"fulfillmentPolicyId": "5806186000"
},
"categoryId": "49996",
"merchantLocationKey": "425",
"tax": {
"applyTax": false
},
"status": "UNPUBLISHED",
"eBayPlusEligible": false
}
I had similar issues on sandbox, and came to the conculsion it was broken.
They also have some limits on only certain categories working.
Have you tried it agains the live API, I have found this to be far more reliable, ignoring the fact doing development work live is dangerous!
For your info here is my working code offer:
inventory_template = {
"availability": {
"shipToLocationAvailability": {
"quantity": product.quantity_available
}
},
"condition": "NEW",
"product": {
"aspects": {spec.name: [spec.value] for spec in product.specifics},
"brand": product.product_brand,
"description": product.product_description,
"imageUrls": [
"https://ebay.mydomain.co.uk/{}".format(img.image_link) for img in product.images],
"mpn": product.product_mpn,
"title": product.product_title,
"upc": [
product.product_upc,
],
"ean": [
product.product_ean,
],
# "epid": "string"
},
"sku": sku,
}
offer_body = {
"availableQuantity": offer.available_quantity,
"categoryId": offer.category_id,
"listingDescription": html,
"listingPolicies": {
"paymentPolicyId": offer.payment_policy_id,
"returnPolicyId": offer.return_policy_id,
"fulfillmentPolicyId": offer.fulfillment_policy_id,
},
"merchantLocationKey": offer.merchant_location_key,
"pricingSummary": {
"price": {
"value": offer.summary_price_value,
"currency": offer.summary_price_currency
}
},
"sku": offer.sku,
"marketplaceId": offer.marketplace_id,
"format": offer.format
}
the offer.available_quantity etc are items from my database, its the structure I'm showing.

Cumulocity measurement representation

I create measurements at reception of an event, I can get them using the API, but they are not represented graphically in the Device Management interface. I there a specific format they would have to respect to be representable automatically? If so, is there a place I can find all the formats supported by Cumulocity? I infered the c8y_TemperatureMeasurement from the examples in the doc but I didn't find an exhaustive list of the native formats.
Here are examples of the measurements I have at the moment:
{
"time": "2016-06-29T12:10:02.000+02:00",
"id": "27006",
"self": "https://<tenant-id>/measurement/measurements/27006",
"source": {
"id": "26932",
"self": "https://<tenant-id>/inventory/managedObjects/26932"
},
"type": "c8y_BatteryMeasurement",
"c8y_BatteryMeasurement": {
"unit": "V",
"value": 80
}
},
{
"time": "2016-06-29T10:15:22.000+02:00",
"id": "27010",
"self": "https://<tenant-id>/measurement/measurements/27010",
"source": {
"id": "26932",
"self": "https://<tenant-id>/inventory/managedObjects/26932"
},
"type": "c8y_TemperatureMeasurement",
"c8y_TemperatureMeasurement": {
"T": {
"unit": "C",
"value": 24
}
}
}
The measurements have to be sent to Cumulocity in the following format:
{
"fragment": {
"series": {
"unit": "x",
"value": y
}
}
}

how to write a query in oracle to get a single value as string from the json list?

I have a json string containing list of data, I want to write a query to get a single value based on the condition. but it is returning list of values. please help me to write a valid query in oracle database.
My json string looks like
[
{
"Key": [
{
"obj": {
"xyz":"cdf"
},
"Info": [
{
"Code": "",
"tax": "",
"rate": "",
"taxAmount": {
"formattedAmount": "",
"Amount": ""
}
},
{
"Code": "qwer",
"tax": "ggs",
"rate": "0",
"taxAmount": {
"formattedAmount": "10.00",
"Amount": "10.00"
},
"key": "qwer"
},
{
"Code": "poiu",
"tax": "ggs",
"rate": "0",
"taxAmount": {
"formattedAmount": "20.00",
"Amount": "20.00"
},
"key": "poiu"
},
{
"coverageCode": "zxcv",
"tax": "ggs",
"rate": "0",
"taxAmount": {
"formattedAmount": "30.00",
"Amount": "30.00"
},
"key": "zxcv"
}
]
},
{
"status": "S"
}
]
}
]
I want to get formattedAmount value "10.00". Written a query like
SELECT json_query(details, '$.Info.taxAmount.formattedAmount' WITH WRAPPER)
FROM details_table where json_query(details, '$.Info.Code' WITH WRAPPER) = 'qwer';
returns no value. without where clause i'll get all the formattedAmont in list [,"10.00","20.00","30.00"]