Skip to main content
POST
/
channel-api
/
v1.0
/
upload-url
Request a presigned upload URL for artwork
curl --request POST \
  --url https://api.fourthwall.com/channel-api/v1.0/upload-url \
  --header 'Content-Type: application/json' \
  --data '
{
  "contentType": "<string>",
  "fileName": "<string>",
  "size": 123
}
'
import requests

url = "https://api.fourthwall.com/channel-api/v1.0/upload-url"

payload = {
"contentType": "<string>",
"fileName": "<string>",
"size": 123
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({contentType: '<string>', fileName: '<string>', size: 123})
};

fetch('https://api.fourthwall.com/channel-api/v1.0/upload-url', 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.fourthwall.com/channel-api/v1.0/upload-url",
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([
'contentType' => '<string>',
'fileName' => '<string>',
'size' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$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.fourthwall.com/channel-api/v1.0/upload-url"

payload := strings.NewReader("{\n \"contentType\": \"<string>\",\n \"fileName\": \"<string>\",\n \"size\": 123\n}")

req, _ := http.NewRequest("POST", url, payload)

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.fourthwall.com/channel-api/v1.0/upload-url")
.header("Content-Type", "application/json")
.body("{\n \"contentType\": \"<string>\",\n \"fileName\": \"<string>\",\n \"size\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.fourthwall.com/channel-api/v1.0/upload-url")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"contentType\": \"<string>\",\n \"fileName\": \"<string>\",\n \"size\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "uploadUrl": "<string>",
  "fileUrl": "<string>"
}
This endpoint is in beta and subject to change.
When you PUT the bytes to uploadUrl, you must send two headers that are baked into the URL’s signature — omit or mismatch either and Google Cloud Storage rejects the upload with 403 SignatureDoesNotMatch:
  • Content-Type — must equal the contentType you sent in this request.
  • x-goog-content-length-range: 0,<size> — must use the same size (in bytes) you sent in this request.
The PUT goes directly to Google Cloud Storage, not Fourthwall — don’t send your Fourthwall credentials with it, and note the URL is short-lived.

Body

application/json
contentType
string
required

MIME type of the file.

fileName
string
required

Name of the file.

size
integer<int64>
required

Size of the file in bytes. Must match the x-goog-content-length-range header sent when uploading the bytes to uploadUrl.

Response

200 - application/json

OK

uploadUrl
string
required
fileUrl
string
required