Who is this article for?
Incydr Professional and Enterprise, yes.
Incydr Basic and Advanced, yes.
CrashPlan Cloud, yes.
Other product plans, yes.
CrashPlan for Small Business, no.
This article applies to Code42 cloud environments.
Other available versions:
This article provides an introduction to the Code42 API. You can use the APIs to perform a variety of tasks, from performing automated actions to integrating with existing systems.
- For assistance with using the Code42 API, contact your Customer Success Manager (CSM) to engage the Code42 Professional Services team.
Code42 API documentation is publicly available on the Code42 Developer Portal. You can see it in a browser without signing in. But the API resources themselves only work for you under these conditions:
- You have a product plan that includes access to the Code42 API.
- Your credentials rely on local authentication. SSO or authentication through any third-party provider will not work.
- Your role provides permission to access the data necessary to a given API resource. For example, if you do not have permission to change device settings in the Code42 console, then you don't have permission to change device settings with the API.
If your API calls fail because you do not have permission to use them, you will see reply messages like these:
- HTTP 401 Unauthorized
- HTTP 401 Could not authenticate user
- Your Code42 product plan does not permit use of the Code42 API.
Examples of tasks you can perform using the Code42 API
See the following articles for just some of the tasks you can perform using the Code42 API:
Tools for interacting with the Code42 API
The Code42 API is accessible through many tools, such as web browsers, scripting tools, and programming languages. Although the examples in our articles show use of the command line tool
curl to interact with the Code42 API, you can use many different tools.
For more information see Tools for interacting with the Code42 API.
API documentation is available on the Code42 Developer Portal.
Syntax and usage
The Code42 API uses a standardized API syntax and command structure. For more information, see Code42 API syntax and usage.
- GET: Retrieve a resource.
- POST: Create a new resource.
- PUT: Update an existing resource.
- DELETE: Destroy an existing resource.
Use the Code42 API by sending requests to the Code42 cloud. In your requests, specify the path, resource, and parameters that define your request.
curl -X GET -u 'username' 'https://console.us.code42.com/api/Useremail@example.com&active=true' curl -X POST -u 'username' 'https://console.us.code42.com/c42api/v3/ping/error'
The curl commands listed here expose your credentials on your device and your network. For more secure alternatives, see Authentication below.
Most requests to the Code42 API must be authenticated. While you can use basic authentication (username and password) we strongly recommend using a token authentication method for increased security.
For more information about authentication with the Code42 API, see Code42 API authentication methods.
To use basic authentication, include your Code42 username in the API request and supply your password when prompted. For example:
curl -u "username" https://console.us.code42.com/api/Computer
To use token authentication:
- Include your Code42 username in a GET request to auth/jwt and supply your password when prompted. For example:
curl -u "username" https://console.us.code42.com/c42api/v3/auth/jwt?useBody=true
You must include the
?useBody=truequery parameter in the
auth/jwtrequest to return the token in the response body. Omitting the
?useBody=truequery parameter or using
?useBody=falseresults in the token being returned in an authentication cookie, which is not supported by the Code42 API. Include the returned token in subsequent API requests using the authorization header with the
Bearerscheme, for example,
-H 'authorization: Bearer
- From the reply, copy the value of the v3_user_token. In the example below, it is
- Place the token in the header of your API requests. For example:
-H "authorization: Bearer eyJjdHki...txd546Eg"