파일 조회 - DevCamp2Flame/FlameTalk_Server GitHub Wiki
File get API
Request
Method
GET
URL
/api/file/{fileId}
Header
| Method |
Parameter |
Description |
| Content-Type |
application/json |
|
| token |
{token} |
access token값 |
Path Variable
| Parameter |
Type |
Description |
Required |
| fileId |
Long |
파일 id 값 |
Y |
Response
Header
| Method |
Parameter |
Description |
| statusCode |
{statusCode} |
http 상태 코드 값 |
Body
| Field |
Type |
Description |
| code |
Integer |
응답 코드 |
| message |
String |
응답 메세지 |
| data |
Object |
data 참고 |
data
| Field |
Type |
Description |
| fileId |
Long |
파일 id 값 |
| title |
String |
파일 이름 |
| extension |
String |
파일 확장자 |
| url |
String |
S3 URL |
| createdDate |
LocalDateTime |
파일 업로드한 날짜 |
SUCCESS example
{
"status": 200,
"messsage": "파일 조회 성공",
"data": {
"fileId": 1,
"title": "flametalk_profile_12_1",
"extension": "jpeg",
"url": "https://s3sopt25.s3.ap-northeast-2.amazonaws.com/1577892544930.png",
"createdDate": "2022-01-14T10:52:39"
}
}
Error Code
| Code |
Error Messsage |
| 400 |
Bad Request |
| 401 |
Unauthorized |
| 404 |
File Not Found |
| 500 |
Server Error |
FAIL example
{
"status": 404,
"message": "존재하지 않는 파일입니다.",
"error": "NOT_FOUND",
"code": "FILE_NOT_FOUND",
"timestamp": "2022-01-18T19:30:16.3072905",
}