Preview a proposed change
curl --request POST \
--url http://localhost:3000/api/v1/brands/{slug}/previews \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ref": "<string>",
"files": {},
"title": "<string>",
"commit": "<string>",
"assets": {}
}
'import requests
url = "http://localhost:3000/api/v1/brands/{slug}/previews"
payload = {
"ref": "<string>",
"files": {},
"title": "<string>",
"commit": "<string>",
"assets": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ref: '<string>', files: {}, title: '<string>', commit: '<string>', assets: {}})
};
fetch('http://localhost:3000/api/v1/brands/{slug}/previews', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/brands/{slug}/previews",
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([
'ref' => '<string>',
'files' => [
],
'title' => '<string>',
'commit' => '<string>',
'assets' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "http://localhost:3000/api/v1/brands/{slug}/previews"
payload := strings.NewReader("{\n \"ref\": \"<string>\",\n \"files\": {},\n \"title\": \"<string>\",\n \"commit\": \"<string>\",\n \"assets\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("http://localhost:3000/api/v1/brands/{slug}/previews")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ref\": \"<string>\",\n \"files\": {},\n \"title\": \"<string>\",\n \"commit\": \"<string>\",\n \"assets\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/brands/{slug}/previews")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ref\": \"<string>\",\n \"files\": {},\n \"title\": \"<string>\",\n \"commit\": \"<string>\",\n \"assets\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"brand": "<string>",
"ref": "<string>",
"url": "<string>",
"pages": [
{
"slug": "<string>",
"title": "<string>",
"url": "<string>"
}
],
"expiresAt": "2023-11-07T05:31:56Z",
"diff": {
"name": {
"before": "<string>",
"after": "<string>"
},
"rules": [
{
"change": "added",
"key": "<string>",
"context": "<string>",
"type": "color",
"before": "<unknown>",
"after": "<unknown>",
"fields": [
"<string>"
]
}
],
"pages": [
{
"change": "added",
"slug": "<string>",
"title": "<string>"
}
],
"theme": [
"<string>"
],
"reordered": true
},
"warnings": [
{
"file": "<string>",
"message": "<string>",
"line": 0
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"detail": "<unknown>"
}
}API Reference
Preview a proposed change
A pull request’s files as the brand’s site, at a link that needs no account, and what they would change of the brand as it stands. Checked as an import is. One preview per ref: saving again keeps its link. It opens for 30 days after its last save.
Scope: write.
POST
/
api
/
v1
/
brands
/
{slug}
/
previews
Preview a proposed change
curl --request POST \
--url http://localhost:3000/api/v1/brands/{slug}/previews \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ref": "<string>",
"files": {},
"title": "<string>",
"commit": "<string>",
"assets": {}
}
'import requests
url = "http://localhost:3000/api/v1/brands/{slug}/previews"
payload = {
"ref": "<string>",
"files": {},
"title": "<string>",
"commit": "<string>",
"assets": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ref: '<string>', files: {}, title: '<string>', commit: '<string>', assets: {}})
};
fetch('http://localhost:3000/api/v1/brands/{slug}/previews', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/brands/{slug}/previews",
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([
'ref' => '<string>',
'files' => [
],
'title' => '<string>',
'commit' => '<string>',
'assets' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "http://localhost:3000/api/v1/brands/{slug}/previews"
payload := strings.NewReader("{\n \"ref\": \"<string>\",\n \"files\": {},\n \"title\": \"<string>\",\n \"commit\": \"<string>\",\n \"assets\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("http://localhost:3000/api/v1/brands/{slug}/previews")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ref\": \"<string>\",\n \"files\": {},\n \"title\": \"<string>\",\n \"commit\": \"<string>\",\n \"assets\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/brands/{slug}/previews")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ref\": \"<string>\",\n \"files\": {},\n \"title\": \"<string>\",\n \"commit\": \"<string>\",\n \"assets\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"brand": "<string>",
"ref": "<string>",
"url": "<string>",
"pages": [
{
"slug": "<string>",
"title": "<string>",
"url": "<string>"
}
],
"expiresAt": "2023-11-07T05:31:56Z",
"diff": {
"name": {
"before": "<string>",
"after": "<string>"
},
"rules": [
{
"change": "added",
"key": "<string>",
"context": "<string>",
"type": "color",
"before": "<unknown>",
"after": "<unknown>",
"fields": [
"<string>"
]
}
],
"pages": [
{
"change": "added",
"slug": "<string>",
"title": "<string>"
}
],
"theme": [
"<string>"
],
"reordered": true
},
"warnings": [
{
"file": "<string>",
"message": "<string>",
"line": 0
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"detail": "<unknown>"
}
}Authorizations
bearersession
An API key: ab_...
Path Parameters
Brand slug
Body
application/json
What proposes it, as its host names it: pull/12. One preview each; saving again updates it
Required string length:
1 - 200The brand's files by path in its folder: brand.yaml, rules/.yaml, pages/.yaml. Others are left alone
Show child attributes
Show child attributes
Maximum string length:
300Required string length:
1 - 100The files under assets/ the brand's files point at: path to asset id, or to the SHA-256 of its bytes (upload first)
Show child attributes
Show child attributes
Response
The preview
Show child attributes
Show child attributes