-
Notifications
You must be signed in to change notification settings - Fork 9
data api assets upload
Yuji Takayama edited this page Jul 10, 2013
·
2 revisions
Upload a file.
Authorization is required.
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
| Parameter | Type | Description |
|---|---|---|
| blog_id | unsigned integer | The blog ID. |
Not available.
| 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. |
If successful, this method will return an Assets resource as the response body.
| Code | Description |
|---|---|
| 200 | no error |
| 403 | Do not have permission to upload. |
| 404 | Site not found |