Upload a file for a block to show
Keeps a file as the brand's media and answers the public URL it is served from: what a send_media message takes as its url, or an ask block as its mediaSrc. A file that is already at a public URL needs none of this, because a block takes that URL as it is.
A send_media message becomes an image, a video, an audio or a document by the extension at the end of its URL, so the URL answered here ends in the file's own extension, lowercased, and a file named without one gets the one its content says.
Up to 30 MB. An extension a browser opens as a page or runs as a script is refused: .html, .htm, .xhtml, .xht, .shtml, .js, .mjs, .xml and .swf, with .exe and the few others the builder refuses too. An .svg is kept, as the builder keeps it: the chat shows it as an image. With channel_family set to whatsapp, the file is also checked against what WhatsApp sends: its type has to be one WhatsApp takes, and its size within WhatsApp's limit for that type.
Needs the permission to edit bots. Counted per brand, on top of the limit every call has: 60 uploads an hour, shared by every member.
Request
- Base URL: https://api.landbot.io/v0-alpha
- URL: https://api.landbot.io/v0-alpha/media
- Auth: one of:
- API key in header Authorization
- API key in cookie sessionid
- HTTP bearer
Response
The file, kept and served
Example response
{
"data": {
"url": "https://storage.googleapis.com/media.landbot.io/1234/ronin/f3c1e0b7a9d24c6e8b5a7d2c1e0f9a8b.png",
"content_type": "image/png",
"size": 48213
}
}Changes
No recorded changes to this operation across all 1 revision of this API.