Hi, we are integrating Guardium with Resilient. We are trying to create an incident, and attach a pdf file to the incident. We use java REST API to post the attachment. But in both the Guardium application java codes, and on the "Resilient Systems REST API" page, I got 500 response code and the following response body:
{ "success": false,
"title": null,
"message": "Internal Server Error",
"hints": [],
"error_code": "generic"
}The following is the request from our java app that attaches the pdf file to the incident (which has ID=2000):
1. I made a call to "/rest/session" to get back CSRFToken and JSessionId first.
2. Create HttpPost request with this URI:
"https://<resilientHost>/rest/orgs/201/incidents/2000/attachments"
3. Set the following to the request:
- add header: "Accept": "application/json"
- add header: "Content-Type": "application/pdf"
- add header: "Cookie": "JSESSIONID=<JSessionId>"
- add header: "x-sess-id": <CSRFToken>
- set Entity with the FileEntity object of the pdf file
4. Call the HttpClient.execute(<the above HttpPost request>)
(The HttpClient is created with "TLSv1.2".)
This execute() returns 500 response code.
The Resilient server is
Version: 35.2.32. I logged in as a "Master Administrator".
What was missing or incorrect in the above codes to send attachment to incident? Is there any sample java codes that do this?
Please help, thanks!
------------------------------
Mei
------------------------------