Read visitor conversation messages

Returns items/total/limit/offset; see common objects for message top-level fields and answer_versions. Advance offset by actual item count; stop at an empty page or total.

GET https://api.moi.matrixorigin.cn/v5/public/webapp/conversations/{conversation_id}/messages

Before you call this API

BASE_URL uses the product API prefix https://api.moi.matrixorigin.cn/v5. For a dedicated deployment, use its corresponding product API address.

Prepare links and visitor identity in the same environment. Do not supply a product PAT or Workspace request header.

Request

curl --request GET \
  "$BASE_URL/public/webapp/conversations/$CONVERSATION_ID/messages?webapp=$AGENT_ID&t=$WEBAPP_TOKEN&s=$WEBAPP_SESSION&role=user&limit=50&offset=0"

Parameter

Location

Type

Required

Description

webapp

Query

string

Yes

Agent ID corresponding to the link.

t

Query

string

Yes

Current valid publication token. For short-code links, resolve first and use the short code as t.

s

Query

string

Yes

Visitor session credentials under the same publication.

conversation_id

Path

string

Yes

Active Web App conversation created by this visitor.

limit

Query

integer

No

Default 50, maximum 200. Invalid/nonpositive values use the default.

offset

Query

integer

No

Default 0; negative values use 0.

role

Query

string

No

user/agent/system/tool/assistant; omission disables role filtering.

Successful response

{
  "code": 0,
  "data": {
    "items": [],
    "total": 0,
    "limit": 50,
    "offset": 0
  }
}

Success returns HTTP 200 with numeric code=0. Read data’s Object descriptions with the example; the conversation-creation example shows a field excerpt only.

Error response

Public errors and identity handling distinguishes unavailable links, disablement, invalid sessions, parameters, and system failures.

Next page

When the first page has one item and total is not reached, the example uses offset=1. Advance by the actual returned count.

curl --request GET \
  "$BASE_URL/public/webapp/conversations/$CONVERSATION_ID/messages?webapp=$AGENT_ID&t=$WEBAPP_TOKEN&s=$WEBAPP_SESSION&role=user&limit=50&offset=1"
Last updated on