Platform API
Search notification accounts
Use Search notification accounts to page through accounts used for system or business notifications. When keyword is supplied, OpenIM searches by user ID first and then by nickname.
HTTP request
POST {API_ADDRESS}/user/search_notification_accountRequest example
curl --request POST "${API_ADDRESS}/user/search_notification_account" \
--header "Content-Type: application/json; charset=utf-8" \
--header "operationID: ${OPERATION_ID}" \
--header "token: ${ADMIN_TOKEN}" \
--data-raw '{
"keyword": "notice",
"appManagerLevel": 60,
"pagination": {
"pageNumber": 1,
"showNumber": 20
}
}'Keep administrator tokens on trusted backend services only. Client applications should use user tokens issued by your backend.
Request body
{
"keyword": "notice",
"appManagerLevel": 60,
"pagination": {
"pageNumber": 1,
"showNumber": 20
}
}| Parameter | Required | Type | Description |
|---|---|---|---|
| keyword | No | string | Search term matched against user ID first, then nickname. |
| appManagerLevel | No | int | Filter by notification account management level. |
| pagination | Yes | object | Pagination settings. |
| pagination.pageNumber | Yes | int | Page number, starting from 1. |
| pagination.showNumber | Yes | int | Number 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": 1,
"notificationAccounts": [
{
"userID": "notice_001",
"faceURL": "https://cdn.example.com/avatar/notice.png",
"nickName": "Alice",
"appMangerLevel": 60
}
]
}
}Response fields
| Field | Type | Description |
|---|---|---|
| errCode | int | Business error code. 0 means success. |
| errMsg | string | Short error message. |
| errDlt | string | Detailed error information for troubleshooting. |
| data | object | Endpoint-specific response data. |
| total | int | Total number of matching records. |
| data.notificationAccounts | array | Notification accounts on the current page, including userID, faceURL, nickName, and appMangerLevel. |
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"
}| Scenario | Possible cause | Recommended action |
|---|---|---|
| Authentication failed | token is missing, expired, or not an administrator token. | Issue a new administrator token and keep it on the backend. |
| Traceability is weak | operationID is missing or reused across many requests. | Generate a unique operationID for every request and log it with the response. |
| Validation failed | The 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
- Omit
keywordto list notification accounts by page. - Notification accounts are a backend management capability and should not be exposed directly to ordinary clients.
Related pages
Was this page helpful?