Uploading an Application File
Function
This API is used to upload a file.
URI
POST /v2/{project_id}/msgsms/upload-files
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details, see Obtaining Account, User, and Project Information. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
file_desc |
No |
String |
Description |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
Yes |
String |
Request body parameter type. This parameter must be set to multipart/form-data; boundary=<calculated when request is sent>. |
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is a token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
file |
Yes |
File |
Business license file. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
file_desc |
String |
File description. |
file_id |
String |
File ID. |
file_name |
String |
File name. |
file_ref |
Integer |
File reference. |
file_size |
Long |
File size. |
file_type |
Integer |
File type. |
module_type |
Integer |
Module type. |
operator |
String |
Operator. |
update_time |
String |
Update time. |
Request Example
POST /v2/845ada5bc7444f1295cd517af0123da1/msgsms/upload-files Host: 100.85.***.***:30300 Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW X-Auth-Token:****** Content-Length: 219 ----WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="file"; filename="/C:/Users/******/Desktop/test.PNG" Content-Type: <Content-Type header here> (data) ----WebKitFormBoundary7MA4YWxkTrZu0gW
Response Example
{ "file_id": "******ab-1390-4268-9463-73db98cdc2e1" }
Returned Values
Status Code |
Description |
---|---|
200 |
OK |
201 |
Created |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not Found |
500 |
System error |
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