Read brand colours from a website
curl --request POST \
--url https://hiimpria.ai/api/user/appearance/brand-import \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"url": "example.com"
}
'import requests
url = "https://hiimpria.ai/api/user/appearance/brand-import"
payload = { "url": "example.com" }
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'example.com'})
};
fetch('https://hiimpria.ai/api/user/appearance/brand-import', 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://hiimpria.ai/api/user/appearance/brand-import",
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([
'url' => 'example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <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://hiimpria.ai/api/user/appearance/brand-import"
payload := strings.NewReader("{\n \"url\": \"example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<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://hiimpria.ai/api/user/appearance/brand-import")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hiimpria.ai/api/user/appearance/brand-import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"example.com\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"siteUrl": "<string>",
"name": "<string>",
"logo": "<string>",
"themeColor": "<string>",
"background": "<string>",
"palette": [
{
"hex": "#1a73e8",
"weight": 123,
"sources": [
"theme-color"
]
}
]
}
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}User
Read brand colours from a website
Reads a public website (its page, up to 3 of its own stylesheets and its web manifest) and answers its brand colours, name and logo address, for the Appearance settings to build a theme from. Nothing is saved. Only public addresses are read; the whole read is limited in size and time. Limited to 5 requests a minute per user. A session opened from a course page must first confirm it is the person (403 LAUNCH_SCOPE_STEP_UP).
POST
/
api
/
user
/
appearance
/
brand-import
Read brand colours from a website
curl --request POST \
--url https://hiimpria.ai/api/user/appearance/brand-import \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"url": "example.com"
}
'import requests
url = "https://hiimpria.ai/api/user/appearance/brand-import"
payload = { "url": "example.com" }
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'example.com'})
};
fetch('https://hiimpria.ai/api/user/appearance/brand-import', 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://hiimpria.ai/api/user/appearance/brand-import",
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([
'url' => 'example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <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://hiimpria.ai/api/user/appearance/brand-import"
payload := strings.NewReader("{\n \"url\": \"example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<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://hiimpria.ai/api/user/appearance/brand-import")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hiimpria.ai/api/user/appearance/brand-import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"example.com\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"siteUrl": "<string>",
"name": "<string>",
"logo": "<string>",
"themeColor": "<string>",
"background": "<string>",
"palette": [
{
"hex": "#1a73e8",
"weight": 123,
"sources": [
"theme-color"
]
}
]
}
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}Body
application/json
A public website address. A bare domain (example.com) is read as https://example.com.
Maximum string length:
2048Example:
"example.com"
Was this page helpful?