Skip to main content

Get Member Details

Get detailed information about a specified enterprise member.

API information​

ItemDescription
API nameGet Member Details
Permission scopecontact.user.read(read basic member information)
HTTP methodPOST / GET
Endpointhttps://{gateway_host}/open/v1/contact/user/get
Data formatapplication/json(for POST) or URL query
AuthenticationApp-level access_token(requires contact.user.read permission)

Prerequisites​

  1. The app has been published and enabled under "Internal Apps" in the admin console.
  2. A valid app-level access_token has been obtained.
  3. The target member must exist, be active, and be within the app's visibility scope.

Request parameters​

HeaderRequiredDescription
AuthorizationNoBearer <access_token>,recommended credential transport method; choose it instead of query or form authentication
Content-TypeNoSend application/json when a POST request uses JSON

Parameter list​

Parameters may be sent in a POST JSON body, POST form, or GET query:

ParameterTypeRequiredDescription
access_tokenstringYesApp-level token(if it is not sent in the Authorization header, it is required)
useridstringYesTarget member user ID (a positive integer string). The system also accepts aliases userId, user_id
languagestringNoReserved 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"]
}
}
FieldTypeDescription
codeintegerBusiness status code; 200 indicates success
msgstringMessage; empty on success
data.userIdstringMember ID as a string to avoid large-number precision loss
data.namestringMember nickname/name
data.avatarstringMember avatar URL; omitted when not set
data.mobilestringMobile number; omitted when not set
data.emailstringEmail address; omitted when not set
data.jobNumberstringEmployee number; omitted when not set
data.titlestringJob title; omitted when not set
data.deptIdListstring[]List of department IDs for the member (only IDs within the app's visibility scope); []

Permissions and visibility filtering​

  1. Visibility-scope restriction:The app can read only member data within its own visibility scope.
  2. Data masking and protection: Internal admin fields such as internal markers and role-permission settings are not returned.
  3. 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_FOUND to avoid disclosing the enterprise organization structure.

Error codes​

Authentication and middleware errors (HTTP status)​

HTTP statusmsg Error codeDescription
401INVALID_TOKENThe token is missing, expired, revoked, or the app is unavailable
403SCOPE_DENIEDThe token lacks contact.user.read permission
403IP_DENIEDThe 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 codeDescription and troubleshooting guidance
INVALID_REQUESTParameter userid is missing, empty, or not a valid positive integer string
USER_NOT_FOUNDThe member does not exist, is disabled/deleted, or is outside the app's visibility scope
PERMISSION_DENIEDThe app state is invalid (disabled, unpublished, or deleted)
SERVER_ERRORInternal 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;
}