You can call this operation to create a bucket.

You need to activate OSS before creating a bucket. To activate OSS, log on to the OSS console (https://oss.console.aliyun.com).

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request headers

This operation uses common request headers, instead of special request headers. For more information, see the "Common request headers" section in "Common request and response headers."

Request syntax

POST /pop/v1/wam/storage HTTP/1.1

Request parameters

Response parameters

Parameter Type Example Description
Code String OK

The response code. The value is OK if the request is successful.

Message String success

The response message. The value is success if the request is successful.

RequestId String E61A371C-53D9-4F66-A90E-4FC09EE*****

The ID of the request.

Storage

The information about the bucket.

BucketName String webplus-cn-shenzhen-s-5d01fab421ed1528121*****

The name of the bucket.

CreateTime Long 1564388637126

The time when the bucket was created.

UpdateTime Long 1564388637126

The time when the bucket was last updated.

Examples

Sample request


http://webplus.cn-hangzhou.aliyuncs.com/pop/v1/wam/storage?ServiceCode=webx&<Common request parameters>

Sample success response

XML format

<CreateStorageResponse>
    <Storage>
        <BucketName>webplus-cn-shenzhen-s-5d01fab421ed1528121*****</BucketName>
        <CreateTime>1564388637551</CreateTime>
        <UpdateTime>1564388637551</UpdateTime>
    </Storage>
    <Message>success</Message>
    <RequestId>3373E77A-9FDF-4B7F-981F-17C2446*****</RequestId>
    <Code>OK</Code>
</CreateStorageResponse>

JSON format

{
	"Storage":{
		"BucketName":"webplus-cn-shenzhen-s-5d01fab421ed1528121*****",
		"CreateTime":1564388637126,
		"UpdateTime":1564388637126
	},
	"Message":"success",
	"RequestId":"E229C81C-2315-46B0-A5D7-3C2BA73*****",
	"Code":"OK"
}

Error codes

HTTP status code Error code Error message Description
400 OSSDisabled You have not activated the OSS service and cannot use the WebPlus service. Please go to the OSS console (https://oss.console.aliyun.com) to activate OSS and try again. The error message returned because you have not activated OSS. Log on to the OSS console (https://oss.console.aliyun.com) and activate OSS before using Web+.
400 OSSApiCallFailed When initializing applications, updating configurations, or destroying applications, WebPlus attempts to communicate with OSS through API communication. An OSS service throw error occurred. The bucket or the file does not exist. The error message returned because an exception (such as the non-existence of a bucket or file) was thrown by OSS when Web+ attempted to communicate with OSS through the API to initialize an application, update the configuration, or destroy the application.

For more information about error codes, see API Error Center.