简体   繁体   中英

Error: “Username value length exceeds 20 characters” when calling Sabre CarAvailability in Postman

I am trying to make a POST request to the Sabre CarAvailability API with Postman. When I make the request I get back the following error: Username value length exceeds 20 characters .

  • I obtained a bearer token and added it to the authorization section of my request
  • I added the carAvailabilityRequest object as raw data, in the body section of the request.
  • I tried changing the values of this object, but so far without luck. I know I am doing something wrong but I have no idea what.

Here is the carAvailabilityRequest object I passed:

{
  "OTA_VehAvailRateRQ": 
  {
    "TimeStamp": "string",
    "Version": "string",
    "ReturnHostCommand": true,
    "VehAvailRQCore": 
    {
      "RPH": 0,
      "QueryType": "Quote", 
      "VehRentalCore": 
      {
        "PickUpDateTime": "03-31T09:00",
        "ReturnDateTime": "04-05T11:00",
        "PickUpLocation": 
        {
          "LocationCode": "DFW",
          "CityLocation": "string"
        },
        "ReturnLocation": 
        {
          "LocationCode": "DFW"
        }
      }
    }
  }
}

The request does not get through and I get the following error message:

{
    "Fault": {
        "faultcode": "{http://schemas.xmlsoap.org/soap/envelope/}Client.EbXmlFieldTooLong",
        "faultstring": "Username value length exceeds 20 characters",
        "detail": {
            "StackTrace": [
                "com.sabre.universalservices.base.exception.InvalidEbXMLException: errors.xml.USG_EBXML_FIELD_TOO_LONG"
            ]
        }
    },
    "Links": [
        {
            "rel": "self",
            "href": "https://api-crt.cert.havail.sabre.com/v2.4.1/shop/cars"
        },
        {
            "rel": "linkTemplate",
            "href": "https://api-crt.cert.havail.sabre.com/<version>/shop/cars"
        }
    ]
}

Please help me solve this issue - thanks in advance.

Just from the message "Username value length exceeds 20 characters" I would expect that something is wrong with your authentification.

When following the link in your error response https://api-crt.cert.havail.sabre.com/v2.4.1/shop/cars it says again that something is wrong with your authentification/the authentification data is missing:

错误回应

It seems that something is not configured correctly with your authentification/bearer token or are you maybe sending to a wrong endpoint?

Something else you could try is setting the Content-Type of your request body to application/json because the API documentation you provided seems to define it this way.

You can do this in Postman in the Headers tab of your request:

邮递员标题标签

I tried it out myself with the same error message using the version v2.4.1

If you make the same request to a previous version you will get an appropiate answer. Use v2.4.0 https://api-crt.cert.havail.sabre.com/v2.4.0/shop/cars

HTH Pablo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM