Media Upload

Upload media by URL

Upload a media file by providing an HTTP(S) URL or a base64 data URL. The server downloads HTTP(S) URLs and stores data URLs directly, returning an upload_token in a single step.

This is simpler than the three-step signed URL flow — no separate upload or status check is needed. The upload_token returned can be used in existing_attachments when creating a post, the same as the token from the three-step flow.

Supported file types: jpg, jpeg, png, gif, webp, mp4, mov, avi, webm, mkv, pdf. The maximum decoded file size is about 56 MiB. Base64 data URL payloads are limited to 75 MiB.

post/upload_media_by_url

Request

  • Base URL: https://socialbu.com/api/v1
  • URL: https://socialbu.com/api/v1/upload_media_by_url
  • Auth: HTTP bearer

Request body

urlstring required

HTTP(S) URL to download or a base64 data URL. Base64 payloads are limited to 75 MiB.

namestring

Custom filename for the stored file. If not provided, the filename is extracted from the URL.

Response

File uploaded successfully.

successboolean

Indicates whether the file was uploaded successfully.

messagestring

A message confirming the media upload.

namestring

File name e.g, ("document.pdf", "image.png")

mime_typestring

File MIME type e.g, ("image/jpeg", "video/mp4")

sizeinteger

File size in bytes.

keystring

A unique storage key for the uploaded file.

upload_tokenstring

Pass this token value in existing_attachments when creating a post.

urlstring

Preview URL of the uploaded file.

Changes

No recorded changes to this operation across all 1 revision of this API.