Exporting API event data
Export your API Connect API event data using either the toolkit CLI or the REST API.
The export function in the Analytics dashboards exports just the data that is displayed in the UI. To export up to 10,000 API event records, you can use the toolkit CLI. To export all your analytics data use the REST API.
To export data with the toolkit CLI:
- Follow the steps to install and configure the toolkit CLI: Accessing analytics data with the toolkit CLI.
- Use the
events
command to export your analytics data; for example to export the events for a provider organization:
Your data is returned as a JSON array, each element is a single API event record.apic -m analytics events:orgList --analytics-service <analytics_service> --server <management_server_api_endpoint> --format=json { "total": 200, "search_time": 7, "events": [ { "log_policy": "activity", ...
To export data with the REST API:
- Follow the steps to get started with the REST API: Accessing analytics data with the REST API.
- Call the
events
API. For example, to get all analytics API event records from a provider organization, specify the organization's API path:
To get just the events for a provider organization, specify the organization in the API path:curl -v -k -H 'Accept: application/json' -H 'Authorization: Bearer <bearer_token>' -X GET --url 'https://<management_server_api_endpoint>/analytics/<analytics_service>/orgs/<provider_organization>/events' { "total": 45543, "search_time": 36, "events": [...]
orgs/<provider_organization>/events
.
Note: To get just the events for a catalog, specify the catalog in
the API path; for
example:
/analytics/<analytics_service>/catalogs/<provider_organization>/<catalog>/events