createFile
- Print
- PDF
createFile
- Print
- PDF
Article Summary
Share feedback
Thanks for sharing your feedback!
Uploads a file.
The fileId
of the uploaded file can be reused for 24 hours.
After 24 hours, the file will be deleted and its fileId
will no longer be valid.
POST https://{endpoint}/files
Request
Request parameters
Parameter name | Required status | Type | Restrictions | Description |
---|---|---|---|---|
fileList | Yes | File | File to upload |
Response
HTTP status code | Description |
---|---|
201 | File uploaded successfully. |
400 | Authentication failed, invalid request. |
500 | Server errors |
Example
Request example
POST https://mail.apigw.ntruss.com/api/v1/files
Content-Type: multipart/form-data; boundary=a29b1180-70f5-42f7-afbe-0d68a15f2370
--a29b1180-70f5-42f7-afbe-0d68a15f2370
Content-Disposition: form-data; name="fileList"; filename="test\resources\test.txt"
Content-Type: text/plain
Content-Length: 16
upload test file
--a29b1180-70f5-42f7-afbe-0d68a15f2370--
Response example
{
"tempRequestId":"f355aac1-7776-4c0b-8484-20eaa065cb65-99",
"files":[
{
"fileName":"test.txt",
"fileSize":16,
"fileId":"40fe58bd-91fe-4f89-a62e-705a7c17d65e-99"
}
]
}
Property
Category | Required status | Type | Restrictions | Description |
---|---|---|---|---|
tempRequestId | Yes | String | Temporary request ID (used to delete or search the file) | |
files | Yes | List<AttachFile> | List of files |
Error codes
HTTP Status Code | Return code | Response message |
---|---|---|
400 | 77101 | Error in login information |
400 | 77102 | BAD_REQUEST |
400 | 77103 | Resource not found |
403 | 77201 | No permission |
403 | 77202 | No request to subscribe the email product |
405 | 77001 | METHOD_NOT_ALLOWED |
415 | 77002 | UNSUPPORTED_MEDIA_TYPE |
500 | 77301 | Default project not found |
500 | 77302 | Error in working with external system API |
500 | 77303 | Other INTERNAL_SERVER_ERROR |
Was this article helpful?