콘텐츠로 이동

기타 파일 업로드

Endpoint

[POST] API URL 정보

https://patch-kakao-api.happytalk.io/kakaoWebhook/v3/bzc/file/upload
https://kakao-api.happytalk.io/kakaoWebhook/v3/bzc/file/upload

Introduce

Introduce
이미지를 제외한 기타 파일(PDF, ZIP 등)을 상담톡 서버에 업로드하는 API입니다.

Request (Multipart Form Data)

Field Name Type Required Description
Content-type Text Y multipart/form-data
HT-Client-Id Text Y 고객센터에서 발급 받은 key
HT-Client-Secret Text Y 고객센터에서 발급 받은 token

Body

Field Name Type (Length) Required Description
sender_key Text(40) Y 발신프로필 키
file binary Y 업로드할 파일
file_type Text N 업로드할 파일 유형

Example

REST API Sample
curl -L -X POST 'https://patch-kakao-api.happytalk.io/kakaoWebhook/v3/bzc/file/upload' \
-H 'HT-Client-Id: example-id' \
-H 'HT-Client-Secret: example-secret' \
-F 'sender_key="example-sender_key"' \
-F 'file=@"{filepath}/audio.m4a"' \
-F 'file_type="audio"'
curl -L -X POST 'https://kakao-api.happytalk.io/kakaoWebhook/v3/bzc/file/upload' \
-H 'HT-Client-Id: example-id' \
-H 'HT-Client-Secret: example-secret' \
-F 'sender_key="example-sender_key"' \
-F 'file=@"{filepath}/audio.m4a"' \
-F 'file_type="audio"'

Response (Json)

Parameter

Field Name Type Description
code Text 처리 결과 코드 (0000은 정상 / 나머지는 오류)
message Text 처리 실패 시 결과 메시지
file Text 업로드된 파일 경로
name Text 업로드된 파일 이름
size Text 업로드된 파일 용량

Example

Success
{
    "code":"0000",
    "file":"http://api1-kage.kakao.com/dn/dheSsK/wkmwnwWE0N/rUSBQAXk8i8JRr7z0AxWK0/f_xo0fuo.xlsx",
    "name":"example.xlsx",
    "size":9513
}
Failure
{
    "code": -505,
    "message": "FailedToUploadFileException"
}

Data Dictionary

Data Dictionary
Field Name Type Description
file Text 일반 파일 (file)
audio Text 오디오 파일 (audio)
video Text 비디오 파일 (video)

None

Reference

코드 정의