Uploading an image
Function
Uploading an image
URI
POST /v2/{project_id}/img
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Specifies the 32-bit ID of the devcloud project. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Specifies the user token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
file |
Yes |
File |
GIF Files |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
img_id |
String |
Specifies the image ID. |
img_url |
String |
The image URL v1 is changed to v3 as the image download request. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_msg |
String |
Description |
error_code |
String |
Error Codes |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_msg |
String |
Description |
error_code |
String |
Error Codes |
Example Requests
Post https://{endpoint}/v2/99be3c6242d74ad180292a689f95d666/img Post https://{endpoint}/v2/99be3c6242d74ad180292a689f95d666/img
Example Responses
Status code: 200
OK
{ "img_id" : 1, "img_url" : "/v1/upload/0792b7d26cb74bd799cbae80063dc74a/202006/1591339394752881984.gif" }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
401 |
Unauthorized |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot