Problem
How can I troubleshoot API call errors?
Environment
All versions of xMatters
Resolution
To effectively troubleshoot API call errors, you need to capture the response payload. For example, a 400 HTTP response code means that you had a bad request, which likely means your payload had some issues (malformed data, unsupported characters, bad JSON format, etc.). However, to fully understand why the API returned the error code, you need to capture the payload sent, as well as the full response payload.
In the example below, you can see the data that was sent in and what was returned. The response states what type of error it is, and provides a specific message and details. In this case, the value for the "test" property that we sent had too many characters, based on how the property is defined in that workflow.
Test Payload:
{
"properties": {
"test": "Testing 1.. 2.. 3.."
},
"recipients": [
{
"targetName": "testuser1|Work Email"
}
]
}
Test Response:
{
"type": "DATA_VALIDATION_ERROR",
"message": "There are data validation errors in the form.",
"errorDetails": [
{
"jsonPath": "properties/test",
"details": "Exceeded the specified maximum number of characters"
}
]
}
If you need further assistance with troubleshooting API requests, please contact our support team.
Comments
0 commentsArticle is closed for comments.