Skip to main content

Who is this article for?
Find your product plan in the Code42 console on the Account menu.

Incydr Professional and Enterprise
Incydr Basic and Advanced
Other product plans

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:

On-premises

HOME
GETTING STARTED
RELEASE NOTES
FAQs
APIs
SYSTEM STATUS
Code42 Support

Introduction to the Code42 API

Who is this article for?
Find your product plan in the Code42 console on the Account menu.

Incydr Professional and Enterprise
Incydr Basic and Advanced
Other product plans

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:

On-premises

Overview

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. 

Considerations

  • 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

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.

HTTP methods

  • GET: Retrieve a resource.
  • POST: Create a new resource.
  • PUT: Update an existing resource.
  • DELETE: Destroy an existing resource.

Example commands

Use the Code42 API by sending requests to the Code42 cloud. In your requests, specify the path, resource, and parameters that define your request. 

Copied!
curl -X GET -u 'username' 'https://console.us.code42.com/api/User?q=eg@ex.com&active=true'
curl -X POST -u 'username' 'https://console.us.code42.com/c42api/v3/ping/error'
Authenticating with curl
The curl commands listed here expose your credentials on your device and your network. For more secure alternatives, see Authentication below.

Authentication

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.

Basic authentication

To use basic authentication, include your Code42 username in the API request and supply your password when prompted. For example:

Copied!
curl -u "username" https://console.us.code42.com/api/Computer

Token authentication

To use token authentication: 

  1. Include your Code42 username in a GET request to auth/jwt and supply your password when prompted. For example:
Copied!
curl -u "username" https://console.us.code42.com/c42api/v3/auth/jwt?useBody=true
Authentication cookies are not supported
You must include the ?useBody=true  query parameter in the auth/jwt   request to return the token in the response body. Omitting the ?useBody=true query parameter or using ?useBody=false results 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 Bearer scheme, for example, -H 'authorization: Bearer <token>'
  1. From the reply, copy the value of the v3_user_token. In the example below, it is eyJjdHki...txd546Eg
{"data":{"v3_user_token":"eyJjdHki...txd546Eg"},"error":null,"warnings":null}
  1. Place the token in the header of your API requests. For example:
-H "authorization: Bearer eyJjdHki...txd546Eg" 

Related topics

 

  • Was this article helpful?