GetMessages

Updated at:

Retrieves specific conversation messages.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

rdsai:GetMessages

none

*All Resource

*

None None

Request syntax

GET  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

ConversationId

string

No

The conversation ID.

941c6f59-acf5-4e11-9adc-31e52e1f****

FlowId

string

No

The flow instance ID.

flow-90ea18a8254645968325

FirstId

string

No

The ID of the first message.

038866af-a050-4bc5-bfad-b7bfc838****

Limit

integer

No

The paging Settings for the number of entries per page in a paged query. Valid values: 1 to 100. Default value: 100.

10

EventMode

string

No

The event output mode. Valid values: inline and separate. Default value: inline. If you set this parameter to inline, tool calling invoke events, subnode events, and document events are unified into the answer field where event is message. If you set this parameter to separate, tool calling invoke events, subnode events, and document events have their own event fields.

inline

WorkspaceId

string

No

The ContextDB workspace ID.

00000000-0000-4000-8000-000000000001

Response elements

Element

Type

Description

Example

object

The object.

RequestId

string

The request ID.

FE9C65D7-930F-57A5-A207-8C396329****

Data

array<object>

The query results.

array<object>

The query results.

Id

string

The message ID.

84dc9f9b-424a-404d-9c36-35e9d000****

ConversationId

string

The conversation ID.

9cbbe885-b240-4803-9d15-6781a3fd****

Query

string

The query statement.

Check the disk usage of instance rm-bp14as9914vd3**** and determine whether to expand the storage capacity

Answer

string

The response.

The disk usage of the instance rm-bp14as9914vd3**** you inquired about is 23%, so no capacity expansion is needed at the moment. If you need to view detailed configurations, check performance monitoring, or perform other operations on a specific instance, please let me know your specific requirements.

CreatedAt

string

The time when the message was created. The value is a UNIX timestamp in seconds.

1763986004

Feedback

string

The feedback.

like

RetrieverResources

array

The retrieved resources.

any

The resource.

Test field. Ignore this value

Events

array<object>

The list of events.

array<object>

The list of events.

event

string

answer

string

ConversationId

string

The conversation ID.

conversation-example

MessageId

string

The message ID.

message-example

RoundId

string

The tool approval round ID.

round-example

CallId

string

The tool calling invoke ID.

call-example

ToolName

string

The tool name.

contextdb.search

ToolArguments

object

The tool calling invoke parameters.

Description

string

The tool calling invoke description.

Search ContextDB records

ApprovalStatus

string

The tool calling invoke approval status.

pending

GenerationStatus

string

GenerationStartedAt

string

GenerationFinishedAt

string

LastSentEntryId

string

StreamKey

string

MessageFiles

array<object>

object

Id

string

Type

string

PreviewUrl

string

UploadFileId

string

The uploaded file ID.

file-example

HasMore

boolean

Indicates whether more pages exist.

true

Limit

integer

The maximum number of query results.

100

Examples

Success response

JSON format

{
  "RequestId": "FE9C65D7-930F-57A5-A207-8C396329****",
  "Data": [
    {
      "Id": "84dc9f9b-424a-404d-9c36-35e9d000****",
      "ConversationId": "9cbbe885-b240-4803-9d15-6781a3fd****",
      "Query": "Disk usage of instance rm-bp14as9914vd3**** and whether expansion is required",
      "Answer": "The disk usage of the instance rm-bp14as9914vd3**** you inquired about is 23%, so no storage capacity expansion is required at this time. If you need to view detailed configurations, check performance monitoring data, or perform other operations on a specific instance, please let me know your specific needs.",
      "CreatedAt": "1763986004",
      "Feedback": "like",
      "RetrieverResources": [
        "Test field. You can ignore this field"
      ],
      "Events": [
        {
          "event": "",
          "answer": "",
          "ConversationId": "conversation-example",
          "MessageId": "message-example",
          "RoundId": "round-example",
          "CallId": "call-example",
          "ToolName": "contextdb.search",
          "ToolArguments": {
            "test": "test",
            "test2": 1
          },
          "Description": "Search ContextDB records",
          "ApprovalStatus": "pending"
        }
      ],
      "GenerationStatus": "",
      "GenerationStartedAt": "",
      "GenerationFinishedAt": "",
      "LastSentEntryId": "",
      "StreamKey": "",
      "MessageFiles": [
        {
          "Id": "",
          "Type": "",
          "PreviewUrl": "",
          "UploadFileId": "file-example"
        }
      ]
    }
  ],
  "HasMore": true,
  "Limit": 100
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter The provided parameter is invalid. Invalid parameter.
400 InvalidWorkspaceId.Missing WorkspaceId is required for the ContextDB management App. WorkspaceId is required when using ContextDB to manage applications. Specify the ContextDB workspace to which this request belongs and try again.
400 InvalidWorkspaceId.Conflict The request contains conflicting WorkspaceId values. The WorkspaceId values provided in the request conflict with each other. Ensure that the workspace identifiers are consistent across all locations in the request and try again.
400 InvalidWorkspaceId.Value WorkspaceId is invalid. The WorkspaceId is invalid. Check the workspace identifier, specify a valid ContextDB WorkspaceId, and try again.
403 PermissionDenied User has no operation permission. User has no operation permission
404 UserNotFound User does not exist. User does not exist.
404 ConversationNotFound Conversation does not exist. Conversation does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.