Platform API
Get owner conversation
Use List a user's conversations to page through conversation records owned by a specified user.
HTTP request
POST {API_ADDRESS}/conversation/get_owner_conversationRequest example
curl --request POST "${API_ADDRESS}/conversation/get_owner_conversation" \
--header "Content-Type: application/json; charset=utf-8" \
--header "operationID: ${OPERATION_ID}" \
--header "token: ${ADMIN_TOKEN}" \
--data-raw '{
"userID": "user_001",
"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
{
"userID": "user_001",
"pagination": {
"pageNumber": 1,
"showNumber": 20
}
}| Parameter | Required | Type | Description |
|---|---|---|---|
| userID | Yes | string | OpenIM user ID. |
| 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": 2,
"conversations": [
{
"ownerUserID": "user_001",
"conversationID": "si_user_001_user_002",
"recvMsgOpt": 0,
"conversationType": 1,
"userID": "user_002",
"groupID": "",
"isPinned": false,
"attachedInfo": "",
"isPrivateChat": false,
"groupAtType": 0,
"ex": "",
"burnDuration": 0,
"minSeq": 0,
"maxSeq": 128,
"msgDestructTime": 0,
"latestMsgDestructTime": 0,
"isMsgDestruct": false
},
{
"ownerUserID": "user_001",
"conversationID": "sg_group_001",
"recvMsgOpt": 0,
"conversationType": 3,
"userID": "",
"groupID": "group_001",
"isPinned": true,
"attachedInfo": "",
"isPrivateChat": false,
"groupAtType": 0,
"ex": "",
"burnDuration": 0,
"minSeq": 0,
"maxSeq": 256,
"msgDestructTime": 0,
"latestMsgDestructTime": 0,
"isMsgDestruct": false
}
]
}
}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. |
| data.total | int | Total number of matching records. |
| data.conversations | array | Conversation records for the current page. Each item follows ConversationInfo. |
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
- Call this endpoint from a trusted backend service.
- Log
operationID, the endpoint path, and the response error fields for troubleshooting. - Treat write operations as state-changing. If a retry follows an uncertain failure, check the resource state first.
Related pages
Was this page helpful?