-
Notifications
You must be signed in to change notification settings - Fork 0
Survey API v1
Jinglei Ren edited this page Dec 11, 2017
·
17 revisions
All requests must contain HTTP header X-USR-TOKEN
to identify a specified user.
API responds HTTP code 403 if the token doesn't exist or token is invalid.
{
"question": {
"id": STR,
"type": "single",
"commits": [
{
"id": STR,
"title": STR,
"url": STR,
"description": STR,
}
...
],
"answered": INT
}
}
{
"review": {
"id": STR,
"type": "single",
"commits": [
{
"id": STR,
"title": STR,
"url": STR
}
...
],
"selected": STR,
"commitLabels": [
{
"commitId": STR,
"labelId": STR
}
...
],
"reason": STR,
"reviewed": INT
}
}
{
"label": {
"id": STR,
"name": STR
}
}
{
"project": {
"id": STR,
"name": STR,
"githubUrl": STR
}
}
返回下一个没有作答过的 Question,包含 Question Object
Response
{
"status": INT,
"message": STR,
"data": QUESTION_OBJECT,
}
Payload
{
"selected": COMMIT_ID,
"reason": STR
}
The reason string should be in the format '\[.*\] is more valuable than \[.*\]'
.
返回下一个没有加过标签的 Review,包含 Review Object
Response
{
"status": INT,
"message": STR,
"data": REVIEW_OBJECT,
}
Payload
{
"comment": STR,
"commitLabels": [
{
"commitId": STR,
"labelId": STR
}
...
{
"commitId": STR,
"labelName": STR
}
...
]
}
Response
{
"status": INT,
"message": STR,
"data": [LABEL_OBJECT, ...]
}
Collect all labels.
Response
{
"status": INT,
"message": STR,
"data": {
"builtin": [LABEL_OBJECT, ...],
"customized": [LABEL_OBJECT, ...]
}
}
Retrieve basic project information.
Response
{
"status": INT,
"message": STR,
"data": PROJECT_OBJECT
}
Get basic statistics of the current developer, including the total number of questions in this project ("total"), and the number of answered questions ("answered").
Response
{
"status": INT,
"message": STR,
"data": {
"total": INT,
"answered": INT
}
}
{
"status": 0, // Error number or 0
"message": 'Error message if any',
"data": Object
}
© 2017 The Persper Foundation