Using the Events API




This version of Events APIs will be deprecated soon. We recommend inSync administrators to use the enhanced version of Events API for exporting inSync events. For more information, see Events APIs to export inSync events.
Events API is a REST API that can be called using any REST client like Postman, or a Web browser. By default, the Events API response is in JSON format.
Using Events API to export inSync events is a two step procedure:
Step 1: Generate a token to access inSync API
Step 2: Access Events API using a Rest client
Pre-requisites
Ensure that the inSync Cloud administrator has enabled the option to export events. For more information, see Configure inSync to export events.
Procedure
Step 1: Generate a token to access Events API
Step 2: Access Events API using a REST client
inSync uses basic authentication, where an inSync Cloud administrator has to provide username and password to authenticate each Events API request.
Access Events API
Access Events API using a REST Client or run it as a query to get response in JSON, the default format.
Header Request for APIs
- Request URL: https://insyncapi-cloud.druva.com/api/events/v1
- Request_Headers: Authorization = <LOGIN CREDENTIALS>
Following is a sample query to access the Events API.
requests.get('https://insyncapi-cloud.druva.com/api/events/v1', auth=('<Username>', '<Password>'), cookies = {"progress": "<cookie value>"})
where,
- <Username> - Email address of the inSync administrator who generated the token or authentication information in Step 1: Obtain authentication information.
- <Password>- API access token, generated in Step 1: Obtain authentication information.
- <cookie value> - Progress cookie is received in the previous Events API response. Use progress cookie to get unique set of new inSync events in your subsequent Events API calls.
Note: You receive the progress cookie in an Events API response. While making the first Events API call only provide your authentication details.
Response Output format
By default, inSync provides Events API response in the JSON format.
Sample API response for an event
"EventID": "",
"Initiator": "cloud.admin@druva.org",
"inSyncDataSourceName": "Admin’s Mac mini",
"ClientVersion": "5.9.5r54841",
"Facility": 6,
"EventType": "Admin Audit Trail",
"ClientOS": "Mac OS X",
"inSyncUserID": 1,
"inSyncDataSourceID": 80,
"EventState": "Admin Event",
"EventDetails": "Device:cloud.admin@druva.org initiated backup for a device Admin’s Mac mini",
"IP": "192.168.0.0",
"ProfileID": 1,
"ProfileName": "Default",
"Timestamp": "09/21/17 13:41 ",
"inSyncUserName": "Ernie",
"Severity": 6
About Events API Response
- Each inSync Events API response contains a maximum of 500 inSync events.
- Every Events API response contains a progress cookie. A progress cookie, which is valid for the next 48 hours, is an identifier that contains inSync database reference and identifies the next set of unique events when successive Events API call is made.
- If there are more than 500 events in the inSync database while returning an Events API response, the response contains nextpage header attribute that contains the next page URL. Use the nextpage header attribute along-with the progress cookie in your subsequent API call to get additional set of inSync events.
Attributes received in the Events API Response
The following table lists the attributes that are fetched when you use the Events API in JSON format.
Attribute Name | Description |
---|---|
EventType |
The exported inSync event type. For the list of events, see Supported inSync events. |
EventState |
The state of the inSync event. For example, event triggered by administrator. For full list of state of events, see Supported inSync events. |
EventID |
The identifier to inter-relate multiple associated events. Example, all events with respect to backup event like Backup initialized, Backup paused, and Backup Success. |
Timestamp | The date and time when the event was generated. |
Initiator |
The initiator of the event. For example, Manual backup triggered by a user named Ernie Carter. In case of System event, the initiator will always be the name of the system. |
EventDetails |
Additional details about the event occurred. Example, if it is a backup event, details such as number of files backed up, number of files missed, time for backup, and so on. |
IP |
The IP address of the device on which the event occurred. In case of an admin event, IP address of the device on which the administrator logged on to perform inSync activity is displayed. |
ProfileID | inSync assigned identifier of the inSync profile to which the user, associated with the occurred event is linked to. |
ProfileName | The name of the inSync profile to which the user, associated with the occurred event is linked to. |
inSyncUserID | inSync assigned identifier of the user associated with the event. |
inSyncUserName | The name of the inSync user associated with the event. |
inSyncDataSource ID | The inSync assigned identifier of the user device, on which the event occurred. |
inSyncDataSourceName | The data source name on which the event occurred. |
ClientVersion | The inSync Client version on the user device. |
ClientOS | The OS on which the inSync Client is installed. |
Facility | The facility number as defined in inSync Management Console Events API settings. Default value is 23. |
Severity | The severity level of the event as defined in inSync. |
inSync also sends a response code with every Events API response. To know more, see Events API response codes.