Incident Reporting and Update RESTful API query samples
book
Article ID: 215336
calendar_today
Updated On:
Products
Data Loss PreventionData Loss Prevention Enforce
Issue/Introduction
You are looking for Incident Reporting and Update RESTful API query samples.
Environment
These samples are valid for DLP 15.7 - 15.8 MP1
Resolution
This information is provided as a demonstration of a few of the available methods in the Incident REST API. Adapting these examples into a REST client is up to the end-user. Assistance with developing a REST client is only provided by professional services, not support.
Install a REST API test extension into your Edge or Chrome browser
These examples use the Talend API Tester Free Edition extension.
These examples assume you're using a browser on the Enforce, hence the server portion of the URLs is always "localhost"; adjust this as necessary for your environment.
Open the API Tester extension
Click Add Project and name it "Incidents"
Adding a Note to an Incident
Click Add Scenario, name the default request "Add Note" and click "Open Request"
Add a basic Authorization Header with the appropriate user name and password
Set the Method to PATCH and the sheme to "https://localhost/ProtectManager/webservices/v2/incidents"
Set the request body to the following, replacing the incidentIds with the appropriate incident id that you want to test with. This example is using incident id 64 for demonstration purposes only: { "requestId":"Talend", "incidentIds":[ 64 ], "incidentNotes":[ { "note":"Hello World" } ] }
Click the blue Send button
The full setup and response should look something like the following:
Navigating to the incident you updated, in the demo case incident 64, the notes tab should show "Hello World" similar to the below:
Retrieving a list of Incidents
Change the method to POST
Set the request body to the following: { "select": [ {"name": "incidentId"} , {"name": "creationDate"} , {"name": "matchCount" } , {"name": "messageSubject"} ] , "orderby":[{ "field": { "name": "messageDate" } , "order" : "DESC" }] , "limit": 2 }
Click the blue send button. You should see a response similar to the following:
Viewing Static Incident Attributes
Change the method to GET
Change the URL to https://localhost/ProtectManager/webservices/v2/incidents/<incidentId>/staticAttributes
You should get a response similar to the following:
Updating an Incident Status to Resolved
In the Talend API Tester
Set the method to GET
Set the URL to https://localhost/ProtectManager/webservices/v2/incidents/statuses
Click the blue send button
Notice the following statutes are returned in the response body (there may be others): [{"name":"incident.status.New","id":1},{"name":"Escalated","id":22},{"name":"Investigation","id":24},{"name":"Resolved","id":21},{"name":"Dismissed","id":23}]
Note that Resolved in this case is 21
Next
Set the method to PATCH
Set the URL to https://localhost/ProtectManager/webservices/v2/incidents/
Set the request body to the following (change the incident id list as appropriate): { "requestId":"Talend", "incidentIds":[ 64 ], "incidentStatusId": 21 }
Click the blue send button
Navigating to the incident snapshot in the Enforce console, notice that the Status is now set to Resolved, as shown below: