diff options
| author | Zhineng Li <im@zhineng.li> | 2026-07-12 17:11:17 +0800 |
|---|---|---|
| committer | Zhineng Li <im@zhineng.li> | 2026-07-12 17:11:17 +0800 |
| commit | 1c7f908ce09f98fdcbf79ed2a8ae21be60eaa634 (patch) | |
| tree | 5f0857666365b7e40cdaa3733ebe1f3ba9e13c67 /data/en_us/wuyingai/2026-03-11 | |
| parent | 7347bac4ab7e136157fc94777e6cf87ef9e08599 (diff) | |
| download | afterglow-metadata-full-1c7f908ce09f98fdcbf79ed2a8ae21be60eaa634.tar.gz afterglow-metadata-full-1c7f908ce09f98fdcbf79ed2a8ae21be60eaa634.zip | |
update APIs 20260712
Diffstat (limited to 'data/en_us/wuyingai/2026-03-11')
| -rw-r--r-- | data/en_us/wuyingai/2026-03-11/api-docs.php | 525 |
1 files changed, 525 insertions, 0 deletions
diff --git a/data/en_us/wuyingai/2026-03-11/api-docs.php b/data/en_us/wuyingai/2026-03-11/api-docs.php new file mode 100644 index 0000000..f193a49 --- /dev/null +++ b/data/en_us/wuyingai/2026-03-11/api-docs.php @@ -0,0 +1,525 @@ +<?php return [ + 'version' => '1.0', + 'info' => ['style' => 'RPC', 'product' => 'WuyingAI', 'version' => '2026-03-11'], + 'directories' => ['Chat', 'GetAccessToken'], + 'components' => [ + 'schemas' => [], + ], + 'apis' => [ + 'Chat' => [ + 'path' => '/api/agent/chat', + 'methods' => ['post', 'get'], + 'schemes' => ['https', 'sse'], + 'security' => [ + [ + 'Anonymous' => [], + ], + ], + 'operationType' => 'read', + 'deprecated' => false, + 'systemTags' => ['operationType' => 'update', 'riskType' => 'none', 'chargeType' => 'free'], + 'parameters' => [ + [ + 'name' => 'Input', + 'in' => 'formData', + 'style' => 'json', + 'schema' => [ + 'title' => '', + 'description' => 'The message list (JSON string), sorted in chronological order.', + 'type' => 'array', + 'items' => [ + 'type' => 'object', + 'properties' => [ + 'Role' => [ + 'title' => '', + 'description' => 'The message role.', + 'enumValueTitles' => ['user / assistant / system / tool' => 'user / assistant / system / tool'], + 'type' => 'string', + 'example' => 'user', + 'required' => false, + ], + 'Content' => [ + 'title' => '', + 'description' => 'The content block list.', + 'type' => 'array', + 'items' => [ + 'type' => 'object', + 'properties' => [ + 'Type' => [ + 'title' => '', + 'description' => 'The content type.', + 'enumValueTitles' => ['text/file/image' => 'text/file/image'], + 'type' => 'string', + 'example' => 'text', + 'required' => false, + ], + 'Text' => ['title' => '', 'description' => 'The text content (Type=text).', 'type' => 'string', 'example' => '帮我分析这张图片', 'required' => false], + 'ImageUrl' => ['title' => '', 'description' => 'The image URL or Base64-encoded string (Type=image).', 'type' => 'string', 'example' => 'https://example.com/img.jpg', 'required' => false], + 'FileUrl' => ['title' => '', 'description' => 'The file path or URL (Type=file).', 'type' => 'string', 'example' => '/workspace/report.pdf', 'required' => false], + 'FileName' => ['type' => 'string', 'example' => 'report.pdf', 'description' => '', 'title' => ''], + ], + 'required' => false, + 'description' => '', + 'title' => '', + 'example' => '', + ], + 'required' => false, + 'example' => '', + ], + ], + 'required' => false, + 'description' => '', + 'title' => '', + 'example' => '', + ], + 'required' => false, + 'example' => '[{"Role":"user","Content":[{"Type":"text","Text":"你好"}]}]', + ], + ], + [ + 'name' => 'SessionId', + 'in' => 'formData', + 'schema' => ['title' => '', 'description' => 'The session ID for multi-turn conversation context persistence.', 'type' => 'string', 'example' => 'test-session-001', 'required' => false], + ], + [ + 'name' => 'RoutingKey', + 'in' => 'formData', + 'schema' => ['title' => '', 'description' => 'The routing key that specifies the backend instance to process the request.', 'type' => 'string', 'example' => '""', 'required' => false], + ], + [ + 'name' => 'Authorization', + 'in' => 'query', + 'schema' => ['title' => '', 'description' => 'Bearer + JWT returned by GetAccessToken. URL-encode the entire string and pass it as a query parameter.', 'type' => 'string', 'example' => 'Bearer%20eyJhb****...****k', 'required' => false], + ], + [ + 'name' => 'ExternalUserId', + 'in' => 'formData', + 'schema' => ['title' => '', 'description' => 'The user ID from the external system.', 'type' => 'string', 'example' => 'test-user', 'required' => false], + ], + [ + 'name' => 'TemplateId', + 'in' => 'query', + 'schema' => ['title' => '', 'description' => 'The agent template ID.', 'type' => 'string', 'example' => 'template-abc123', 'required' => false], + ], + [ + 'name' => 'StreamOptions', + 'in' => 'formData', + 'style' => 'json', + 'schema' => [ + 'title' => '', + 'description' => 'The streaming output control options. Contains IncludeReasoning (boolean, default true, specifies whether to include the model thinking process) and IncludeToolCalls (boolean, default true, specifies whether to include tool invocation details). If not specified or set to a null object, the behavior is consistent with the legacy version.', + 'type' => 'object', + 'properties' => [ + 'IncludeReasoning' => ['title' => '', 'description' => 'Specifies whether to include the model thinking process. When set to false, the SSE stream does not include messages with Type="reasoning" or their content events.', 'type' => 'boolean', 'required' => false, 'example' => 'true'], + 'IncludeToolCalls' => ['title' => '', 'description' => 'Specifies whether to include tool invocation details. When set to false, the SSE stream does not include messages of type plugin_call, plugin_call_output, mcp_call, or mcp_call_output, or their content events.', 'type' => 'boolean', 'required' => false, 'example' => 'true'], + ], + 'required' => false, + 'example' => '{"IncludeReasoning": false, "IncludeToolCalls": false}', + ], + ], + [ + 'name' => 'Settings', + 'in' => 'formData', + 'style' => 'json', + 'schema' => [ + 'title' => '', + 'description' => 'The additional settings. Contains the output file mode control parameter OutputFileMode (string, valid values: url or base64. Defaults to base64 for legacy compatibility. We recommend url).', + 'type' => 'object', + 'properties' => [ + 'OutputFileMode' => ['title' => '', 'description' => 'Controls the file output mode. Valid values: url or base64. If this parameter is not specified, base64 is used by default for legacy compatibility.', 'type' => 'string', 'example' => 'base64', 'required' => false], + ], + 'required' => false, + 'example' => '{"OutputFileMode": "url"}', + ], + ], + [ + 'name' => 'Model', + 'in' => 'formData', + 'schema' => ['type' => 'string', 'description' => '', 'title' => '', 'example' => ''], + ], + [ + 'name' => 'Resume', + 'in' => 'formData', + 'schema' => ['type' => 'boolean', 'description' => '', 'title' => '', 'example' => ''], + ], + ], + 'responses' => [ + 200 => [ + 'schema' => [ + 'type' => 'object', + 'properties' => [ + 'RequestId' => ['title' => '', 'description' => 'The request ID.', 'type' => 'string', 'example' => 'EA12****-****-****-****-****E5C'], + 'Role' => ['title' => '', 'description' => 'The role (user / assistant / system / tool).', 'type' => 'string', 'example' => 'user'], + 'Status' => ['title' => '', 'description' => 'The reply status (created / in_progress / completed).', 'type' => 'string', 'example' => 'in_progress'], + 'Type' => ['title' => '', 'description' => 'The message type (reasoning (model thinking process) / message (formal reply)).', 'type' => 'string', 'example' => 'message / text'."\n"], + 'Content' => [ + 'title' => '', + 'description' => 'The content block list (included only when Status is completed).', + 'type' => 'array', + 'items' => [ + 'type' => 'object', + 'properties' => [ + 'Object' => ['title' => '', 'description' => 'The object type.', 'type' => 'string', 'example' => '""'], + 'Text' => ['title' => '', 'description' => 'The text content.', 'type' => 'string', 'example' => '您好'], + 'Type' => ['title' => '', 'description' => 'The content type ("text" / "data").', 'type' => 'string', 'example' => 'text'], + 'Data' => ['title' => '', 'description' => 'The structured data (such as tool invocation). Example: {"call_id":"call_xxx","name":"get_weather", "output":"Tool output details in text format"}.', 'type' => 'object', 'example' => '{"call_id":"call_xxx","name":"get_weather","arguments":"{"city":"Beijing"}"}'], + ], + 'description' => '', + 'title' => '', + 'example' => '', + ], + 'example' => '', + ], + 'SequenceNumber' => ['title' => '', 'description' => 'The event sequence number (an incrementing integer in string format, used to guarantee ordering). Note: When StreamOptions filters out certain event types, the filtered events still consume sequence numbers. Therefore, the sequence numbers received by the client may not be contiguous.', 'type' => 'string', 'example' => '1'], + 'Object' => [ + 'title' => '', + 'description' => 'The event object type.', + 'enumValueTitles' => ['response / message / content' => 'response / message / content'], + 'type' => 'string', + 'example' => 'response', + ], + 'Id' => ['title' => '', 'description' => 'The unique message identifier.', 'type' => 'string', 'example' => 'msg_xxx'], + 'Text' => ['title' => '', 'description' => 'The incremental text content (included in Object=content events).'."\n" + .'[_single.resp.200.props.Created.desc](Deprecated) The creation timestamp.', 'type' => 'string', 'example' => '"hello"'], + 'Created' => ['description' => '(已废弃)创建时间戳', 'type' => 'string', 'example' => '1773380609', 'title' => ''], + 'CreatedAt' => ['title' => '', 'description' => 'The creation timestamp (Unix seconds).', 'type' => 'string', 'example' => '1773380609'], + 'SessionId' => ['title' => '', 'description' => 'The session ID.', 'type' => 'string', 'example' => '176405663****961'], + 'Success' => ['title' => '', 'description' => 'Indicates whether the request is successful.', 'type' => 'boolean', 'example' => 'true'], + 'Code' => ['title' => '', 'description' => 'The business status code.', 'type' => 'string', 'example' => '200'], + 'HttpStatusCode' => ['title' => '', 'description' => 'The HTTP status code.', 'type' => 'integer', 'format' => 'int32', 'example' => '200'], + 'Message' => ['title' => '', 'description' => 'The error details (returned on failure).', 'type' => 'string', 'example' => 'null'], + 'TraceId' => ['type' => 'string', 'example' => '0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d', 'description' => '', 'title' => ''], + ], + 'description' => '', + 'title' => '', + 'example' => '', + ], + ], + ], + 'staticInfo' => ['returnType' => 'synchronous'], + 'title' => 'Streaming conversation', + 'summary' => 'Conducts a streaming conversation with JVS Crew, using the Server-Sent Events (SSE) protocol to push conversation content in real time.', + 'description' => '**Features**'."\n" + ."\n" + .'- Real-time streaming response that reduces time to first token.'."\n" + .'- Supports multimodal input (text, images, and files).'."\n" + .'- Session persistence for multi-turn conversations.'."\n" + .'- Event-driven architecture for precise message status control.'."\n" + ."\n" + .'**Request information**'."\n" + ."\n" + .'- **Request method**: `POST`'."\n" + .'- **Content-Type**: `application/json`'."\n" + .'- **Response Content-Type**: `text/event-stream`.', + 'requestParamsDescription' => '##### StreamOptions structure'."\n" + ."\n" + .'`StreamOptions` is an optional streaming output control parameter used to streamline the events returned in the SSE stream.'."\n" + ."\n" + .'**Recommendation**: For consumer-facing scenarios, set `"IncludeReasoning": false, "IncludeToolCalls": false` to significantly simplify client-side parsing logic.'."\n" + ."\n" + .'**Notes**:'."\n" + .'- If `StreamOptions` is not specified or set to a null object `{}`, the default behavior is fully consistent with the legacy version.'."\n" + .'- Filtering affects only the SSE output. It does not affect the model inference process or the actual execution of tool invocations.'."\n" + .'- After filtering, `SequenceNumber` values may not be contiguous, but the order is correct.'."\n" + ."\n" + .'##### Settings structure'."\n" + ."\n" + .'**Recommendation**: When `base64` is used, file-type data structures from tool output are returned in Base64 format. However, large Base64 payloads can affect SSE transmission stability, so this is not recommended. When `url` is used, a temporary downloadable URL is returned.'."\n" + ."\n" + .'**Notes**:'."\n" + .'- If `Settings` is not specified or set to a null object `{}`, the default behavior is to use `base64`.'."\n" + .'- The default mode is planned to switch to `url` in the future. Use `url` mode when integrating.'."\n" + ."\n" + .'##### Input structure'."\n" + ."\n" + .'The `Input` parameter is a **JSON string** (not an object array) that contains a Message array. Serialize it to a string before passing it.'."\n" + ."\n" + .'#### Request example'."\n" + ."\n" + .'```bash'."\n" + .'curl -N -X POST \\'."\n" + .' \'https://wuyingai.cn-shanghai.aliyuncs.com/api/agent/chat?Authorization=Bearer%20<access_token>&TemplateId=<template_id>\' \\'."\n" + .' -H \'Content-Type: application/json\' \\'."\n" + .' -H \'Accept: text/event-stream\' \\'."\n" + .' -H \'Cache-Control: no-cache\' \\'."\n" + .' -H \'Connection: keep-alive\' \\'."\n" + .' -H \'x-acs-version: 2026-03-11\' \\'."\n" + .' -H \'x-acs-action: Chat\' \\'."\n" + .' -H \'x-acs-date: 2026-03-18T06:21:31Z\' \\'."\n" + .' -d \'{'."\n" + .' "Input": "[{\\"Role\\":\\"user\\",\\"Content\\":[{\\"Type\\":\\"text\\",\\"Text\\":\\"你好\\"}]}]",'."\n" + .' "ExternalUserId": "test-user",'."\n" + .' "SessionId": "test-session-001",'."\n" + .' "StreamOptions": {'."\n" + .' "IncludeReasoning": false,'."\n" + .' "IncludeToolCalls": false'."\n" + .' },'."\n" + .' "Settings": {'."\n" + .' "OutputFileMode": "url"'."\n" + .' }'."\n" + .' }\''."\n" + ."\n" + .'```'."\n" + ."\n" + .'**Notes**:'."\n" + ."\n" + .'* The `-N` parameter disables buffering to receive the SSE stream in real time.'."\n" + ."\n" + .'* Set `x-acs-date` to the current UTC time in ISO 8601 format.'."\n" + ."\n" + .'* `Input` is a JSON string. Escape the quotation marks.'."\n" + ."\n" + .'* Replace `<access_token>` with the actual access token. If the token has expired (401 error), call GetAccessToken again to obtain a new one.', + 'responseParamsDescription' => '#### Response event fields'."\n" + ."\n" + .'The `Object=response` event is the lifecycle wrapper for the entire reply, marking the start and end of the reply.'."\n" + ."\n" + .'#### Message event fields'."\n" + ."\n" + .'The `Object=message` event represents a specific message. The `Type` field distinguishes the message type.'."\n" + ."\n" + .'#### Event types'."\n" + ."\n" + .'| Event type | Object | Description | Trigger |'."\n" + .'| --- | --- | --- | --- |'."\n" + .'| Reply created | `response` | Status=`created`. The lifecycle of the entire reply begins. | SSE stream starts |'."\n" + .'| Reply in progress | `response` | Status=`in_progress` | Content generation starts |'."\n" + .'| Reasoning started | `message` | Type=`reasoning`, Status=`in_progress` | Model starts reasoning |'."\n" + .'| Reasoning content increment | `content` | Text fragment from the reasoning phase (Status=`in_progress`) | Each time a reasoning text segment is generated |'."\n" + .'| Reasoning completed | `message` | Type=`reasoning`, Status=`completed` | Reasoning ends |'."\n" + .'| Message started | `message` | Type=`message`, Status=`in_progress` | Formal reply generation starts |'."\n" + .'| Message content increment | `content` | Text fragment of the formal reply (Status=`in_progress`) | Each time a reply text segment is generated |'."\n" + .'| Message content completed | `content` | Aggregated full text (Status=`completed`) | Formal reply text generation is complete |'."\n" + .'| Message completed | `message` | Type=`message`, Status=`completed` | Formal reply ends |'."\n" + .'| Reply completed | `response` | Status=`completed` | SSE stream ends |'."\n" + .'| Error | `error` | Error message | When an error occurs |'."\n" + .'| Heartbeat | `:ping` (comment line) | Keeps the connection alive. The client can ignore this. | Every few seconds during idle periods |'."\n" + ."\n" + .'> **Note**: The content from the reasoning phase (`reasoning`) represents the model\'s internal reasoning process and should not be displayed to end users. The client should check the `Type` of the current message to determine whether to display the corresponding content.'."\n" + ."\n" + .'#### SSE response example'."\n" + ."\n" + .'**Complete flow**:'."\n" + ."\n" + .'```text'."\n" + .'data: {"Object":"response","Status":"created","SequenceNumber":"0"}'."\n" + ."\n" + .'data: {"Object":"response","Status":"in_progress","SequenceNumber":"1"}'."\n" + ."\n" + .': ping'."\n" + ."\n" + .'data: {"Object":"message","Id":"msg_001","SessionId":"176405663****961","Type":"reasoning","Status":"in_progress","SequenceNumber":"2"}'."\n" + ."\n" + .'data: {"Object":"content","Id":"msg_001","Type":"text","Status":"in_progress","Text":"用户在打招呼","SequenceNumber":"3"}'."\n" + ."\n" + .'data: {"Object":"content","Id":"msg_001","Type":"text","Status":"in_progress","Text":",我简单回复即可","SequenceNumber":"4"}'."\n" + ."\n" + .'data: {"Object":"message","Id":"msg_001","Type":"message","Status":"in_progress","SequenceNumber":"5"}'."\n" + ."\n" + .'data: {"Object":"content","Id":"msg_001","Type":"text","Status":"in_progress","Text":"您好","SequenceNumber":"6"}'."\n" + ."\n" + .'data: {"Object":"content","Id":"msg_001","Type":"text","Status":"in_progress","Text":"!","SequenceNumber":"7"}'."\n" + ."\n" + .'data: {"Object":"content","Id":"msg_001","Type":"text","Status":"completed","Text":"用户在打招呼,我简单回复即可","SequenceNumber":"8"}'."\n" + ."\n" + .'data: {"Object":"message","Id":"msg_001","Type":"reasoning","Status":"completed","SequenceNumber":"9"}'."\n" + ."\n" + .'data: {"Object":"message","Id":"msg_001","Type":"message","Status":"completed","Content":[{"Type":"text","Text":"您好!"}],"SequenceNumber":"10"}'."\n" + ."\n" + .'data: {"Object":"response","Status":"completed","SequenceNumber":"11"}'."\n" + .'```'."\n" + ."\n" + .'> **Tips**:'."\n" + .'> - The content events at `SequenceNumber=3~4` belong to the `reasoning` (thinking) phase, and the content events at `SequenceNumber=6~7` belong to the `message` (formal reply) phase. The client should display only the content from the `message` phase.'."\n" + .'> - `SequenceNumber=8` is an aggregated content event with `Status=completed` that contains the full text of a phase. It may appear after incremental events of a subsequent phase (asynchronous aggregation). The client should track the `Type` of the most recent `Object=message` event to determine which phase the current content belongs to.'."\n" + .'> - `: ping` is an SSE protocol comment line. Browser EventSource and mainstream SSE libraries automatically ignore it.'."\n" + ."\n" + .'***URL-type file data structure example***:'."\n" + .'```text'."\n" + .'{'."\n" + .' "Status": "completed",'."\n" + .' "Role": "tool",'."\n" + .' "Type": "plugin_call_output",'."\n" + .' "Content": [{'."\n" + .' "Object": "content",'."\n" + .' "Type": "data",'."\n" + .' "Data": {'."\n" + .' "name": "sandbox_send_file_to_user",'."\n" + .' "output": "[{\\"type\\": \\"file\\", \\"source\\": {\\"type\\": \\"url\\", \\"url\\": \\"https://jvs-crew-san****k%3D\\"}, \\"filename\\": \\"test_write.txt\\"}, {\\"type\\": \\"text\\", \\"text\\": \\"Sent file: test_write.txt\\"}]",'."\n" + .' "call_id": "call_f0***2a661"'."\n" + .' }'."\n" + .' }],'."\n" + .' "SequenceNumber": "106",'."\n" + .' "Object": "message",'."\n" + .' "Id": "msg_85a*****7de40a2eba"'."\n" + .'}'."\n" + .'```'."\n" + ."\n" + .'***Base64-type file data structure example***:'."\n" + .'```text'."\n" + .'{'."\n" + .' "Role": "tool",'."\n" + .' "Status": "completed",'."\n" + .' "Type": "plugin_call_output",'."\n" + .' "Content": [{'."\n" + .' "Type": "data",'."\n" + .' "Object": "content",'."\n" + .' "Data": {'."\n" + .' "name": "sandbox_send_file_to_user",'."\n" + .' "output": "[{\\"type\\": \\"file\\", \\"source\\": {\\"type\\": \\"base64\\", \\"media_type\\": \\"text/markdown\\", \\"data\\": \\"IyDmrKL*****15bm0Kgo=\\"}, \\"filename\\": \\"welcome.md\\"}, {\\"type\\": \\"text\\", \\"text\\": \\"Sent file: welcome.md\\"}]",'."\n" + .' "call_id": "call_7*****92b0dc"'."\n" + .' }'."\n" + .' }],'."\n" + .' "SequenceNumber": "121",'."\n" + .' "Object": "message",'."\n" + .' "Id": "msg_655f******b84e"'."\n" + .'}'."\n" + .'```.', + 'changeSet' => [], + 'ramActions' => [], + 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"EA12****-****-****-****-****E5C\\",\\n \\"Role\\": \\"user\\",\\n \\"Status\\": \\"in_progress\\",\\n \\"Type\\": \\"message / text\\\\n\\",\\n \\"Content\\": [\\n {\\n \\"Object\\": \\"\\\\\\"\\\\\\"\\",\\n \\"Text\\": \\"您好\\",\\n \\"Type\\": \\"text\\",\\n \\"Data\\": {\\n \\"test\\": \\"test\\",\\n \\"test2\\": 1\\n }\\n }\\n ],\\n \\"SequenceNumber\\": \\"1\\",\\n \\"Object\\": \\"response\\",\\n \\"Id\\": \\"msg_xxx\\",\\n \\"Text\\": \\"\\\\\\"hello\\\\\\"\\",\\n \\"Created\\": \\"1773380609\\",\\n \\"CreatedAt\\": \\"1773380609\\",\\n \\"SessionId\\": \\"176405663****961\\",\\n \\"Success\\": true,\\n \\"Code\\": \\"200\\",\\n \\"HttpStatusCode\\": 200,\\n \\"Message\\": \\"null\\",\\n \\"TraceId\\": \\"0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d\\"\\n}","type":"json"}]', + ], + 'GetAccessToken' => [ + 'methods' => ['get', 'post'], + 'schemes' => ['https'], + 'security' => [ + [ + 'AK' => [], + ], + ], + 'operationType' => 'readAndWrite', + 'deprecated' => false, + 'systemTags' => ['operationType' => 'get', 'riskType' => 'none', 'chargeType' => 'free'], + 'parameters' => [ + [ + 'name' => 'ExternalUserId', + 'in' => 'query', + 'schema' => ['title' => '', 'description' => 'The unique identifier of the user in the external system.', 'type' => 'string', 'example' => '"user-38764"', 'required' => false], + ], + [ + 'name' => 'TemplateId', + 'in' => 'query', + 'schema' => ['title' => '', 'description' => 'The ID of the agent template.', 'type' => 'string', 'required' => false, 'example' => '1600112233445566'], + ], + ], + 'responses' => [ + 200 => [ + 'schema' => [ + 'title' => '', + 'description' => 'PlainResult<CreateRepositoryItemResponseDTO>', + 'type' => 'object', + 'properties' => [ + 'Success' => ['title' => '', 'description' => 'Indicates whether the request was successful.', 'type' => 'boolean', 'example' => 'true'], + 'Code' => ['title' => '', 'description' => 'The business status code.', 'type' => 'string', 'example' => '"200"'], + 'Message' => ['title' => '', 'description' => 'The error details. This parameter is returned only when the request fails.', 'type' => 'string', 'example' => 'null'], + 'HttpStatusCode' => ['title' => '', 'description' => 'The HTTP status code.', 'type' => 'integer', 'format' => 'int32', 'example' => '200'], + 'RequestId' => ['title' => '', 'description' => 'The request ID, in UUID format. The first and last characters are retained for illustration purposes.', 'type' => 'string', 'example' => '"EA12****-****-****-****-****E5C"'], + 'AccessToken' => ['title' => '', 'description' => 'The JWT used as the Authorization query parameter for the Chat operation. The token is valid for a limited period of time.', 'type' => 'string', 'example' => '"eyJhbGc****.eyJ********.****TCk"'], + 'AccessDeniedDetail' => ['title' => '', 'description' => 'The details of the authentication failure.', 'type' => 'string', 'example' => 'null'], + ], + 'example' => '', + ], + ], + ], + 'staticInfo' => ['returnType' => 'synchronous'], + 'title' => 'Obtain an access token', + 'summary' => 'Obtains an access token (AccessToken) for user conversations, which is used to authenticate when invoking the Chat operation.', + 'description' => '**Token format**: The AccessToken is a **JWT** consisting of **Header.Payload.Signature** segments, each Base64URL-encoded and concatenated with `.` into a single line. The examples in the following table are masked for illustration purposes. The actual RequestId and JWT segments are longer.'."\n" + ."\n" + .'**Token validity**: The AccessToken **is valid for a limited period of time**. After it expires, call this operation again to obtain a new token.'."\n" + ."\n" + .'**Authentication method**: POP V1 signature (AK/SK)'."\n" + ."\n" + .'**Action**: `GetAccessToken`.', + 'requestParamsDescription' => '#### Request example'."\n" + ."\n" + .'```python'."\n" + .'params = {'."\n" + .' "Format": "JSON",'."\n" + .' "Version": "2026-03-11",'."\n" + .' "AccessKeyId": ak,'."\n" + .' "SignatureMethod": "HMAC-SHA1",'."\n" + .' "Timestamp": _now_utc(),'."\n" + .' "SignatureVersion": "1.0",'."\n" + .' "SignatureNonce": str(uuid.uuid4()),'."\n" + .' "Action": "GetAccessToken",'."\n" + .' "RegionId": "ap-southeast-1",'."\n" + .' "ExternalUserId": "user-38764",'."\n" + .'}'."\n" + .'params["Signature"] = _sign_v1(params, sk)'."\n" + .'```.', + 'responseParamsDescription' => '#### Response example'."\n" + ."\n" + .'**Success**:'."\n" + ."\n" + .'```json'."\n" + .'{'."\n" + .' "Success": true,'."\n" + .' "Code": "200",'."\n" + .' "HttpStatusCode": 200,'."\n" + .' "RequestId": "EA12****-****-****-****-****E5C",'."\n" + .' "AccessToken": "eyJhbGc****.eyJ********.****TCk"'."\n" + .'}'."\n" + .'```'."\n" + ."\n" + .'**Failure**:'."\n" + ."\n" + .'```json'."\n" + .'{'."\n" + .' "Success": false,'."\n" + .' "Code": "400",'."\n" + .' "Message": "Invalid ExternalUserId",'."\n" + .' "HttpStatusCode": 400'."\n" + .'}'."\n" + .'```.', + 'changeSet' => [], + 'ramActions' => [ + [ + 'operationType' => 'get', + 'ramAction' => [ + 'action' => 'agentbay:GetAccessToken', + 'authLevel' => 'operate', + 'actionConditions' => [], + 'resources' => [ + ['validationType' => 'always', 'product' => 'WuyingAI', 'resourceType' => 'All Resource', 'arn' => '*'], + ], + ], + ], + ], + 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Success\\": true,\\n \\"Code\\": \\"\\\\\\"200\\\\\\"\\",\\n \\"Message\\": \\"null\\",\\n \\"HttpStatusCode\\": 200,\\n \\"RequestId\\": \\"\\\\\\"EA12****-****-****-****-****E5C\\\\\\"\\",\\n \\"AccessToken\\": \\"\\\\\\"eyJhbGc****.eyJ********.****TCk\\\\\\"\\",\\n \\"AccessDeniedDetail\\": \\"null\\"\\n}","type":"json"}]', + ], + ], + 'endpoints' => [], + 'errorCodes' => [ + ['code' => 'Channels.CredentialConflictError', 'message' => 'Credential is already in use.', 'http_code' => 409, 'description' => 'The credential is already in use by another configuration.'], + ['code' => 'SandboxImages.ImageBusy', 'message' => 'Image is being deployed/removed, please try again later.', 'http_code' => 409, 'description' => 'Image is being deployed/removed, please try again later.'], + ['code' => 'SandboxImages.ImageInUse', 'message' => 'The image is being used by the template. Switch to another image first.', 'http_code' => 409, 'description' => 'The image is being used by the template. Switch to another image first.'], + ['code' => 'SandboxImages.ImageNameDuplicate', 'message' => 'The image name already exists. Modify it and try again.', 'http_code' => 409, 'description' => 'The image name already exists. Modify it and try again.'], + ['code' => 'SandboxImages.InternalError', 'message' => 'Internal service error, please try again later.', 'http_code' => 500, 'description' => 'Internal service error, please try again later.'], + ['code' => 'SandboxImages.InvalidStatus', 'message' => 'The current operation cannot be performed because the mirror status does not match.', 'http_code' => 409, 'description' => ''], + ], + 'changeSet' => [], + 'ram' => [ + 'productCode' => 'WuyingAI', + 'productName' => 'Elastic Desktop Service', + 'ramCodes' => ['agentbay', 'ecd'], + 'ramLevel' => 'OPERATION', + 'ramConditions' => [], + 'ramActions' => [ + [ + 'apiName' => 'GetAccessToken', + 'description' => '', + 'operationType' => 'get', + 'ramAction' => [ + 'action' => 'agentbay:GetAccessToken', + 'authLevel' => 'operate', + 'actionConditions' => [], + 'resources' => [ + ['validationType' => 'always', 'product' => 'WuyingAI', 'resourceType' => 'All Resource', 'arn' => '*'], + ], + ], + ], + ], + 'resourceTypes' => [], + ], +]; |
