Skip to content

data api assets upload

Yuji Takayama edited this page Jul 10, 2013 · 2 revisions

Assets: upload

Upload a file.

Authorization is required.

Request

HTTP Request

This method accepts POST only.
Also, should be set Content-Type as multipart/form-data.

POST https://your-host/your-mt-api.cgi/v1/sites/{blog_id}/assets/upload

Parameters

Method Parameters

Parameter Type Description
blog_id unsigned integer The blog ID.

Query Parameters

Not available.

Request Body

Parameter Type Description
path string The upload destination. You can specify the path to the under the site path.
file file The actual file data
autoRenameIfExists boolean If this value is true and the file with the same filename exists, the uploaded file is automatically renamed to the random generated name. Default is false.
normalizeOrientation boolean If this value is true and the uploaded file has a orientation information in Exif, this file's orientation is automatically normalized. Default is true.

Response

If successful, this method will return an Assets resource as the response body.

Status Code

Code Description
200 no error
403 Do not have permission to upload.
404 Site not found

Clone this wiki locally