List Backgrounds or Foregrounds
curl --request GET \
--url https://api.simli.ai/assets/{kind} \
--header 'x-simli-api-key: <api-key>'import requests
url = "https://api.simli.ai/assets/{kind}"
headers = {"x-simli-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-simli-api-key': '<api-key>'}};
fetch('https://api.simli.ai/assets/{kind}', 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.simli.ai/assets/{kind}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-simli-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"
"net/http"
"io"
)
func main() {
url := "https://api.simli.ai/assets/{kind}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-simli-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.simli.ai/assets/{kind}")
.header("x-simli-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.simli.ai/assets/{kind}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-simli-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"width": 123,
"height": 123,
"size_bytes": 123,
"created_at": 123,
"url": "<string>",
"url_expires_at": 123
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}API Reference
List Backgrounds or Foregrounds
Your uploaded backgrounds or foregrounds, newest first, each with a signed URL that reads the image (a PNG) until url_expires_at, an hour on. Anyone holding the URL can read that one image until then, so keep it to your own app. List again for fresh URLs.
GET
/
assets
/
{kind}
List Backgrounds or Foregrounds
curl --request GET \
--url https://api.simli.ai/assets/{kind} \
--header 'x-simli-api-key: <api-key>'import requests
url = "https://api.simli.ai/assets/{kind}"
headers = {"x-simli-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-simli-api-key': '<api-key>'}};
fetch('https://api.simli.ai/assets/{kind}', 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.simli.ai/assets/{kind}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-simli-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"
"net/http"
"io"
)
func main() {
url := "https://api.simli.ai/assets/{kind}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-simli-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.simli.ai/assets/{kind}")
.header("x-simli-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.simli.ai/assets/{kind}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-simli-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"width": 123,
"height": 123,
"size_bytes": 123,
"created_at": 123,
"url": "<string>",
"url_expires_at": 123
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Available options:
backgrounds, foregrounds Response
Successful Response
What background_id / foreground_id and BG_ / FG_ take.
The uploaded file's name.
The stored PNG's size.
Unix time, in seconds.
A signed URL that GETs the image until url_expires_at; usable as an [Image blocked: No description] src. Null if one couldn't be made just then.
Unix time, in seconds, when url stops working.