List the organizations belonging to the authorized user¶
GET /api/v5/users/orgs
Call this endpoint to list the organizations belonging to the authorized user.
Access token support¶
- 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 |
page |
query | string | No | Current page number; defaults to 1 |
per_page |
query | string | No | Number of items per page; defaults to 20, maximum 100 |
admin |
query | boolean | No | Filter for organizations where you have administrator permissions |
Response parameters¶
organization object (array element)
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
id |
integer | Yes | No | Organization ID |
login |
string | Yes | No | Organization login name |
path |
string | Yes | No | Organization path |
name |
string | Yes | No | Organization name |
avatar_url |
string | Yes | Yes | Organization avatar URL; may be null |
repos_url |
string | Yes | Yes | Organization repositories URL; may be null |
events_url |
string | Yes | Yes | Organization events URL; may be null |
members_url |
string | Yes | Yes | Organization members URL; may be null |
description |
string | Yes | No | Organization description |
follow_count |
integer | Yes | No | Number of followers |
Error responses¶
400 Parameter error
401 Unauthenticated
The actual error field names are those returned by the backend.
HTTP response status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
304 |
Not modified |
400 |
Parameter error (Bad request) |
401 |
Requires authentication |
403 |
Forbidden |
429 |
Too many requests |
Request example¶
Parameter description¶
<token>— replace with your AtomGit user access token;page,per_page, andadminare optional parameters and can be passed as needed.
cURL¶
curl -X GET 'https://api.atomgit.com/api/v5/users/orgs?access_token=<token>&page=1&per_page=20' \
-H 'Accept: application/json'
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/users/orgs?access_token=<token>&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/users/orgs",
params={"access_token": "<token>", "page": 1, "per_page": 20},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
[
{
"id": 133039,
"login": "openharmony",
"path": "openharmony",
"name": "OpenHarmony",
"avatar_url": null,
"repos_url": null,
"events_url": null,
"members_url": null,
"description": "OpenHarmony is an open-source project incubated and operated by the OpenAtom Foundation. Its goal is to build a framework and platform for smart-device operating systems for an era of all scenarios, all connections, and all intelligence, and to promote the prosperity of the Internet of Everything industry.",
"follow_count": 3
}
]
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing/invalid access credentials) |
400 |
Parameter error or the request cannot be parsed |
404 |
The request path does not exist |
405 |
The request method is not supported |
429 |
Too many requests; the rate limit was triggered |
500 |
Internal system error |
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc