All Products
Search
Document Center

Serverless App Engine:GetWebshellToken

Last Updated:Dec 17, 2025

Obtains the token used to remotely log on to the Webshell of an instance.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
sae:GetWebshellTokenget
*All Resources
*
    none
none

Request syntax

GET /pop/v1/sam/instance/webshellToken HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
AppIdstringYes

The ID of the interactive messaging application.

017f39b8-dfa4-4e16-a84b-1dcee4b1****
PodNamestringYes

The name of the pod.

hello-podsdfsdfsdfsdf
ContainerNamestringNo

The name of the init container.

Note:

  • If you specify this parameter, Cloud Assistant runs the command in the specified container of the instances.

  • If this parameter is specified, the command can run only on Linux instances on which Cloud Assistant Agent 2.2.3.344 or later is installed.

  • If this parameter is specified, the Username parameter that is specified in a request to call this operation and the WorkingDir parameter that is specified in a request to call the CreateCommand operation do not take effect. You can run the command only in the default working directory of the container by using the default user of the container. For more information, see Use Cloud Assistant to run commands in containers.

  • If this parameter is specified, only shell scripts can be run in Linux containers. You cannot add a command in the format similar to #!/usr/bin/python at the beginning of a script to specify a script interpreter. For more information, see Use Cloud Assistant to run commands in containers.

ad-helper

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

Request ID.

91F93257-7A4A-4BD3-9A7E-2F6EAE6D****
Messagestring

The returned message. Value description:

  • If the request was successful, a success message is returned.
  • An error code is returned if the request failed.
success
TraceIdstring

The ID of the trace.

0a98a02315955564772843261e****
Dataobject

The returned result.

Tokenstring

The information about the token.

zWWpvRj_5pzof4hfo7-hGynM8oGMmO_7
HttpUrlstring

Webshell page address

HttpUrl : "https://sae.console.alibabacloud.com/cn-shenzhen/app-list/app1/micro-app/shell/pod1?tokenId=xxx
WebSocketUrlstring

The WebSocket address.

wss://sae-webshell.console.aliyun.com/websocket/eamWebshell?tokenId=xxx&region=cn-shenzhen
ErrorCodestring

The error code returned if the call failed. Value values:

  • If the request was successful, ErrorCode is not returned.
  • If the request failed, the ErrorCode parameter is returned. For more information, see Error codes section in this topic.
400
Codestring

The HTTP status code. Valid values:

  • 2xx: The request was successful.
  • 3xx: The request was redirected.
  • 4xx: The request failed.
  • 5xx: A server error occurred.
200
Successboolean

Indicates whether the request was successful.

true

Examples

Sample success responses

JSONformat

{
  "RequestId": "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
  "Message": "success",
  "TraceId": "0a98a02315955564772843261e****",
  "Data": {
    "Token": "zWWpvRj_5pzof4hfo7-hGynM8oGMmO_7",
    "HttpUrl": "HttpUrl :  \"https://sae.console.alibabacloud.com/cn-shenzhen/app-list/app1/micro-app/shell/pod1?tokenId=xxx",
    "WebSocketUrl": "wss://sae-webshell.console.aliyun.com/websocket/eamWebshell?tokenId=xxx&region=cn-shenzhen"
  },
  "ErrorCode": 400,
  "Code": 200,
  "Success": true
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidApplication.NotFoundThe current application does not exist.-
400InvalidParameter.NotEmptyYou must specify the parameter %s.-
400InvalidParameter.ObviouslyThe specified parameter is invalid {%s}.-
400InvalidParameter.WithMessageThe parameter is invalid {%s}: %s-
500OperationFailed.RPCErrorInternal RPC request processing error.Internal RPC request processing error.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2025-05-07The Error code has changed. The response structure of the API has changedView Change Details
2025-01-02The Error code has changed. The request parameters of the API has changedView Change Details