Welcome to Cat2BugWelcome to Cat2Bug
Home
  • Cat2Bug-Platform
  • Cat2Bug-Platform
  • GitHub
  • Gitee
  • 简体中文
  • English
Home
  • Cat2Bug-Platform
  • Cat2Bug-Platform
  • GitHub
  • Gitee
  • 简体中文
  • English
  • Guide

    • Introduce
    • Experience
    • Rapid Deployment
    • /lang/us/document/cat2bug-platform/guide/update.html
  • Function

    • Member
    • Team
    • Project
    • Deliverable
    • Test Cases
    • Defect
    • Report
    • Document
    • /lang/us/document/cat2bug-platform/system/notice.html
  • API Interface

    • API Introduction
    • Defect Interface
    • Reporting Interface

API Introduction

Introduction

Starting from version 0.2.0, the system provides an Open API interface, mainly used for automated testing, converting test results into defects, and continuously tracking and managing them.

How To Call

Third party software can access the system through the HTTP interface, and the system provides a key for different access parties. Each call requires adding this key to the header, as shown below:

var myHeaders = new Headers();
myHeaders.append("CAT2BUG-API-KEY", "202402110748485l2ug97j471ul9wq");
myHeaders.append("User-Agent", "Apifox/1.0.0 (https://apifox.com)");
myHeaders.append("Accept", "*/*");
myHeaders.append("Host", "127.0.0.1:2020");
myHeaders.append("Connection", "keep-alive");

var requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("http://127.0.0.1:2020/api/defect", requestOptions)
   .then(response => response.text())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));

The second line in the interface code above is the API key we mentioned. When calling the interface, it must be named CAT2BUG-API-KEY, and its value is obtained through the system application.

Prompt

Each API KEY is only valid for one project

Create Key

In [Project Option](../system/project.md#Project Option), select API KEY to enter the key settings interface. The key can be set to expire, and when it expires, the key will no longer be usable.

API KEY

Last Updated:
Contributors: yuzhantao
Next
Defect Interface