Overview
You can use the Incydr API to create custom reports, perform automated actions, or integrate with existing systems within your organization. This article shows some of the many ways you can use the Incydr API to interact with your environment.
Incydr Developer Portal
See the Developer Portal for more API documentation and resources. The portal provides:
- A single access point for documentation of methods for Incydr, including the REST API, Incydr SDK, and command-line interface (CLI)
- A single request URL for API calls to each cloud instance
- API reference documentation
Use the Developer Portal for your API needs as much as possible. APIs in the portal are the preferred way to integrate with Incydr. If you use APIs that do not appear on the Developer Portal, contact our Technical Support Engineers for guidance on the best way to integrate with Incydr.
Before you begin
Several examples below use the Python JSON formatting tool (python3 -mjson.tool). If your system does not have Python 3, you can install it from the official download page.
GitHub
GitHub is a popular open source code repository and social platform for developers. You can find additional API examples, code libraries, scripts, and developer documentation on Code42's GitHub page. Everyone is welcome to contribute.
Examples
Users
Security audit for admin access
As your environment grows over time, a large number of administrators may be involved with daily management. The following example uses the Users resource to list all of the active users with the assigned roleId=10, which corresponds to Org Admin. The output is then filtered with the grep utility to show only rows containing the usernames.
curl "https://console.us.code42.com/api/v1/User?active=true&pgSize=999&roleId=10&incRoles=true" -H 'Authorization: Bearer <auth_token>' | python3 -mjson.tool | grep -w username
Sample output:
"username": "michelle.lee@example.com",
"username": "chris.smith@example.com",
"username": "joe.johnson@example.com",
Move a user
You can move a user to a different organization by passing parameters to the API. Here the user account with userID=307 is moved to the organization with parentOrgId=71.
curl -v -H "Content-Type: application/json" -X POST -d '{"userId":307,"parentOrgId":71}' https://console.us.code42.com/api/v1/UserMoveProcess -H 'Authorization: Bearer <auth_token>'
Update a user's backup disk quota
You can use the Users resource to update the total amount of storage a user is allowed to consume across all devices. Here the user userId=80 is updated to have a 30 GB quota.
curl -X PUT -H "Content-Type: application/json" -d '{"quotaInBytes":30000000000}' https://console.us.code42.com/api/v1/User/80 -H 'Authorization: Bearer <auth_token>'
Comments
Please sign in to leave a comment.