curl --request POST \
--url https://api.so-me.studio/v1/posts/presign-media \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"files": [
{
"filename": "<string>",
"mimetype": "<string>",
"size": 123,
"duration": 43200.05
}
]
}
'import requests
url = "https://api.so-me.studio/v1/posts/presign-media"
payload = { "files": [
{
"filename": "<string>",
"mimetype": "<string>",
"size": 123,
"duration": 43200.05
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
files: [{filename: '<string>', mimetype: '<string>', size: 123, duration: 43200.05}]
})
};
fetch('https://api.so-me.studio/v1/posts/presign-media', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.so-me.studio/v1/posts/presign-media",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'files' => [
[
'filename' => '<string>',
'mimetype' => '<string>',
'size' => 123,
'duration' => 43200.05
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.so-me.studio/v1/posts/presign-media"
payload := strings.NewReader("{\n \"files\": [\n {\n \"filename\": \"<string>\",\n \"mimetype\": \"<string>\",\n \"size\": 123,\n \"duration\": 43200.05\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.so-me.studio/v1/posts/presign-media")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"files\": [\n {\n \"filename\": \"<string>\",\n \"mimetype\": \"<string>\",\n \"size\": 123,\n \"duration\": 43200.05\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.so-me.studio/v1/posts/presign-media")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"files\": [\n {\n \"filename\": \"<string>\",\n \"mimetype\": \"<string>\",\n \"size\": 123,\n \"duration\": 43200.05\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"fileId": "<string>",
"uploadUrl": "<string>",
"s3Prefix": "<string>",
"fileSrc": "<string>"
}
]Generar URLs de subida prefirmadas para archivos multimedia
Devuelve URLs prefirmadas de S3 para cada archivo. Sube cada archivo con un HTTP PUT a su uploadUrl, con una cabecera Content-Type igual al mimetype que declaraste para ese archivo (por ejemplo Content-Type: image/jpeg). La URL está firmada con esa cabecera, así que un PUT sin ella, o con otro valor, falla con 403 SignatureDoesNotMatch. Después pasa los valores s3Prefix y fileSrc devueltos en la solicitud de creación de la publicación. Los tipos HTML, SVG, XML, script y desconocidos se rechazan con 400.
curl --request POST \
--url https://api.so-me.studio/v1/posts/presign-media \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"files": [
{
"filename": "<string>",
"mimetype": "<string>",
"size": 123,
"duration": 43200.05
}
]
}
'import requests
url = "https://api.so-me.studio/v1/posts/presign-media"
payload = { "files": [
{
"filename": "<string>",
"mimetype": "<string>",
"size": 123,
"duration": 43200.05
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
files: [{filename: '<string>', mimetype: '<string>', size: 123, duration: 43200.05}]
})
};
fetch('https://api.so-me.studio/v1/posts/presign-media', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.so-me.studio/v1/posts/presign-media",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'files' => [
[
'filename' => '<string>',
'mimetype' => '<string>',
'size' => 123,
'duration' => 43200.05
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.so-me.studio/v1/posts/presign-media"
payload := strings.NewReader("{\n \"files\": [\n {\n \"filename\": \"<string>\",\n \"mimetype\": \"<string>\",\n \"size\": 123,\n \"duration\": 43200.05\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.so-me.studio/v1/posts/presign-media")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"files\": [\n {\n \"filename\": \"<string>\",\n \"mimetype\": \"<string>\",\n \"size\": 123,\n \"duration\": 43200.05\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.so-me.studio/v1/posts/presign-media")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"files\": [\n {\n \"filename\": \"<string>\",\n \"mimetype\": \"<string>\",\n \"size\": 123,\n \"duration\": 43200.05\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"fileId": "<string>",
"uploadUrl": "<string>",
"s3Prefix": "<string>",
"fileSrc": "<string>"
}
]Autorizaciones
Cuerpo
Tipo de publicación al que corresponde el contenido multimedia
TEXT, IMAGE, MULTIPLE_IMAGES, VIDEO, CAROUSEL, REEL, STORY Plataforma de destino
TWITTER, INSTAGRAM, LINKEDIN, LINKEDIN_PAGE, FACEBOOK, TIKTOK, YOUTUBE, THREADS, WHATSAPP Archivos para los que se generarán URLs de subida
Show child attributes
Show child attributes
Respuesta
URLs prefirmadas generadas
UUID del registro del archivo
URL de PUT prefirmada (caduca en 1 hora). Envía el archivo con un Content-Type igual al mimetype declarado.
Clave del objeto en S3: pásala al crear la publicación
URL pública de la CDN: pásala al crear la publicación