API

Inspecode provides REST API that you can access with your API token. The base URL is https://inspecode.rocro.com/api/1. All the API paths are relative to this base URL.

For example, the API path /jobs/github.com/your-org/your-repo means https://inspecode.rocro.com/api/1/jobs/github.com/your-org/your-repo.

Error responses

All error responses have the same format below:

{
  "errors": [
    {
      "code": [error-code],
      "message": "[error-message]"
    },
    ...
  ]
}

code is an integer that indicates an error code. message is a string that indicates an error message.

Create a new job

You can create a new Inspecode job by sending a POST request to the path

jobs/[scm-domain]/[your-org]/[your-repo]

with the body parameters:

{
  "branch": "[branch-name]",
  "commit": "[commit-id]"
}

Both the parameters are optional. branch defaults to the default branch of your repository. commit defaults to the latest commit ID of branch.

The API will return the ID of your new job:

{
  "jobID": [job-id]
}

jobID is an integer that indicates the ID of a new job.

Get a job status

You can get the status of a Inspecode job by sending a GET request to the following path:

jobs/[scm-domain]/[your-org]/[your-repo]/[job-id]/status

The API will return a response with the following format:

{
  "status": "[job-status]"
}

status is a string that indicates the status of a job.

Get issues

You can get the issues detected in a Inspecode job by sending a GET request to the following path:

jobs/[scm-domain]/[your-org]/[your-repo]/[job-id]/issues

This API supports pagination and returns up to 100 issues per page. You can specify a page number by the query parameter:

?page=[page-number]

page starts from 1 and defaults to 1.

This API will return a response including the issue information with the Static Analysis Results Interchange Format (SARIF).

{
  "version": "2.1.0",
  "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
  ...
}

results matching ""

    No results matching ""