SabreDevStudio / postman-collections

Postman files demonstrating how to call and use APIs found in the Sabre Dev Studio portfolio.
https://developer.sabre.com/
87 stars 122 forks source link

Car Search fails: ERR.NGCP-DISTRIBUTION.INTERNAL_ERROR #2

Closed mateusgrb closed 3 years ago

mateusgrb commented 3 years ago

Hey team!

Sorry in advance if this is not the right place, but I couldn't find a repo for cars. I'm trying to consume the /v2.0.0/Get/VehAvail endpoint but I keep getting a 400 Bad Request error with this body:

{
    "errorCode": "ERR.NGCP-DISTRIBUTION.INTERNAL_ERROR",
    "message": "Error occurred while invoking service restish:convertToOutputFormat:1.65.0",
    "status": "Incomplete",
    "type": "Application",
    "timeStamp": "2021-02-23T08:21:26-06"
}

Here's the request body:

{
    "GetVehAvailRQ": {
        "SearchCriteria": {
            "PickUpDate": "2021-04-15",
            "PickUpTime": "07:30",
            "ReturnDate": "2021-04-16",
            "ReturnTime": "07:30",
            "SortBy": "Preferred",
            "SortOrder": "ASC",
            "RentalLocRef": {
                "PickUpLocation": {
                    "ExtendedLocationCode": "SFO",
                    "LocationCode": "SFO"
                },
                "ReturnLocation": {
                    "ExtendedLocationCode": "SFO",
                    "LocationCode": "SFO"
                }
            },
            "ImageRef": {
                "Image": {
                    "Type": "ORIGINAL"
                }
            },
            "LocPolicyRef": {
                "Include": true
            },
            "RatePrefs": {
                "Commission": false,
                "RateAssured": false,
                "ConvertedRateInfoOnly": false,
                "SupplierCurrencyOnly": false
            },
            "CarExtrasPrefs": {
                "CarExtrasPref": [
                    {
                        "Type": "NAV"
                    }
                ]
            },
            "VendorPrefs": {
                "VendorPref": {
                    "Code": "ET"
                }
            }
        }
    }

I've also tried to search for cars with the SOAP API and got an error with the same code:

<soap-env:Fault>
            <faultcode>soap-env:Server</faultcode>
            <faultstring>Error occurred while invoking service GetVehAvailRQ:1.0.0</faultstring>
            <detail>
                <ns10:ApplicationResults xmlns:ns10="http://services.sabre.com/STL_Payload/v02_02" status="Incomplete">
                    <ns10:Error type="Application" timeStamp="2021-02-23T08:37:38.755-06:00">
                        <ns10:SystemSpecificResults>
                            <ns10:Message code="ERR.NGCP-DISTRIBUTION.INTERNAL_ERROR">Error occurred while invoking service GetVehAvailRQ:1.0.0</ns10:Message>
                            <ns10:Message>{"category":"ERR.NGCP-DISTRIBUTION.INTERNAL_ERROR","message":"txCtx not set","status":"Incomplete","type":"Application"}</ns10:Message>
                        </ns10:SystemSpecificResults>
                    </ns10:Error>
                </ns10:ApplicationResults>
            </detail>
        </soap-env:Fault>

Any thoughts?

gonzalojorge commented 3 years ago

Hi,

You are likely missing one header: Accept:application/json

The below request should work:

POST /v2.0.0/get/vehavail HTTP/1.1 Host: api-crt.cert.havail.sabre.com Accept: application/json Authorization: Bearer xxxxxxxxxxxx Content-Type: text/plain

{
  "GetVehAvailRQ": {
    "SearchCriteria": {
      "AirportRef": {
        "PickUpLocation": {
          "LocationCode": "SFO"
        }
      },
      "RatePrefs": {
        "ConvertedRateInfoOnly": false,
        "SupplierCurrencyOnly": true
      },
      "PickUpTime": "10:30",
      "ReturnTime": "10:30",
      "PickUpDate": "2021-03-25",
      "ReturnDate": "2021-04-01",
      "LocPolicyRef": {
        "Include": false
      },
      "VendorPrefs": {
        "VendorPref": [
          {
            "Code": "ZE"
          }
        ]
      }
    }
  }
}
mateusgrb commented 3 years ago

thanks! that did it