API
Netwrix Change Tracker provides a comprehensive REST API that allows customers to integrate with the platform programmatically. This is particularly useful for customers who run multiple instances of Netwrix Change Tracker in multiple regions, as they can use the API to pull data from each instance and build global reports containing data from all instances.
Authentication
All API endpoints require authentication. You'll need to include appropriate authentication credentials with your requests. The specific authentication method is detailed in each API documentation page.
Available APIs
The following API endpoints are available in Netwrix Change Tracker:
-
Agents – Pull data on agent statuses, configurations, and group memberships using the agentsRanked endpoint. This API allows you to retrieve detailed information about all agents in your environment, including their group memberships and applied tracking templates.
-
Register Agents – Register new agents with the system using the agents/register endpoint. This API allows you to register both direct agents installed on devices and proxied devices accessed through another agent.
-
Credentials – Manage authentication credentials used by ChangeTracker to connect to various systems and services. This API provides endpoints for creating, retrieving, updating, and deleting credentials for different credential types including Shell, Database, FTP, Cloud, ESX, ITSM, and Splunk.
API Usage Best Practices
When working with the ChangeTracker API, consider the following best practices:
-
Rate Limiting: Implement appropriate rate limiting in your applications to avoid overwhelming the API.
-
Error Handling: Always implement proper error handling in your code to gracefully handle API errors.
-
Authentication: Store API credentials securely and never expose them in client-side code.
-
Data Filtering: When retrieving large datasets, use the available filtering parameters to limit the amount of data returned.
-
Pagination: For endpoints that return large collections, implement pagination to improve performance.
Example Usage
Below is a simple example of how to use the API with PowerShell:
# Set up a session variable for the Admin user
$myWebSession = GetAdminUserSession
# Define the API endpoint
$uri = "https://changetracker.example.com/api/agentsRanked"
# Define the request body
$requestBody = @{
DeviceFilter = @{
GroupNames = @()
AgentDeviceIds = @()
AgentDisplayNames = @()
ExcludeProxiedDevices = $false
OnlineStatuses = @("Online")
}
GetAgentGroupDetails = $true
GetRelatedTemplates = $true
} | ConvertTo-Json
# Make the API request
$result = Invoke-RestMethod -Method Post -ContentType application/json -Uri $uri -WebSession $myWebSession -Body $requestBody
For more detailed information about each API endpoint, please refer to the specific API documentation pages linked above.