curl --request POST \
--url https://api.us.cr4ce.com/chapter/{chapter_slug}/upload \
--header 'Accept: <accept>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"filename": "logo.png",
"data": "aGVsbG8gd29ybGQ="
}
'import requests
url = "https://api.us.cr4ce.com/chapter/{chapter_slug}/upload"
payload = {
"filename": "logo.png",
"data": "aGVsbG8gd29ybGQ="
}
headers = {
"Accept": "<accept>",
"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: {
Accept: '<accept>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({filename: 'logo.png', data: 'aGVsbG8gd29ybGQ='})
};
fetch('https://api.us.cr4ce.com/chapter/{chapter_slug}/upload', 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.us.cr4ce.com/chapter/{chapter_slug}/upload",
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([
'filename' => 'logo.png',
'data' => 'aGVsbG8gd29ybGQ='
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"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.us.cr4ce.com/chapter/{chapter_slug}/upload"
payload := strings.NewReader("{\n \"filename\": \"logo.png\",\n \"data\": \"aGVsbG8gd29ybGQ=\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "<accept>")
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.us.cr4ce.com/chapter/{chapter_slug}/upload")
.header("Accept", "<accept>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"logo.png\",\n \"data\": \"aGVsbG8gd29ybGQ=\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.cr4ce.com/chapter/{chapter_slug}/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = '<accept>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"logo.png\",\n \"data\": \"aGVsbG8gd29ybGQ=\"\n}"
response = http.request(request)
puts response.read_body{
"filename": "example.pdf",
"token": "AbCdEfGhIjKlMnOp",
"link": "https://api.au.cr4ce.com/file/AbCdEfGhIjKlMnOp"
}{
"message": "<string>",
"status_code": 400
}{
"message": "<string>",
"status_code": 401
}{
"message": "<string>",
"status_code": 403
}{
"message": "<string>",
"status_code": 404
}{
"message": "<string>",
"status_code": 422,
"errors": {}
}{
"message": "<string>",
"status_code": 429
}{
"status": "Maintenance in progress"
}Upload chapter file
Upload a file for the chapter identified by the specified slug.
curl --request POST \
--url https://api.us.cr4ce.com/chapter/{chapter_slug}/upload \
--header 'Accept: <accept>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"filename": "logo.png",
"data": "aGVsbG8gd29ybGQ="
}
'import requests
url = "https://api.us.cr4ce.com/chapter/{chapter_slug}/upload"
payload = {
"filename": "logo.png",
"data": "aGVsbG8gd29ybGQ="
}
headers = {
"Accept": "<accept>",
"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: {
Accept: '<accept>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({filename: 'logo.png', data: 'aGVsbG8gd29ybGQ='})
};
fetch('https://api.us.cr4ce.com/chapter/{chapter_slug}/upload', 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.us.cr4ce.com/chapter/{chapter_slug}/upload",
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([
'filename' => 'logo.png',
'data' => 'aGVsbG8gd29ybGQ='
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"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.us.cr4ce.com/chapter/{chapter_slug}/upload"
payload := strings.NewReader("{\n \"filename\": \"logo.png\",\n \"data\": \"aGVsbG8gd29ybGQ=\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "<accept>")
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.us.cr4ce.com/chapter/{chapter_slug}/upload")
.header("Accept", "<accept>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"logo.png\",\n \"data\": \"aGVsbG8gd29ybGQ=\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.cr4ce.com/chapter/{chapter_slug}/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = '<accept>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"logo.png\",\n \"data\": \"aGVsbG8gd29ybGQ=\"\n}"
response = http.request(request)
puts response.read_body{
"filename": "example.pdf",
"token": "AbCdEfGhIjKlMnOp",
"link": "https://api.au.cr4ce.com/file/AbCdEfGhIjKlMnOp"
}{
"message": "<string>",
"status_code": 400
}{
"message": "<string>",
"status_code": 401
}{
"message": "<string>",
"status_code": 403
}{
"message": "<string>",
"status_code": 404
}{
"message": "<string>",
"status_code": 422,
"errors": {}
}{
"message": "<string>",
"status_code": 429
}{
"status": "Maintenance in progress"
}GET on the returned Location immediately after the 201 may briefly return a response with a null body until processing is complete.Authorizations
API key used to authenticate and authorise every request.
Include it in the x-api-key header.
Headers
Defines the response type.
application/vnd.Creative Force.v2.3+json, application/vnd.Creative Force.v2.3+xml Path Parameters
Slug of the chapter.
^[A-Za-z]{8}$Body
Image payload for the chapter upload.
filename and data are required.
Original filename of the uploaded file, including the extension.
Base64-encoded contents of the image file.
The encoded payload must round-trip cleanly through standard base64 decoding; payloads with stray characters, incorrect padding, or other malformed encoding are rejected.
Only image files are accepted: gif, jpeg, jpg, png, tif, tiff, ico, webp, and avif. The file size must not exceed the maximum file size for the account.
Response
Chapter file uploaded.
Receipt returned when a file is uploaded to a category, chapter, entry, or user field.