Get a member of an enterprise¶
GET /api/v5/enterprises/{enterprise}/members/{username}
This endpoint returns information about a member of the specified enterprise, including the member's user information, profile URL, active status, role, and enterprise information.
Access token support¶
- 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 path (path/login) |
username |
path | string | Yes | User name (username/login) |
access_token |
query | string | Yes | User authorization code |
Response parameters¶
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
user |
object | Yes | No | User information of the enterprise member |
url |
string | Yes | No | Member profile URL |
active |
integer | Yes | No | Whether the member is active (the example value is the boolean true) |
role |
string | Yes | No | Member role |
enterprise |
object | Yes | No | Information about the enterprise the member belongs to |
user object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
user.avatar_url |
string | Yes | No | User avatar URL |
user.html_url |
string | Yes | No | User HTML profile URL |
user.id |
string | Yes | No | User ID |
user.login |
string | Yes | No | User name (login name) |
user.name |
string | Yes | No | User nickname |
user.user_id |
string | Yes | No | Unique user identifier |
user.object_id |
string | Yes | No | Unique object identifier |
enterprise object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
enterprise.id |
integer | Yes | No | Enterprise ID |
enterprise.url |
string | Yes | No | Enterprise profile URL |
Error responses¶
Only the common failure cases that this endpoint may return are listed; the actual error field names are those returned by the backend.
401 Unauthenticated
404 Resource not found
HTTP response status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
401 |
Requires authentication |
403 |
Forbidden |
404 |
Resource not found (Not found) |
Request example¶
Parameter description¶
Replace
<enterprise>with the enterprise path (path/login); replace<username>with the member's user name (username/login); replace<token>with your AtomGit user access token.
cURL¶
curl -X GET 'https://api.atomgit.com/api/v5/enterprises/<enterprise>/members/<username>?access_token=<token>' \
-H 'Accept: application/json'
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const response = await fetch(
"https://api.atomgit.com/api/v5/enterprises/<enterprise>/members/<username>?access_token=<token>",
{
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>/members/<username>",
params={"access_token": "<token>"},
headers={
"Accept": "application/json",
},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
{
"user": {
"avatar_url": "https://cdn-img.gitcode.com/ec/fb/430ecf07b9ee91bbbbf341d92a36783d06e69086f82ce8cf5a6406f79f1c9cf4.png",
"html_url": "https://api.atomgit.com/dengmengmian",
"id": "268",
"login": "dengmengmian",
"name": "dengmengmian"
},
"url": "https://api.atomgit.com/dengmengmian",
"active": true,
"role": "admin",
"enterprise": {
"id": 0,
"url": "https://api.atomgit.com/dengmengmian"
}
}
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing/invalid access credentials) |
403 |
Forbidden (no permission) |
404 |
The enterprise or member does not exist |
500 |
Internal system error |
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc