Projets
Mettre à jour la configuration
Mettez à jour la configuration d’un projet et les tokens de son système de design partagé.
PUT
/
projects
/
{slug}
/
config
Update project configuration
curl --request PUT \
--url https://faces.app/api/v1/projects/{slug}/config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"config": {
"cardsSlidesPerView": 1.25,
"cardsBackgroundColor": "<string>",
"cardsBackgroundImage": "<string>",
"tokens": {
"palette": [],
"fonts": []
}
}
}
'import requests
url = "https://faces.app/api/v1/projects/{slug}/config"
payload = { "config": {
"cardsSlidesPerView": 1.25,
"cardsBackgroundColor": "<string>",
"cardsBackgroundImage": "<string>",
"tokens": {
"palette": [],
"fonts": []
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
config: {
cardsSlidesPerView: 1.25,
cardsBackgroundColor: '<string>',
cardsBackgroundImage: '<string>',
tokens: {palette: [], fonts: []}
}
})
};
fetch('https://faces.app/api/v1/projects/{slug}/config', 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://faces.app/api/v1/projects/{slug}/config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'config' => [
'cardsSlidesPerView' => 1.25,
'cardsBackgroundColor' => '<string>',
'cardsBackgroundImage' => '<string>',
'tokens' => [
'palette' => [
],
'fonts' => [
]
]
]
]),
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 := "https://faces.app/api/v1/projects/{slug}/config"
payload := strings.NewReader("{\n \"config\": {\n \"cardsSlidesPerView\": 1.25,\n \"cardsBackgroundColor\": \"<string>\",\n \"cardsBackgroundImage\": \"<string>\",\n \"tokens\": {\n \"palette\": [],\n \"fonts\": []\n }\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://faces.app/api/v1/projects/{slug}/config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"config\": {\n \"cardsSlidesPerView\": 1.25,\n \"cardsBackgroundColor\": \"<string>\",\n \"cardsBackgroundImage\": \"<string>\",\n \"tokens\": {\n \"palette\": [],\n \"fonts\": []\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://faces.app/api/v1/projects/{slug}/config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"config\": {\n \"cardsSlidesPerView\": 1.25,\n \"cardsBackgroundColor\": \"<string>\",\n \"cardsBackgroundImage\": \"<string>\",\n \"tokens\": {\n \"palette\": [],\n \"fonts\": []\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"versionId": "<string>",
"config": {
"cardsSlidesPerView": 1.25,
"cardsBackgroundColor": "<string>",
"cardsBackgroundImage": "<string>",
"theme": {
"fontFamily": "<string>",
"radius": "<string>",
"colors": {
"default": {
"background": "<string>",
"foreground": "<string>",
"card": "<string>",
"card-foreground": "<string>",
"primary": "<string>",
"primary-foreground": "<string>",
"secondary": "<string>",
"secondary-foreground": "<string>",
"muted": "<string>",
"muted-foreground": "<string>",
"accent": "<string>",
"accent-foreground": "<string>",
"destructive": "<string>",
"destructive-foreground": "<string>",
"border": "<string>",
"input": "<string>",
"card-border": "<string>",
"chart-1": "<string>",
"chart-2": "<string>",
"chart-3": "<string>",
"chart-4": "<string>",
"chart-5": "<string>"
},
"dark": {
"background": "<string>",
"foreground": "<string>",
"card": "<string>",
"card-foreground": "<string>",
"primary": "<string>",
"primary-foreground": "<string>",
"secondary": "<string>",
"secondary-foreground": "<string>",
"muted": "<string>",
"muted-foreground": "<string>",
"accent": "<string>",
"accent-foreground": "<string>",
"destructive": "<string>",
"destructive-foreground": "<string>",
"border": "<string>",
"input": "<string>",
"card-border": "<string>",
"chart-1": "<string>",
"chart-2": "<string>",
"chart-3": "<string>",
"chart-4": "<string>",
"chart-5": "<string>"
}
},
"headingFontFamily": "<string>"
},
"tokens": {
"palette": [],
"fonts": []
}
}
}{
"error": "<string>",
"hint": "<string>"
}{
"error": "<string>",
"hint": "<string>"
}Autorisations
API key with "faces_" prefix. Create one at Settings > Developers.
Paramètres de chemin
Corps
application/json
Partial project config to merge into the existing file.
Show child attributes
Show child attributes
⌘I
Update project configuration
curl --request PUT \
--url https://faces.app/api/v1/projects/{slug}/config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"config": {
"cardsSlidesPerView": 1.25,
"cardsBackgroundColor": "<string>",
"cardsBackgroundImage": "<string>",
"tokens": {
"palette": [],
"fonts": []
}
}
}
'import requests
url = "https://faces.app/api/v1/projects/{slug}/config"
payload = { "config": {
"cardsSlidesPerView": 1.25,
"cardsBackgroundColor": "<string>",
"cardsBackgroundImage": "<string>",
"tokens": {
"palette": [],
"fonts": []
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
config: {
cardsSlidesPerView: 1.25,
cardsBackgroundColor: '<string>',
cardsBackgroundImage: '<string>',
tokens: {palette: [], fonts: []}
}
})
};
fetch('https://faces.app/api/v1/projects/{slug}/config', 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://faces.app/api/v1/projects/{slug}/config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'config' => [
'cardsSlidesPerView' => 1.25,
'cardsBackgroundColor' => '<string>',
'cardsBackgroundImage' => '<string>',
'tokens' => [
'palette' => [
],
'fonts' => [
]
]
]
]),
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 := "https://faces.app/api/v1/projects/{slug}/config"
payload := strings.NewReader("{\n \"config\": {\n \"cardsSlidesPerView\": 1.25,\n \"cardsBackgroundColor\": \"<string>\",\n \"cardsBackgroundImage\": \"<string>\",\n \"tokens\": {\n \"palette\": [],\n \"fonts\": []\n }\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://faces.app/api/v1/projects/{slug}/config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"config\": {\n \"cardsSlidesPerView\": 1.25,\n \"cardsBackgroundColor\": \"<string>\",\n \"cardsBackgroundImage\": \"<string>\",\n \"tokens\": {\n \"palette\": [],\n \"fonts\": []\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://faces.app/api/v1/projects/{slug}/config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"config\": {\n \"cardsSlidesPerView\": 1.25,\n \"cardsBackgroundColor\": \"<string>\",\n \"cardsBackgroundImage\": \"<string>\",\n \"tokens\": {\n \"palette\": [],\n \"fonts\": []\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"versionId": "<string>",
"config": {
"cardsSlidesPerView": 1.25,
"cardsBackgroundColor": "<string>",
"cardsBackgroundImage": "<string>",
"theme": {
"fontFamily": "<string>",
"radius": "<string>",
"colors": {
"default": {
"background": "<string>",
"foreground": "<string>",
"card": "<string>",
"card-foreground": "<string>",
"primary": "<string>",
"primary-foreground": "<string>",
"secondary": "<string>",
"secondary-foreground": "<string>",
"muted": "<string>",
"muted-foreground": "<string>",
"accent": "<string>",
"accent-foreground": "<string>",
"destructive": "<string>",
"destructive-foreground": "<string>",
"border": "<string>",
"input": "<string>",
"card-border": "<string>",
"chart-1": "<string>",
"chart-2": "<string>",
"chart-3": "<string>",
"chart-4": "<string>",
"chart-5": "<string>"
},
"dark": {
"background": "<string>",
"foreground": "<string>",
"card": "<string>",
"card-foreground": "<string>",
"primary": "<string>",
"primary-foreground": "<string>",
"secondary": "<string>",
"secondary-foreground": "<string>",
"muted": "<string>",
"muted-foreground": "<string>",
"accent": "<string>",
"accent-foreground": "<string>",
"destructive": "<string>",
"destructive-foreground": "<string>",
"border": "<string>",
"input": "<string>",
"card-border": "<string>",
"chart-1": "<string>",
"chart-2": "<string>",
"chart-3": "<string>",
"chart-4": "<string>",
"chart-5": "<string>"
}
},
"headingFontFamily": "<string>"
},
"tokens": {
"palette": [],
"fonts": []
}
}
}{
"error": "<string>",
"hint": "<string>"
}{
"error": "<string>",
"hint": "<string>"
}