NetMon API
Overview
External programs can make requests to API endpoints (URLs) and receive responses that detail whether the requests were successful and return requested information.
The NetMon API allows for automation and programmatic interaction with the NetMon system. Users can leverage the NetMon API for configuration, as well as for retrieving PCAPs, reconstructed files, and metadata from the system for external use. In this guide, you will find practical information for interacting with the NetMon API using several common tools.
Authentication
The NetMon REST API uses a Bearer token over HTTPS. To access the Bearer token from NetMon:
- Open the NetMon Web Management interface.
- On the top navigation bar, click Configuration, and then click the User tab. The API Token panel appears at the top of the page.
- Click on New API Token.
- Copy the API Token from the field and paste it into your script or application.
Each time you click New API Token, NetMon generates a new API Token, invalidating the previous token and disabling access from any applications that are using it.
The API token is inaccessible once you navigate away from this page, so be sure to store it in a secure location.
Request Bodies
In most cases, the NetMon API expects request bodies for POST and PUT requests to contain JSON. In such cases, the parameter content type in the API route documentation is listed as application/json. For example, a PUT request to the /api/me route wants the UserDetails object as JSON. The UserDetails object has a string called firstName, a string called lastName, and a string called email. The following is an example of what the JSON body for a PUT request to /api/me might look like:
{
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]"
}
You might also notice other content types on some routes, such as application/x-7z-compressed for the "/api/session/(sessionID)/pcap" download route. You can use headers to specify content type, as shown in the examples on this page of how to make API calls.
Updated 20 days ago
