POST/bots/{botId}/attachments
Creates an upload URL and a file ID for a file or an image used by the bot service.
Note
- For how to download content using the API, see Upload or Download Files.
Caution
- An upload URL and a file ID are valid only for 24 hours from the time when the Upload content API operation is called. Make sure to upload and use the content within the time.
- The upload URL that was used to upload content cannot be reused.
- The maximum upload size is the same as the value specified in Maximum size for a single file under Service > Message > General > File Policy in the LINE WORKS Admin.
- The maximum file size is limited to 1 MB for message types except for File and Image, and rich menus.
OAuth 2.0 authentication.
For more information, see Authentication and Authorization.
bot.message
bot
| Parameter | Type | Description |
|---|---|---|
| botId | integer | Bot ID required example : 2000001 format : int64 |
| Header | type | Description |
|---|---|---|
| Authorization | string | Bearer {token} required |
| Content-Type | string | application/json required example : application/json |
| Property | Type | Description |
|---|---|---|
| fileName | string | File name |
example
1{2 "fileName": "ExampleFile.pdf"3}OK
| Property | Type | Description |
|---|---|---|
| fileId | string | File ID required |
| uploadUrl | string | URL to upload a file required |
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}