Get all labels of an enterprise issue¶
GET /api/v5/enterprises/{enterprise}/issues/{number}/labels
Retrieves all labels of the specified issue in an enterprise, returning each label's number, name, color, and link information; supports pagination.
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 |
|---|---|---|---|---|
enterprise |
path | string | Yes | Enterprise name (path) |
number |
path | integer | Yes | Issue number (globally unique) |
access_token |
query | string | Yes | User authorization code |
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 100 |
Response parameters¶
The endpoint returns an array of label objects, each structured as follows:
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
id |
integer | Yes | No | Label ID |
color |
string | Yes | No | Label color |
name |
string | Yes | No | Label name |
url |
string | Yes | No | Label link; currently always returns an empty string |
Error responses¶
A
200/success response is not enough: callers need to know what a failure looks like to write error handling.
400 Parameter error
401 Unauthenticated
404 Resource not found
The actual error field names returned by the backend take precedence.
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) |
Request example¶
Parameter notes¶
The examples must be consistent with the rest of this document and can be copied and used directly to call successfully. Three hard requirements:
- The authentication header must match "Access token support": if that section says a token is required, the examples must include
access_token. - Do not omit any required parameter: path parameters and required query parameters must all appear in the examples.
- Placeholders must be replaceable: use the
<...>form consistently, and explain the meaning of each placeholder below.
Replace
<enterprise>with the enterprise name (path); replace<number>with the globally unique issue number; replace<token>with your AtomGit user access token.
cURL¶
curl -X GET 'https://api.atomgit.com/api/v5/enterprises/<enterprise>/issues/<number>/labels?access_token=<token>&page=1&per_page=100' \
-H 'Accept: application/json'
JavaScript¶
// Native fetch (Node.js 18+ / browsers)
const response = await fetch(
"https://api.atomgit.com/api/v5/enterprises/<enterprise>/issues/<number>/labels?access_token=<token>&page=1&per_page=100",
{
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/enterprises/<enterprise>/issues/<number>/labels",
params={
"access_token": "<token>",
"page": 1,
"per_page": 100,
},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing or invalid access credential) |
400 |
Invalid parameters or unparsable request |
404 |
Request path or resource does not exist |
405 |
Unsupported request method |
429 |
Too many requests; rate limit triggered |
500 |
Internal server error |
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc