Get all issues of the authorized user¶
GET /api/v5/user/issues
Call this endpoint to get all issues of the authorized user.
Access token support¶
- AtomGit user access token (AtomGit user access tokens)
Anonymous access¶
This endpoint does not allow anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
access_token |
query | string | Yes | User authorization code |
filter |
query | string | No | Filter: issues assigned to the authorized user (assigned), issues created by the authorized user (created), or both (all). Defaults to assigned |
state |
query | string | No | Issue state: open (open), progressing (in progress), closed (closed), rejected (rejected). Defaults to open |
labels |
query | string | No | Comma-separated labels, for example bug,performance |
sort |
query | string | No | Sort by: creation time (created), update time (updated_at). Defaults to created_at |
direction |
query | string | No | Sort direction: ascending (asc), descending (desc). Defaults to desc |
since |
query | string | No | Start of the update time range; the time format must be ISO 8601 |
page |
query | integer | No | Current page number; defaults to 1 |
per_page |
query | integer | No | Number of items per page, up to 100; defaults to 20 |
schedule |
query | string | No | Planned start date, in the format 20181006T173008+80-20181007T173008+80 (range), -20181007T173008+80 (earlier than the point in time), or 20181006T173008+80- (later than the point in time); the time format must be 20181006T173008+80 |
deadline |
query | string | No | Planned deadline; same format as above |
created_at |
query | string | No | Task creation time; same format as above |
finished_at |
query | string | No | Task completion time, that is, when the task last moved to the completed state. Same format as above |
Note: The four parameters schedule, deadline, created_at, and finished_at currently have no corresponding feature in the GitCode business: the endpoint accepts them but does not process them, filtering them out and calling with the remaining conditions.
Response parameters¶
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
id |
integer | Yes | No | Issue number |
html_url |
string | Yes | No | HTML link of the issue |
number |
string | Yes | No | Issue number |
state |
string | Yes | No | Issue state |
title |
string | Yes | No | Issue title |
body |
string | Yes | No | Issue body |
assignee |
object | Yes | Yes | Information about the assigned user; may be null |
repository |
object | Yes | No | Information about the repository |
created_at |
string | Yes | No | Creation time |
updated_at |
string | Yes | No | Update time |
labels |
object[] | Yes | Yes | List of labels; may be null |
comments |
integer | Yes | No | Number of comments |
priority |
integer | Yes | No | Priority |
depth |
integer | Yes | No | Hierarchy depth |
parent_id |
integer | Yes | No | Parent issue number |
milestone |
object | Yes | Yes | Information about the milestone; may be null |
visibility_reason |
string | No | Yes | Visibility: public (publicly visible), confidential (private, visible to project members), other (visible only to project members for other reasons) |
assignee object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
assignee.avatar_url |
string | Yes | No | User avatar link |
assignee.html_url |
string | Yes | No | User homepage link |
assignee.id |
string | Yes | No | User ID |
assignee.login |
string | Yes | No | Login name |
assignee.name |
string | Yes | No | Nickname |
assignee.type |
string | Yes | No | User type |
repository object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
repository.id |
integer | Yes | No | Repository ID |
repository.full_name |
string | Yes | No | Full repository name |
repository.human_name |
string | Yes | No | Repository display name |
repository.path |
string | Yes | No | Repository path |
repository.name |
string | Yes | No | Repository name |
repository.url |
string | Yes | No | Repository link |
repository.namespace |
object | Yes | No | Namespace information |
repository.owner |
object | Yes | No | Repository owner information |
repository.assigner |
object | Yes | Yes | Assigner information; the actual returned fields take precedence |
repository.paas |
string | Yes | No | Hosting platform identifier |
repository.namespace object¶
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
repository.namespace.id |
integer | Yes | No | Namespace ID |
repository.namespace.type |
string | Yes | No | Namespace type |
repository.namespace.name |
string | Yes | No | Namespace name |
repository.namespace.path |
string | Yes | No | Namespace path |
repository.namespace.html_url |
string | Yes | No | Namespace HTML link |
repository.owner object¶
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
repository.owner.id |
string | Yes | No | Owner ID |
repository.owner.login |
string | Yes | No | Login name |
repository.owner.name |
string | Yes | No | Nickname |
labels array element object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
labels.id |
integer | No | Yes | Label ID |
labels.name |
string | No | Yes | Label name |
labels.color |
string | No | Yes | Label color |
labels.created_at |
string | No | Yes | Label creation time |
labels.updated_at |
string | No | Yes | Label update time |
milestone object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
milestone.created_at |
string | Yes | No | Creation time |
milestone.description |
string | Yes | No | Milestone description |
milestone.due_on |
string | Yes | No | Due date |
milestone.html_url |
string | Yes | No | Milestone HTML link |
milestone.number |
integer | Yes | No | Milestone number |
milestone.repository_id |
integer | Yes | No | ID of the repository the milestone belongs to |
milestone.state |
string | Yes | No | Milestone state |
milestone.title |
string | Yes | No | Milestone title |
milestone.updated_at |
string | Yes | No | Update time |
milestone.url |
string | Yes | No | Milestone link |
Error responses¶
400 Parameter error
401 Unauthenticated
HTTP status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
400 |
Parameter error (Bad request) |
401 |
Requires authentication (Requires authentication) |
403 |
Forbidden (Forbidden) |
404 |
Resource not found (Not found) |
405 |
Method not allowed (Method not allowed) |
429 |
Too many requests (Too many requests) |
500 |
Internal server error (Internal server error) |
Request example¶
Parameter notes¶
The request requires no path parameters; apart from access_token, all parameters are optional. The examples use the defaults filter=assigned, state=open, page=1, and per_page=20.
Replace
<token>with your AtomGit user access token.
cURL¶
curl -X GET 'https://api.atomgit.com/api/v5/user/issues?access_token=<token>&filter=assigned&state=open&page=1&per_page=20' \
-H 'Accept: application/json'
JavaScript¶
// Native fetch (Node.js 18+ / browsers)
const response = await fetch(
"https://api.atomgit.com/api/v5/user/issues?access_token=<YOUR-TOKEN>&filter=assigned&state=open&page=1&per_page=20",
{
headers: {
"Accept": "application/json",
},
}
);
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const data = await response.json();
console.log(data);
Python¶
import requests
resp = requests.get(
"https://api.atomgit.com/api/v5/user/issues",
params={
"access_token": "<YOUR-TOKEN>",
"filter": "assigned",
"state": "open",
"page": 1,
"per_page": 20,
},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
[
{
"id": 490786,
"html_url": "https://api.atomgit.com/gitcode-dev/gitcode-TestTask/issues/319",
"number": "319",
"state": "open",
"title": "Raise the size limit for image attachments in comments from 2M to 10M, allowing users to upload larger image attachments",
"body": "Test submission content",
"assignee": {
"avatar_url": "https://cdn-img.atomgit.com/avatar.png",
"html_url": "https://api.atomgit.com/yinlin",
"id": "303745",
"login": "yinlin",
"name": "yinlin",
"type": "User"
},
"repository": {
"id": 1,
"full_name": "gitcode-dev/gitcode-TestTask",
"human_name": "gitcode-TestTask",
"path": "gitcode-dev/gitcode-TestTask",
"name": "gitcode-TestTask",
"url": "https://api.atomgit.com/gitcode-dev/gitcode-TestTask",
"namespace": {
"id": 1,
"type": "Group",
"name": "gitcode-dev",
"path": "gitcode-dev",
"html_url": "https://api.atomgit.com/gitcode-dev"
},
"owner": {
"id": "303745",
"login": "yinlin",
"name": "yinlin"
},
"assigner": {},
"paas": "gitcode"
},
"created_at": "2024-04-15T10:31:00Z",
"updated_at": "2024-04-15T10:31:00Z",
"labels": [
{
"id": 1,
"name": "bug",
"color": "#FF0000",
"created_at": "2024-04-15T10:31:00Z",
"updated_at": "2024-04-15T10:31:00Z"
}
],
"comments": 0,
"priority": 0,
"depth": 0,
"parent_id": 0,
"milestone": {
"created_at": "2024-04-15T10:31:00Z",
"description": "Milestone description",
"due_on": "2024-05-01T00:00:00Z",
"html_url": "https://api.atomgit.com/gitcode-dev/gitcode-TestTask/milestones/1",
"number": 1,
"repository_id": 1,
"state": "open",
"title": "v1.0",
"updated_at": "2024-04-15T10:31:00Z",
"url": "https://api.atomgit.com/gitcode-dev/gitcode-TestTask/milestones/1"
},
"visibility_reason": "public"
}
]
Error codes¶
| Error code | Description |
|---|---|
400 |
Invalid parameters or unparsable request |
401 |
Unauthenticated or invalid credentials (missing or invalid access credential) |
403 |
No permission to access this resource |
404 |
Request path does not exist |
405 |
Unsupported request method |
429 |
Too many requests; rate limit triggered |
500 |
Internal server error |
OpenAPI¶
{"paths": {"/api/v5/user/issues": {"get": {"tags": ["issues"], "summary": "Get all issues of the authorized user", "responses": {"200": {"content": {"application/json": {"schema": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "integer"}, "body": {"type": "string"}, "depth": {"type": "integer"}, "state": {"type": "string"}, "title": {"type": "string"}, "labels": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "integer"}, "name": {"type": "string"}, "color": {"type": "string"}, "created_at": {"type": "string"}, "updated_at": {"type": "string"}}}}, "number": {"type": "string"}, "assignee": {"type": "object", "properties": {"id": {"type": "string"}, "name": {"type": "string"}, "type": {"type": "string"}, "login": {"type": "string"}, "html_url": {"type": "string"}, "avatar_url": {"type": "string"}}}, "comments": {"type": "integer"}, "html_url": {"type": "string"}, "priority": {"type": "integer"}, "milestone": {"type": "object", "properties": {"url": {"type": "string"}, "state": {"type": "string"}, "title": {"type": "string"}, "due_on": {"type": "string"}, "number": {"type": "integer"}, "html_url": {"type": "string"}, "created_at": {"type": "string"}, "updated_at": {"type": "string"}, "description": {"type": "string"}, "repository_id": {"type": "integer"}}}, "parent_id": {"type": "integer"}, "created_at": {"type": "string"}, "repository": {"type": "object", "properties": {"id": {"type": "integer"}, "url": {"type": "string"}, "name": {"type": "string"}, "paas": {"type": "string"}, "path": {"type": "string"}, "owner": {"type": "object", "properties": {"id": {"type": "string"}, "name": {"type": "string"}, "login": {"type": "string"}}}, "assigner": {"type": "object"}, "full_name": {"type": "string"}, "namespace": {"type": "object", "properties": {"id": {"type": "integer"}, "name": {"type": "string"}, "path": {"type": "string"}, "type": {"type": "string"}, "html_url": {"type": "string"}}}, "human_name": {"type": "string"}}}, "updated_at": {"type": "string"}, "visibility_reason": {"type": "string"}}}}, "description": "Success"}}, "parameters": [{"in": "query", "name": "access_token", "schema": {"type": "string"}, "required": true, "description": "User authorization code"}, {"in": "query", "name": "filter", "schema": {"type": "string"}, "required": false, "description": "Filter: issues assigned to the authorized user (assigned), issues created by the authorized user (created), or both (all). Defaults to assigned"}, {"in": "query", "name": "state", "schema": {"type": "string"}, "required": false, "description": "Issue state: open, progressing, closed, rejected. Defaults to open"}, {"in": "query", "name": "labels", "schema": {"type": "string"}, "required": false, "description": "Comma-separated labels, for example: bug,performance"}, {"in": "query", "name": "sort", "schema": {"type": "string"}, "required": false, "description": "Sort by: creation time (created), update time (updated_at). Defaults to created_at"}, {"in": "query", "name": "direction", "schema": {"type": "string"}, "required": false, "description": "Sort direction: ascending (asc), descending (desc). Defaults to desc"}, {"in": "query", "name": "since", "schema": {"type": "string"}, "required": false, "description": "Start of the update time range; the time format must be ISO 8601"}, {"in": "query", "name": "page", "schema": {"type": "integer"}, "required": false, "description": "Current page number; defaults to 1"}, {"in": "query", "name": "per_page", "schema": {"type": "integer"}, "required": false, "description": "Number of items per page, up to 100; defaults to 20"}, {"in": "query", "name": "schedule", "schema": {"type": "string"}, "required": false, "description": "Planned start date, in the format 20181006T173008+80-20181007T173008+80 (range), -20181007T173008+80 (earlier than the point in time), or 20181006T173008+80- (later than the point in time); the time format must be 20181006T173008+80"}, {"in": "query", "name": "deadline", "schema": {"type": "string"}, "required": false, "description": "Planned deadline; same format as above"}, {"in": "query", "name": "created_at", "schema": {"type": "string"}, "required": false, "description": "Task creation time; same format as above"}, {"in": "query", "name": "finished_at", "schema": {"type": "string"}, "required": false, "description": "Task completion time, that is, when the task last moved to the completed state. Same format as above"}], "description": "Call this endpoint to get all issues of the authorized user."}}}}
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc