Get Member Details
Get detailed information about a specified enterprise member.
API information
| Item | Description |
|---|---|
| API name | Get Member Details |
| Permission scope | contact.user.read(read basic member information) |
| HTTP method | POST / GET |
| Endpoint | https://{gateway_host}/open/v1/contact/user/get |
| Data format | application/json(for POST) or URL query |
| Authentication | App-level access_token(requires contact.user.read permission) |
Prerequisites
- The app has been published and enabled under "Internal Apps" in the admin console.
- A valid app-level
access_tokenhas been obtained. - The target member must exist, be active, and be within the app's visibility scope.
Request parameters
Header
| Header | Required | Description |
|---|---|---|
Authorization | No | Bearer <access_token>,recommended credential transport method; choose it instead of query or form authentication |
Content-Type | No | Send application/json when a POST request uses JSON |
Parameter list
Parameters may be sent in a POST JSON body, POST form, or GET query:
| Parameter | Type | Required | Description |
|---|---|---|---|
access_token | string | Yes | App-level token(if it is not sent in the Authorization header, it is required) |
userid | string | Yes | Target member user ID (a positive integer string). The system also accepts aliases userId, user_id |
language | string | No | Reserved localization parameter; it currently does not affect the response |
Request examples
POST Request examples:
POST https://{gateway_host}/open/v1/contact/user/get
Authorization: Bearer <access_token>
Content-Type: application/json
{
"userid": "42"
}
GET Request examples:
GET https://{gateway_host}/open/v1/contact/user/get?userid=42
Authorization: Bearer <access_token>
Response parameters
Successful response (the platform's unified response envelope):
{
"code": 200,
"msg": "",
"data": {
"userId": "42",
"name": "Zhang San",
"avatar": "https://cdn.example.com/avatar/42.png",
"mobile": "13800000000",
"email": "zhangsan@example.com",
"jobNumber": "A-001",
"title": "Engineer",
"deptIdList": ["10", "20"]
}
}
| Field | Type | Description |
|---|---|---|
code | integer | Business status code; 200 indicates success |
msg | string | Message; empty on success |
data.userId | string | Member ID as a string to avoid large-number precision loss |
data.name | string | Member nickname/name |
data.avatar | string | Member avatar URL; omitted when not set |
data.mobile | string | Mobile number; omitted when not set |
data.email | string | Email address; omitted when not set |
data.jobNumber | string | Employee number; omitted when not set |
data.title | string | Job title; omitted when not set |
data.deptIdList | string[] | List of department IDs for the member (only IDs within the app's visibility scope); [] |
Permissions and visibility filtering
- Visibility-scope restriction:The app can read only member data within its own visibility scope.
- Data masking and protection: Internal admin fields such as internal markers and role-permission settings are not returned.
- Nonexistent and invisible are equivalent: If the requested member does not exist, has been deactivated, or is outside the app's current visibility scope, the API always returns
USER_NOT_FOUNDto avoid disclosing the enterprise organization structure.
Error codes
Authentication and middleware errors (HTTP status)
| HTTP status | msg Error code | Description |
|---|---|---|
| 401 | INVALID_TOKEN | The token is missing, expired, revoked, or the app is unavailable |
| 403 | SCOPE_DENIED | The token lacks contact.user.read permission |
| 403 | IP_DENIED | The source IP is not in the IP allowlist configured in the app security settings |
Business errors (HTTP 200, code=500)
{
"code": 500,
"msg": "USER_NOT_FOUND",
"data": null
}
msg error code | Description and troubleshooting guidance |
|---|---|
INVALID_REQUEST | Parameter userid is missing, empty, or not a valid positive integer string |
USER_NOT_FOUND | The member does not exist, is disabled/deleted, or is outside the app's visibility scope |
PERMISSION_DENIED | The app state is invalid (disabled, unpublished, or deleted) |
SERVER_ERROR | Internal server error; retry later |
Multilingual call examples
The following examples run on the server; never send app secrets or app tokens to a client.
Shell
curl -sS -X POST "https://{gateway_host}/open/v1/contact/user/get" \
-H "Authorization: Bearer access-token-xxx" \\\n -H "Content-Type: application/json" \
-d '{"userid":"42"}'
PHP
<?php
// Production code should check the HTTP status and response body before mapping business errors.
$handle = curl_init('https://{gateway_host}/open/v1/contact/user/get');
curl_setopt_array($handle, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer access-token-xxx', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"userid":"42"}',
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($handle);
curl_close($handle);
Golang
package main
import (
"bytes"
"net/http"
)
func main() {
// Use the token only in a server-side request and follow the API transport contract.
request, _ := http.NewRequest(http.MethodPost, "https://{gateway_host}/open/v1/contact/user/get", bytes.NewBufferString(`{"userid":"42"}`))
request.Header.Set("Authorization", "Bearer access-token-xxx")
request.Header.Set("Content-Type", "application/json")
response, _ := http.DefaultClient.Do(request)
defer response.Body.Close()
}
C++
#include <curl/curl.h>
int main() {
// Enable TLS verification and handle HTTP errors in production.
CURL* handle = curl_easy_init();
struct curl_slist* headers = nullptr;
headers = curl_slist_append(headers, "Authorization: Bearer access-token-xxx");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(handle, CURLOPT_URL, "https://{gateway_host}/open/v1/contact/user/get");
curl_easy_setopt(handle, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(handle, CURLOPT_POSTFIELDS, R"({"userid":"42"})");
const CURLcode result = curl_easy_perform(handle);
curl_slist_free_all(headers);
curl_easy_cleanup(handle);
return result == CURLE_OK ? 0 : 1;
}