Upload a file as media
sprkly_upload_mediaUpload files the user has on their machine (slides, photos, a short video) into sprkly and get a media_id for each. LINK MODE is the way to send a file from disk. Send files, one entry per file with its filename, sha256 and size_bytes. You get back one uploadUrl per file. PUT the bytes to it: curl -sS -X PUT --data-binary @01.jpg "". Each PUT answers JSON with mediaId. Links last 15 minutes. Up to 50 MB per file and 35 files per call. The bytes never pass through you, so a whole carousel costs a few hundred tokens. INLINE MODE is for tiny files only (a few KB): data_base64 plus filename, 25 MB at most. base64 costs about one token per character, so never inline a real slide. When files is sent, data_base64 and filename are ignored. For a public link use media_urls on sprkly_schedule_post instead. The same bytes sent twice return the same media_id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | No | LINK MODE. One entry per file, in slide order. Get the values in Bash: sha256sum 01.jpg (first 64 characters) and stat -c %s 01.jpg. 1 to 35 entries. | |
| filename | No | INLINE MODE. The file name, for example 01.jpg. Used in the response and in error messages. The bytes decide the real type. Ignored when files is sent. | |
| data_base64 | No | INLINE MODE, tiny files only. The file contents, base64 encoded. Standard or URL-safe alphabet, with or without a data: prefix. Ignored when files is sent. | |
| content_type | No | INLINE MODE. Optional MIME hint such as image/jpeg. sprkly sniffs the bytes and that wins. |