IMPORTANT! The information on this page is unverified and unsupported. Always double-check the accuracy of the solutions provided. Evaluate and test the impact on any environments!
REST API - Server Returns HTTP 429 Response as text/xml Instead of application/json
Description
When exceeding the "bandwidthConfigs" capacity as set through API Throttling, the codebeamer server returns a response in form of string (content: text/xml, message: "Too many requests") instead of application/json, as it would be expected according to the OpenAPI specs:
"TooManyRequestsException": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"resourceUri": {
"type": "string"
},
"retryAfterSecond": {
"type": "integer",
"format": "int64"
}
}
}
Observed on
- codebeamer 21.09-LTS (EMMA)
Solution
Make sure to send requests with accept: 'application/json' Request header, for example:
$.ajax({
url: "http://localhost:8080/cb/api/v3/items/{itemId}",
type: 'GET',
accept: 'application/json',
Authorization: 'Basic redacted',
dataType: 'json',
success: function(res) {
console.log(res);
}
});
To know the default parameters and format of a request, feel free to use the Swagger Dashboard at {protocol}://{server}:{port}/{context}/api/v3/swagger/editor.spr: this has a convenience feature that converts the calls into cURL requests:
For any other Support options, questions, or inputs, visit: https://intland.com/technical-support/