API Usage
  • 31 Aug 2023
  • 1 Minute to read
  • Dark
    Light
  • PDF

API Usage

  • Dark
    Light
  • PDF

Article Summary

The Ion Channel REST API provides full access to almost all of the features that exist within the user interface. This allows you to create your own applications, integrate your build tools, and obtain information or make changes directly from the command line with tools such as curl.

Authentication

Most of the Ion Channel API endpoints require that you provide a bearer token that grants you access to all of the teams and projects that you are a member of. Tokens can be created on the User Settings page. If the user who generated the token is ever removed from a team, their token will no longer have access to that team's data.

Below is an example of providing your API token via the curl command.

curl -H "Authorization: Bearer TOKEN"

If you have installed the Ion Connect CLI tool and have run the configure command, you will have an API token stored in the ~/.ionchannel/credentials.yaml file. With that data, you can use the following to pull the token from the file rather than entering it directly in the command line.

curl -H "Authorization: Bearer $(yq .secret_key ~/.ionchannel/credentials.yaml)

Using this Guide

In the categories below, several endpoints are included. For each, a brief summary, table including the endpoint name and parameters, usage example, and response example is included.

Each endpoint includes an example using curl. In those examples, data in bold indicates a place to enter your own information.

API Endpoint Categories

The following categories include detailed information for the most commonly used endpoints. Contact us at support@ionchannel.io if there is any function that you would like available via the API which you don't see listed here.

  • Analyses - Initiate new analyses and retrieve the results of one or more analyses.
  • Products - Search and obtain details of products.
  • Projects - Create new projects, update existing projects, and retrieve your project's data.
  • Reports - Retrieve various report data.
  • Rules and Rulesets - Create new rulesets and retrieve ruleset data.
  • Vulnerabilities - Retrieve vulnerability data, query for vulnerabilities affecting products, and retrieve all projects affected by a given vulnerability.

Was this article helpful?