Browse Platform API
Platform API

List all user IDs

Copy

Use List all user IDs to page through identifiers for users registered with OpenIM. This lightweight endpoint is suitable for batch processing and data synchronization; retrieve full profiles separately when needed.

HTTP request

POST {API_ADDRESS}/user/get_all_users_uid

Request example

curl --request POST "${API_ADDRESS}/user/get_all_users_uid" \
  --header "Content-Type: application/json; charset=utf-8" \
  --header "operationID: ${OPERATION_ID}" \
  --header "token: ${ADMIN_TOKEN}" \
  --data-raw '{
  "pagination": {
    "pageNumber": 1,
    "showNumber": 100
  }
}'
Keep administrator tokens on trusted backend services only. Client applications should use user tokens issued by your backend.

Request body

{
  "pagination": {
    "pageNumber": 1,
    "showNumber": 100
  }
}
ParameterRequiredTypeDescription
paginationYesobjectPagination settings.
pagination.pageNumberYesintPage number, starting from 1.
pagination.showNumberYesintNumber of records to return per page.

Response

OpenIM usually returns 200 OK when the request reaches the service. Use errCode in the JSON response to determine business success; errCode === 0 means the operation succeeded.

{
  "errCode": 0,
  "errMsg": "",
  "errDlt": "",
  "data": {
    "total": 2,
    "userIDs": [
      "user_001",
      "user_002"
    ]
  }
}

Response fields

FieldTypeDescription
errCodeintBusiness error code. 0 means success.
errMsgstringShort error message.
errDltstringDetailed error information for troubleshooting.
dataobjectEndpoint-specific response data.
totalintTotal number of matching records.
userIDsarrayList of OpenIM user IDs.

Pagination

Start with pagination.pageNumber = 1. Compare the number of IDs already read with data.total to determine whether another page is required. To retrieve profiles, pass the returned IDs to Get users.

Error response

When a request fails, OpenIM returns the same error envelope. See Error codes for the full handling model.

{
  "errCode": 1004,
  "errMsg": "RecordNotFoundError",
  "errDlt": ": [1004]RecordNotFoundError"
}
ScenarioPossible causeRecommended action
Authentication failedtoken is missing, expired, or not an administrator token.Issue a new administrator token and keep it on the backend.
Traceability is weakoperationID is missing or reused across many requests.Generate a unique operationID for every request and log it with the response.
Validation failedThe request body has an invalid type, missing field, or unsupported enum value.Compare the payload with the request table and retry after correcting the fields.

Permissions and limits

  • pagination.pageNumber starts at 1.
  • This endpoint returns IDs only; it does not return UserInfo objects.