POST/bots/{botId}/attachments

봇 서비스에서 사용하는 파일이나 이미지의 업로드 URL과 파일 ID를 생성한다.

참고

  • API를 이용한 콘텐츠 업로드 방법에 대해서는 파일 업로드/다운로드를 확인한다.

주의

  • 업로드 URL 및 파일 ID는 콘텐츠 업로드 API를 호출한 시점으로부터 24시간동안만 유효하다. 해당 시간 내에 콘텐츠를 업로드하여 사용해야 한다.
  • 콘텐츠를 한 번 업로드한 업로드 URL으로 콘텐츠를 다시 업로드할 수 없다.
  • 업로드할 수 있는 파일의 최대 크기는 관리자 화면 > 서비스 > 메시지 > 일반 > 메시지/파일 관리에서 파일 1개 최대 첨부 용량으로 지정된 사이즈와 같다.
  • File, Image를 제외한 메시지 유형 및 리치 메뉴에서는 최대 파일 크기가 1MB로 제한된다.

Authorization

oauth2

OAuth 2.0 인증.
자세한 인증 방식은 인가·인증을 참고한다.

Scope

bot.message
bot

HTTP Request

POSThttps://www.worksapis.com/v1.0/bots/{botId}/attachments

Path Parameters

ParameterTypeDescription
botId integer 

봇 ID


required
example : 2000001
format : int64 

Header Parameters

HeadertypeDescription
Authorization string 

Bearer {token}


required 
Content-Type string 

application/json


required
example : application/json 

Request Body

PropertyTypeDescription
fileName string 

파일 이름

 

Request Example

example

1{2  "fileName": "ExampleFile.pdf"3}

Response

HTTP 200

OK

PropertyTypeDescription
fileId string 

파일 ID


required 
uploadUrl string 

파일을 업로드할 수 있는 URL


required 

Response Example

example

1{2  "fileId": "jp1.1628695315008671000.1628781715.0.1000001.0.0.0",3  "uploadUrl": "https://storage.worksmobile.com/k/emsg/r/jp1/1628695775389602000.1628782175.1.1000001.0.0.0/file.pdf"4}