ReplyAgentSession
Replies to a pending user interaction in a DataAgent session.
Operation description
Prerequisites
Call CreateAgentSession to create a session, and then call PromptAgentSession to establish a Server-Sent Events (SSE) connection to activate the DataAgent daemon. The daemon shares the same lifecycle as the SSE connection and is immediately released when the connection is disconnected.
If no active SSE connection exists, this operation cannot complete the reply and returns the error code 5225072769238040781.
Complete workflow: CreateAgentSession → PromptAgentSession (SSE) → Wait for the
permission_requestevent → ReplyAgentSession.
Request description
This operation is used to reply to a
permission_requestissued by the DataAgent daemon. You can submit answers toask_user_questionor cancel the current interaction.The
PermissionRequestIdmust be obtained from the SSE event of the original PromptAgentSession (theparams.data.requestIdwhereparams.kind=permission_requestin the_qwen/notifyevent). Do not construct it manually.The reply result only indicates whether the reply is accepted. Subsequent execution events are still returned through the SSE of the original PromptAgentSession. Do not submit duplicate replies for the same prompt round.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:ReplyAgentSession |
none |
*All Resource
|
None | None |
Request syntax
POST HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Jsonrpc |
string |
No |
The JSON-RPC protocol version. Fixed to 2.0. Valid values:
|
2.0 |
| Id |
string |
Yes |
The JSON-RPC correlation ID for this reply request. It is returned as-is in the response and is different from PermissionRequestId. |
reply-rpc-001 |
| Params |
object |
Yes |
The user interaction reply parameters. |
|
| Answers |
object |
No |
The answers to |
{"0":"lakehouse_uat"} |
|
string |
No |
The list of answers. |
{"0":"key","1":"value"} |
|
| Outcome |
object |
Yes |
The user processing result for the current interaction. |
|
| OptionId |
string |
No |
Required and cannot be empty when Outcome is selected. Set this parameter to the optionId of the actual option in the options of the current event. When submitting an answer, the option with kind=allow_once is usually selected. Omit this parameter when Outcome is cancelled. |
option-from-event |
| Outcome |
string |
Yes |
The processing type. Valid values:
Valid values:
|
selected |
| PermissionRequestId |
string |
Yes |
The ID of the current permission_request. Obtain this value from |
permission-001 |
| SessionId |
string |
Yes |
The LSP session ID. Use the SessionId returned when the session is created. It is not the internal session ID of the daemon. |
lsp-session-001 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| JsonRpcResponse |
object |
The JSON-RPC response. Returns Result on success and Error on protocol errors. |
|
| Error |
object |
The JSON-RPC fault message. For example, DAEMON_PERMISSION_UNAVAILABLE is returned when the daemon reply feature is not enabled. |
|
| Code |
integer |
The JSON-RPC error code. |
-32601 |
| Data |
any |
The optional additional error information. The content depends on the error type. |
{} |
| ErrorCode |
string |
The business error code. |
DAEMON_PERMISSION_UNAVAILABLE |
| Message |
string |
The error message. |
DataAgent daemon permission reply is not enabled |
| Id |
string |
The JSON-RPC correlation ID for this reply request. |
reply-rpc-001 |
| Jsonrpc |
string |
The JSON-RPC protocol version. |
2.0 |
| Result |
object |
The reply processing result. It only indicates whether the current reply is accepted and does not indicate that the original task execution is completed. |
|
| Accepted |
boolean |
Indicates whether the daemon accepts the current reply. A value of true indicates that the reply is accepted. A value of false indicates that the reply is not accepted, which may be because the request is unknown, already processed, expired, or the session does not exist. You cannot determine the specific cause based on this value. |
true |
| Timestamp |
integer |
The response time. It is a UNIX timestamp in milliseconds. |
1789549200000 |
| RequestId |
string |
The request ID for this call, which can be used for troubleshooting. |
request-001 |
Examples
Success response
JSON format
{
"JsonRpcResponse": {
"Error": {
"Code": -32601,
"Data": "{}",
"ErrorCode": "DAEMON_PERMISSION_UNAVAILABLE",
"Message": "DataAgent daemon permission reply is not enabled"
},
"Id": "reply-rpc-001",
"Jsonrpc": "2.0",
"Result": {
"Accepted": true
},
"Timestamp": 1789549200000
},
"RequestId": "request-001"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.