Skip to main content

Overview

Accessing the Common Ninja API requires proper authentication to ensure data security and integrity.

There are three primary methods of authenticating your API requests.

The first method is through the OAuth 2.0 process, which is suitable for app level access. This method requires you to obtain an access token through a multi-step process.

The second method is more straightforward and is intended for account level access, primarily for individual users accessing their own account's resources. This method uses the CN-API-Token header for authentication.

The third method is designed specifically for our reseller partners. It's tailored for SaaS platforms that wish to provide their users with white label solutions. This method uses the CN-Reseller-Token and CN-Reseller-Tenant-ID headers for authentication, providing each tenant with their unique access to resources.

Each method caters to different use-cases, and developers can choose the most appropriate method based on their specific requirements.

App Access (OAuth2)

The Common Ninja API uses OAuth 2.0 for authentication. This section will guide you through the OAuth2 process to obtain an access token, which is required for making API requests.

Account Level Access

Alternatively, if you want to use the API without OAuth2 for your own account's purposes, you can use the CN-API-Token header to authenticate.

Example Request:

curl -H "CN-API-Token: ACCESS_TOKEN" "https://api.commoninja.com/platform/api/v1/widgets"
tip

You can find your account's API key in the account settings page. If you can't find it, please contact us at [email protected].

Reseller / White Label Access

For our reseller partners, we have a dedicated method for authentication. This method is based on two custom headers, CN-Reseller-Token and CN-Reseller-Tenant-ID.

Learn more about this method here.