接口说明

利用蒲公英 Tracup 提供的接口,第三方用户可以创建项目、获取项目列表、创建问题、指派问题等,方便用户高效地追踪 Bug。


  1. 除特别说明,所有数据API的请求方式均为HTTP POST方式。
  2. 获取图片等资源文件接口的请求方式为HTTP GET
  3. API接口返回数据格式为JSON。
  4. 所有接口请求时,必须包含参数_api_key,以便识别接口身份。点击获取_api_key

常规参数说明

参数 别称 说明
_api_key API Key API Key,用来识别API调用者的身份,如不特别说明,每个接口中都需要含有此参数。对于同一个蒲公英的注册用户来说,这个值在固定的。点击获取API Key
uKey User Key 用户Key,用来标识当前用户的身份,对于同一个蒲公英的注册用户来说,这个值在固定的。 点击获取uKey
pKey Project Key 代表一个具体的项目的唯一标识。
iNo String Issue No (Issue No 是唯一标识项目的问题编号)

示例代码

PHP调用接口示例(查看项目信息):

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://https://seed.pgyer.com/apiv1/project/view');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, '_api_key=&pKey=123456');
$response = curl_exec($curl);
if(curl_errno($curl)){
    echo curl_error($curl);
}
curl_close($curl);
$jsonData = json_decode($response, true);
print_r($jsonData);

创建项目

通过该接口,用户可以创建项目到 Tracup 。创建时,请使用 HTTP POST 方式

API地址

POST http://https://seed.pgyer.com/apiv1/project/create

POST参数

参数 类型 说明
uKey String (必填) 用户Key 点击获取uKey
_api_key String (必填) API Key 点击获取API Key
projectName String (必填) 项目名称
projectBackground Int (必填) 项目背景色,值为:1,2,3,4,5,6,7, 默认为1
projectDescription String (选填) 项目描述

返回数据

参数 类型 说明
projectKey String Project Key
projectName String Project Name
projectBackground Integer 颜色类型(1:Gray; 2:Orange; 3:Yellow; 4:Grassgreen; 5:Green; 6:Blue; 7:Purple)
projectDescription String 项目描述
projectPeople Int 项目人数
projectIsHide Int 项目是否回收,1 是,0否
projectCreated Date 项目创建时间
projectUpdated Date 项目修改时间
userKey String 项目创建人的User Key
userName String 项目创建人的用户名

修改项目

通过该接口,用户可以修改项目信息。修改时,请使用 HTTP POST 方式

API地址

POST http://https://seed.pgyer.com/apiv1/project/update

POST参数

参数 类型 说明
uKey String (必填) 用户Key 点击获取uKey
_api_key String (必填) API Key 点击获取API Key
pKey String (必填) 项目的key
projectName String (必填) 项目名称
projectBackground Int (必填) 项目背景色,值为:1,2,3,4,5,6,7, 默认为1
projectDescription String (选填) 项目描述

返回数据

参数 类型 说明
projectKey String Project Key
projectName String Project Name
projectBackground Integer 颜色类型(1:Gray; 2:Orange; 3:Yellow; 4:Grassgreen; 5:Green; 6:Blue; 7:Purple)
projectDescription String 项目描述
projectPeople Int 项目人数
projectIsHide Int 项目是否回收,1 是,0否
projectCreated Date 项目创建时间
projectUpdated Date 项目修改时间
userKey String 项目创建人的User Key
userName String 项目创建人的用户名

获取项目详细信息

该接口可以获取某个 项目的详细信息。

API地址

POST http://https://seed.pgyer.com/apiv1/project/view

POST参数

参数 类型 说明
pKey String Project Key (Project Key是唯一标识项目的索引ID)
uKey String (选填) 用户Key 点击获取uKey
_api_key String API Key 点击获取API Key

返回数据

应用详情返回参数 类型 说明
projectKey String Project Key
projectName String Project Name
projectBackground Integer 颜色类型(1:Gray; 2:Orange; 3:Yellow; 4:Grassgreen; 5:Green; 6:Blue; 7:Purple)
projectDescription String 项目描述
projectPeople Int 项目人数
projectIsHide Int 项目是否回收,1 是,0否
projectCreated Date 项目创建时间
projectUpdated Date 项目修改时间
userKey String 项目创建人的User Key
userName String 项目创建人的用户名
moduleList json 模块列表
statusList json 状态列表
userList json 用户列表
versionList json 版本列表
priorityList json 优先级列表
typeList json 类型列表

获取全部项目列表

API地址

POST http://https://seed.pgyer.com/apiv1/project/getAllProjectList

POST参数

参数 类型 说明
uKey String 用户Key 点击获取uKey
_api_key String API Key 点击获取API Key

返回数据

返回参数 类型 说明
reatedProjectList Json 我创建的项目列表
reatedProjectCount Int 我创建的项目数量
participantProjectList Json 我参与的项目列表
participantProjectCount Int 我参与的项目数量
starProjectList Json 星标项目列表
starProjectCount Int 星标项目数量

查看自己创建的项目

API地址

POST http://https://seed.pgyer.com/apiv1/project/listMyProject

POST参数

参数 类型 说明
uKey String 用户Key 点击获取uKey
page Integer (选填) 填写数字页数
_api_key String API Key 点击获取API Key

返回数据

返回参数 类型 说明
projectKey String Project Key
projectName String Project Name
projectBackground Integer 颜色类型(1:Gray; 2:Orange; 3:Yellow; 4:Grassgreen; 5:Green; 6:Blue; 7:Purple)
projectDescription String 项目描述
projectPeople Int 项目人数
projectIsHide Int 项目是否回收,1 是,0否
projectCreated Date 项目创建时间
projectUpdated Date 项目修改时间
userKey String 项目创建人的User Key
userName String 项目创建人的用户名

我参与的项目列表

我参与的项目

API地址

POST http://https://seed.pgyer.com/apiv1/project/listParticipantProject

POST参数

参数 类型 说明
uKey String 用户Key 点击获取uKey
_api_key String API Key 点击获取API Key

返回数据

返回参数 类型 说明
projectKey String Project Key
projectName String Project Name
projectBackground Integer 颜色类型(1:Gray; 2:Orange; 3:Yellow; 4:Grassgreen; 5:Green; 6:Blue; 7:Purple)
projectDescription String 项目描述
projectPeople Int 项目人数
projectIsHide Int 项目是否回收,1 是,0否
projectCreated Date 项目创建时间
projectUpdated Date 项目修改时间
userKey String 项目创建人的User Key
userName String 项目创建人的用户名

星标项目列表

星标项目

API地址

POST http://https://seed.pgyer.com/apiv1/project/listStarProject

POST参数

参数 类型 说明
uKey String 用户Key 点击获取uKey
_api_key String API Key 点击获取API Key

返回数据

返回参数 类型 说明
projectKey String Project Key
projectName String Project Name
projectBackground Integer 颜色类型(1:Gray; 2:Orange; 3:Yellow; 4:Grassgreen; 5:Green; 6:Blue; 7:Purple)
projectDescription String 项目描述
projectPeople Int 项目人数
projectIsHide Int 项目是否回收,1 是,0否
projectCreated Date 项目创建时间
projectUpdated Date 项目修改时间
userKey String 项目创建人的User Key
userName String 项目创建人的用户名

获取类型列表

API地址

POST http://https://seed.pgyer.com/apiv1/project/getProjectTypeList

POST参数

参数 类型 说明
pKey String 项目Key
uKey String 用户Key 点击获取uKey
_api_key String API Key 点击获取API Key

返回数据

返回参数 类型 说明
projectTypeKey String 项目类型的 Key
projectKey String 项目的 Key
userKey String 用户的 Key
projectTypeName String 类型名称
projectTypeBackground Int 类型颜色
projectTypeCreated Date 类型创建时间
projectTypeUpdated Date 类型跟新时间
projectTypeDeleted Date 类型删除时间
projectTypeStatus Int 类型状态
issueCount Int 问题数量

获取模块列表

API地址

POST http://https://seed.pgyer.com/apiv1/project/getProjectModuleList

POST参数

参数 类型 说明
pKey String 项目Key
uKey String 用户Key 点击获取uKey
_api_key String API Key 点击获取API Key

返回数据

返回参数 类型 说明
projectModuleKey String 项目模块的 Key
projectKey String 项目的 Key
userKey String 用户的 Key
projectModuleName String 模块名称
projectModuleParentKey String 模块上级的 Key
projectModuleCreated Date 模块创建时间
projectModuleUpdated Date 模块跟新时间
projectModuleDeleted Date 模块删除时间
projectModuleStatus Int 模块状态
issueCount Int 问题数量

获取版本列表

API地址

POST http://https://seed.pgyer.com/apiv1/version/listAll

POST参数

参数 类型 说明
pKey String 项目Key
uKey String 用户Key 点击获取uKey
_api_key String API Key 点击获取API Key
page Int 页码
perpage Int 每页显示数量

返回数据

返回参数 类型 说明
versionKey String 版本的 Key
versionNo String 版本的名称
projectKey String 项目的 Key
userKey String 用户的 Key
versionDescription String 版本描述
versionStarted Date 版本开始时间
versionEnded Date 版本结束时间
v_order Int 版本排序
v_status_flag Int 版本状态标记
versionCreated Date 版本创建时间
versionUpdated Date 版本更新时间
versionDeleted Date 版本删除时间
versionStatus Int 版本状态
userName String 版本创建人姓名
userAvator String 版本创建人头像
percent Int 已完成问题的半分比
allCount Int 问题数量
count Int 版本数量
perpage Int 每页显示数量
page Int 页码
pageCount Int 页数

获取优先级列表

API地址

POST http://https://seed.pgyer.com/apiv1/project/getPriorityList

POST参数

参数 类型 说明
_api_key String (必填) API Key 点击获取API Key

返回数据

返回参数 类型 说明
id Int 优先级的 id
title String 优先级名称
class String 优先级的 class

获取状态列表

API地址

POST http://https://seed.pgyer.com/apiv1/project/getStatusList

POST参数

参数 类型 说明
pKey String 项目Key
uKey String 用户Key 点击获取uKey
_api_key String (必填) API Key 点击获取API Key

返回数据

返回参数 类型 说明
id Int 状态的 id
title String 状态名称
class String 状态的 class

创建问题

通过该接口,用户可以创建问题到 Tracup。创建时,请使用 HTTP POST 方式

API地址

POST http://https://seed.pgyer.com/apiv1/issue/create

POST参数

参数 类型 说明
uKey String (必填) 用户Key 点击获取uKey
_api_key String (必填) API Key 点击获取API Key
pKey String (必填) 项目的 pKey
issueTitle String (必填) 问题标题
parentIssueKey String (选填) 父问题的 iKey
issueType String (必填) 问题类型,如:任务、Bug、功能等
issueDescription String (选填) 问题的描述
issuePriority Int (选填) 问题的优先级
issueFinished Date (选填) 结束时间
issueVersion String (选填) 版本
issueModules String (选填) 模块
issueAssignee Email (选填) 指派用户,填写指派用户的注册邮箱地址
issueFollower String (选填) 关注用户,填写关注用户的邮箱地址,多个账号使用 ; 号隔开, 如:bug@pgyer.com;pgyer@pgyer.com

返回数据

参数 类型 说明
issueKey String 问题 Key
issueParentKey String 父问题 Key
projectKey String 项目 Key
issueNo String 问题编号
issueType String 问题类型
issueTitle String 问题标题
issueDescription String 问题描述
issueAssignee String 指派
issuePriority String 优先级
issueStatus String 状态
userKey String 用户Key
versionKey String 版本 Key
projectModuleKey String 模块 Key
projectTypeKey String 类型 Key
issueFinished Date 完成时间
issueCreated Date 创建时间
issueUpdated Date 更新时间
issueDeleteStatus String 是否删除,1已删除, 2未删除
author String 问题作者
projectName String 项目名称
versionNo String 版本
projectModuleName String 模块名称
issueFollow Array 关注者, 结构: {{"issueKey":问题 Key, "userName":用户名, "userKey": 用户Key},...}
issueUnFinished bool 完成状态
subIssueList/parentInfo Array 子问题/父问题

修改问题

通过该接口,用户可以修改问题信息。修改时,请使用 HTTP POST 方式

API地址

POST http://https://seed.pgyer.com/apiv1/issue/update

POST参数

参数 类型 说明
uKey String (必填) 用户Key 点击获取uKey
_api_key String (必填) API Key 点击获取API Key
pKey String (必填) 项目的key
iNo String (必填) 问题的编号
issueType String (选填) 问题类型 填写类型对应key值
issueStatus Int (选填) 问题状态 填写状态对应key值
issuePriority Int (选填) 问题的优先级, 填写优先级的值(留空默认不修改):
1:高
2:中
3:低
issueAssignee Email (选填) 指派用户的邮箱地址(留空默认不修改)
issueFollower String (选填) 跟踪用户,填写跟踪用户的邮箱地址,多个账号使用 ; 号隔开, 如:bug@pgyer.com;pgyer@pgyer.com
versionNo String (选填) 版本号,例如:1.0
issueTitle String (选填) 标题
issueDescription String (选填) 描述
issueFinished Date (选填) 结束时间。例如:YY-MM-DD HH:II:SS
projectModuleName String (选填) 模块名称

返回数据

参数 类型 说明
issueKey String 问题 Key
issueParentKey String 父问题 Key
projectKey String 项目 Key
issueNo String 问题编号
issueType String 问题类型
issueTitle String 问题标题
issueDescription String 问题描述
issueAssignee String 指派
issuePriority String 优先级
issueStatus String 状态
userKey String 用户Key
versionKey String 版本 Key
projectModuleKey String 模块 Key
projectTypeKey String 类型 Key
issueFinished Date 完成时间
issueCreated Date 创建时间
issueUpdated Date 更新时间
issueDeleteStatus String 是否删除,1已删除, 2未删除
author String 问题作者
projectName String 项目名称
versionNo String 版本
projectModuleName String 模块名称
issueFollow Array 关注者, 结构: {{"issueKey":问题 Key, "userName":用户名, "userKey": 用户Key},...}
issueUnFinished bool 完成状态
subIssueList/parentInfo Array 子问题/父问题

获取问题详细信息

该接口可以获取某个问题的详细信息。

API地址

POST http://https://seed.pgyer.com/apiv1/issue/view

POST参数

参数 类型 说明
uKey String (选填) 用户Key 点击获取uKey
_api_key String API Key 点击获取API Key
pKey String Project Key (Project Key是唯一标识项目的索引ID)
iNo String Issue No (Issue No 是唯一标识项目的问题编号)

返回数据

问题详情返回参数 类型 说明
issueKey String 问题 Key
issueParentKey String 父问题 Key
projectKey String 项目 Key
issueNo String 问题编号
issueType String 问题类型
issueTitle String 问题标题
issueDescription String 问题描述
issueAssignee String 指派
issuePriority String 优先级
issueStatus String 状态
userKey String 用户Key
versionKey String 版本 Key
projectModuleKey String 模块 Key
projectTypeKey String 类型 Key
issueFinished Date 完成时间
issueCreated Date 创建时间
issueUpdated Date 更新时间
issueDeleteStatus String 是否删除,1已删除, 2未删除
author String 问题作者
projectName String 项目名称
versionNo String 版本
projectModuleName String 模块名称
issueFollow Array 关注者, 结构: {{"issueKey":问题 Key, "userName":用户名, "userKey": 用户Key},...}
issueUnFinished bool 完成状态
subIssueList/parentInfo Array 子问题/父问题

获取项目的问题列表

获取项目的问题列表

API地址

POST http://https://seed.pgyer.com/apiv1/issue/listIssue

POST参数

参数 类型 说明
uKey String 用户Key 点击获取uKey
_api_key String API Key 点击获取API Key
pKey String Project Key 项目的Key
page Int Page 分页面码,每页显示20条记录
types, types[] String, Arr 类型(需要传递projectTypeKey)
status, status[] Int, Arr 状态(1:新建, 2:处理, 3:解决, 4:忽略, 5:待反馈, 6:关闭, 7:重新打开)
prioritys, prioritys[] Int, Arr 优先级
sortName String 排序依据(编号: i_no, 状态: i_status, 创建时间: i_created, 更新时间: i_updated )
sort String 排序方向 (asc, desc) 默认desc

返回数据

返回参数 类型 说明
issueKey String 问题Key
issueTitle String 问题标题
issueNo String 问题编号
issueDescription String 问题描述
issueType String 类型
issueAssignee String 指派用户
issuePriority String 优先级
issueStatus String 状态
issueUpdated String 更新时间
issueCreated String 创建时间
issueFinished String 完成时间
userName String 创建者
userAvator String 头像地址
issueModule String 模块
issueVersion String 版本号
hasFile Bool 是否有附件

添加备注

API地址

POST http://https://seed.pgyer.com/apiv1/issue/addNote

POST参数

参数 类型 说明
uKey String (选填) 用户Key 点击获取uKey
_api_key String API Key 点击获取API Key
pKey String Project Key (Project Key是唯一标识项目的索引ID)
iNo String Issue No (Issue No 是唯一标识项目的问题编号)
content String (必填) 备注内容

返回数据

问题详情返回参数 类型 说明
data String 新增备注的 Key

备注列表

API地址

POST http://https://seed.pgyer.com/apiv1/issue/getNoteList

POST参数

参数 类型 说明
uKey String (选填) 用户Key 点击获取uKey
_api_key String API Key 点击获取API Key
pKey String Project Key (Project Key是唯一标识项目的索引ID)
iNo String Issue No (Issue No 是唯一标识项目的问题编号)
page Int 页码

返回数据

问题详情返回参数 类型 说明
issueKey String 问题的 Key
userKey String 备注人的 Key
userName String 备注人的姓名
userAvator String 备注人的头像 Key
issueNote String 备注的内容
issueNoteCreated Date 备注日期
issueNoteKey String 备注的 Key

历史操作

API地址

POST http://https://seed.pgyer.com/apiv1/issue/getActivityList

POST参数

参数 类型 说明
uKey String (选填) 用户Key 点击获取uKey
_api_key String API Key 点击获取API Key
pKey String Project Key (Project Key是唯一标识项目的索引ID)
iNo String Issue No (Issue No 是唯一标识项目的问题编号)
page Int 页码

返回数据

问题详情返回参数 类型 说明
issueKey String 问题的 Key
issueActivityKey String 历史操作的 Key
userKey String 操作人的 Key
issueActivityType Int 历史操作类型
issueActivityDescription String 描述
issueActivityCreated Date 创建时间
issueNo String 问题编号
issueTitle String 问题标题
issueStatus Int 问题状态
issuePriority Int 问题优先级
projectTypeKey Int 问题类型的 Key
projectName String 项目名称
projectKey String 项目的 Key
issueActivityUserName String 历史操作人的姓名
issueActivityUserAvator String 历史操作人的头像
issueAuthorName String 问题发起人的姓名
issueAssigneeUserName String 问题指派人的姓名
log String 历史操作内容

常见问题

常见问题

HTTP 429

当 API 的请求过于频繁时,系统会返回 429 错误。留意请求时返回的 Response Header 有助于避免此类情况发生。

Headers

参数 类型 说明
Retry-After Int 距离解除请求限制的时间(秒)。
X-Rate-Limit-Limit Int 请求的限制次数。
X-Rate-Limit-Remaining Int 剩余可用的请求次数。
X-Rate-Limit-Reset Int 距离请求次数计数器清零的时间(秒)。