Submit explanation

Submits an explanation response for a specified explanation request. This endpoint supports guest access, so it can be called with the token parameter instead of session authentication.

Required Permissions

Requires an account with the explanation review permission. You can also call this endpoint without session authentication by using the explanation token issued with the explanation request.

HTTP Request

POST /api/sonar/explanation-requests/:request_guid
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     -d type=EXPLANATION \
     -d status=SUBMITTED \
     -d result=1 \
     --data-urlencode content="This access was performed for legitimate business purposes." \
     -X POST \
     https://HOSTNAME/api/sonar/explanation-requests/49272877-75f2-4c2f-9301-d21c4f9a106d
Request Parameters
Path Parameters
KeyTypeDescriptionNote
request_guidStringExplanation request GUID36 characters
Body parameters
KeyRequiredTypeDescriptionNote
typeYesStringExplanation typeEXPLANATION, AUDITOR_COMMENT, or MANAGER_COMMENT
tokenNoStringGuest access tokenCan be used instead of session authentication
statusYesStringExplanation status
resultYes32-bit integerResult code
contentYesStringExplanation body

Success Response

{}

Error Responses

type parameter is missing

HTTP status code 400

{
  "error_code": "null-argument",
  "error_msg": "type should be not null"
}
Unsupported status value

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "No enum constant com.logpresso.sonar.api.explanation.ExplanationStatus.INVALID"
}
result is missing

HTTP status code 400

{
  "error_code": "null-argument",
  "error_msg": "result should be not null"
}
request_guid is not in valid GUID format

HTTP status code 400

{
  "error_code": "invalid-param-type",
  "error_msg": "request_guid should be guid type."
}
The explanation cannot be submitted

HTTP status code 500. You can check the reason code with the Get Explanation Request Explainable API.

{
  "error_code": "illegal-state",
  "error_msg": "already-submitted"
}
Employee information is missing when a reviewer submits an opinion

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "not-employee"
}
Permission denied or invalid token

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "no-permission"
}