Docs
api
Object-based Storage(US3)
CreateUFileToken

Create US3 Token - CreateUFileToken

Overview

Create US3 Token

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is CreateUFileToken.Yes
PublicKeystringThe user’s public key can be obtained from ConsoleYes
SignaturestringUser signature generated based on public key and API command, see Signature AlgorithmYes

Request Parameters

Parameter NameTypeDescription InformationRequired
RegionstringRegion. See List of Regions and Availability ZonesNo
ProjectIdstringProject ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the GetProjectList interface.No
TokenNamestringToken NameYes
AllowedOps.NstringActions allowed by the token
[TOKEN_ALLOW_NONE No permission, TOKEN_ALLOW_READ Download permission, TOKEN_ALLOW_WRITE Upload permission, TOKEN_ALLOW_DELETE Deletion permission, TOKEN_ALLOW_LIST List permission, TOKEN_ALLOW_IOP Image processing permission, TOKEN_DENY_UPDATE Prohibit overwrite permission]. Default is TOKEN_ALLOW_NONE
No
AllowedPrefixes.NstringThe token allows the operation of key prefixes, default * represents all.No
AllowedBuckets.NstringThe token allows operations on the bucket, default * means all.No
ExpireTimeintUnix timestamp, accurate to the second, is the expiration time of the token. The default expiration time is one day (i.e., the current Unix timestamp + 86400); Note: The expiration time cannot exceed 4102416000.No
BlackIPList.NstringToken Blacklist, supports ipv4, ipv6 formats.No
WhiteIPList.NstringToken whitelist, supports ipv4, ipv6 formats.No

Response Field

Field NameTypeDescription InformationRequired
RetCodeintReturn status code. If it is 0, it means successful return. If it is not 0, it means failure.Yes
ActionstringOperation command name.Yes
MessagestringReturns an error message, providing detailed description when RetCode is non-zero.No
TokenIdstringToken Unique IDNo
UFileTokenSetUFileTokenSetDetails of Creating TokenNo

Data Model

UFileTokenSet

Field NameTypeDescription InformationRequired
RegionstringRegionYes
TokenIdstringToken IDYes
TokenNamestringToken NameYes
PublicKeystringToken Public KeyYes
PrivateKeystringToken Private KeyYes
AllowedOpsarray[string]The actions that the token allows to perform, [TOKEN_ALLOW_NONE No permissions, TOKEN_ALLOW_READ Download permissions, TOKEN_ALLOW_WRITE Upload permissions, TOKEN_ALLOW_DELETE Delete permissions, TOKEN_ALLOW_LIST List permissions, TOKEN_ALLOW_IOP Image processing permissions]Yes
AllowedPrefixesarray[string]The key prefix that the token allows to operateYes
AllowedBucketsarray[string]The token allows operation of the bucketYes
ExpireTimeintExpiration time of the tokenYes
CreateTimeintCreation TimeYes
ModifyTimeintModification TimeYes
BlackIPListarray[string]Token BlacklistNo
WhiteIPListarray[string]Token WhitelistNo

Example

Request Example

https://api.dezai.com/?Action=CreateUFileToken
&Region=ZidvwRDV
&ProjectId=ykZiYbvH
&TokenName=ZwctpTkP
&AllowedOps.n=yes
&AllowedPrefixes.n=BxWpXPuh
&AllowedBuckets.n=tPAdQHnf
&ExpireTime=3
&BlackIPList.n=WGGVYtQm
&WhiteIPList.n=kBRhXipR

Response Example

{
  "Action": "CreateUFileTokenResponse",
  "RetCode": 0,
  "TokenId": "ygqCyolZ",
  "UFileTokenSet": {}
}