Media
Upload media first, then attach it to a post using the id and path
returned.
Upload a file
Section titled “Upload a file”POST /public/v1/uploadSend the file as multipart/form-data in a field named file:
curl https://app.beeive.com/public/v1/upload \ -X POST \ -H "Authorization: YOUR_API_KEY" \ -F "file=@./photo.jpg"The response includes the new media’s id and path:
{ "id": "clx5m6n7o0001", "name": "photo.jpg", "path": "https://..."}Upload from a URL
Section titled “Upload from a URL”POST /public/v1/upload-from-urlBeeive downloads the file from a public URL and saves it to your media library.
curl https://app.beeive.com/public/v1/upload-from-url \ -X POST \ -H "Authorization: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/photo.jpg" }'The response has the same id and path as a file upload. If Beeive can’t
download the file, you get 400 Failed to fetch URL.
Use media in a post
Section titled “Use media in a post”Pass the id and path in the post’s image array:
"value": [ { "content": "Look at this!", "image": [{ "id": "clx5m6n7o0001", "path": "https://..." }] }]See Create a post.