Theme widgets
Create an immutable widget share link
Snapshots the selected widget, its supplied current local files, assets, auxiliary templates and translations. Supports a newly authored local widget. The opaque link can be used by administrators in other companies; recipients receive metadata until they choose an authorized destination theme and import a copy. Later source edits do not change this snapshot. Requires source theme update permission. The token is returned once and remains available until revoked. Every response is private and must not be cached.
POST
/
api
/
v202604
/
themes
/
{theme_id}
/
widget-shares
Create an immutable widget share link
curl --request POST \
--url https://api.fluid.app/api/v202604/themes/{theme_id}/widget-shares \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"widget_name": "shared-card",
"files": [
{
"path": "widgets/shared-card/index.liquid",
"encoding": "utf8",
"content": "<p>Hello</p>{% schema %}{\"name\":\"Shared card\",\"settings\":[]}{% endschema %}"
}
]
}
'import requests
url = "https://api.fluid.app/api/v202604/themes/{theme_id}/widget-shares"
payload = {
"widget_name": "shared-card",
"files": [
{
"path": "widgets/shared-card/index.liquid",
"encoding": "utf8",
"content": "<p>Hello</p>{% schema %}{\"name\":\"Shared card\",\"settings\":[]}{% endschema %}"
}
]
}
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({
widget_name: 'shared-card',
files: [
{
path: 'widgets/shared-card/index.liquid',
encoding: 'utf8',
content: '<p>Hello</p>{% schema %}{"name":"Shared card","settings":[]}{% endschema %}'
}
]
})
};
fetch('https://api.fluid.app/api/v202604/themes/{theme_id}/widget-shares', 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.fluid.app/api/v202604/themes/{theme_id}/widget-shares",
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([
'widget_name' => 'shared-card',
'files' => [
[
'path' => 'widgets/shared-card/index.liquid',
'encoding' => 'utf8',
'content' => '<p>Hello</p>{% schema %}{"name":"Shared card","settings":[]}{% endschema %}'
]
]
]),
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://api.fluid.app/api/v202604/themes/{theme_id}/widget-shares"
payload := strings.NewReader("{\n \"widget_name\": \"shared-card\",\n \"files\": [\n {\n \"path\": \"widgets/shared-card/index.liquid\",\n \"encoding\": \"utf8\",\n \"content\": \"<p>Hello</p>{% schema %}{\\\"name\\\":\\\"Shared card\\\",\\\"settings\\\":[]}{% endschema %}\"\n }\n ]\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("https://api.fluid.app/api/v202604/themes/{theme_id}/widget-shares")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"widget_name\": \"shared-card\",\n \"files\": [\n {\n \"path\": \"widgets/shared-card/index.liquid\",\n \"encoding\": \"utf8\",\n \"content\": \"<p>Hello</p>{% schema %}{\\\"name\\\":\\\"Shared card\\\",\\\"settings\\\":[]}{% endschema %}\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/v202604/themes/{theme_id}/widget-shares")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"widget_name\": \"shared-card\",\n \"files\": [\n {\n \"path\": \"widgets/shared-card/index.liquid\",\n \"encoding\": \"utf8\",\n \"content\": \"<p>Hello</p>{% schema %}{\\\"name\\\":\\\"Shared card\\\",\\\"settings\\\":[]}{% endschema %}\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"share": {
"id": 481,
"url": "https://admin.fluid.app/widgets/shared/7a6b3d1e9c024f58b7e3a19d0f6c8b253e914a7c2d580f6b1e39c47d82a05f61",
"name": "care-card",
"summary": "Reusable theme widget with its templates, assets and translations."
},
"status": 201,
"meta": {}
}{
"message": "<string>",
"error": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"error": {
"message": "<string>",
"details": {}
},
"status": 123,
"meta": {}
}{
"error": {
"message": "<string>",
"details": {}
},
"status": 123,
"meta": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Authorized source theme.
Body
application/json
⌘I
Create an immutable widget share link
curl --request POST \
--url https://api.fluid.app/api/v202604/themes/{theme_id}/widget-shares \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"widget_name": "shared-card",
"files": [
{
"path": "widgets/shared-card/index.liquid",
"encoding": "utf8",
"content": "<p>Hello</p>{% schema %}{\"name\":\"Shared card\",\"settings\":[]}{% endschema %}"
}
]
}
'import requests
url = "https://api.fluid.app/api/v202604/themes/{theme_id}/widget-shares"
payload = {
"widget_name": "shared-card",
"files": [
{
"path": "widgets/shared-card/index.liquid",
"encoding": "utf8",
"content": "<p>Hello</p>{% schema %}{\"name\":\"Shared card\",\"settings\":[]}{% endschema %}"
}
]
}
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({
widget_name: 'shared-card',
files: [
{
path: 'widgets/shared-card/index.liquid',
encoding: 'utf8',
content: '<p>Hello</p>{% schema %}{"name":"Shared card","settings":[]}{% endschema %}'
}
]
})
};
fetch('https://api.fluid.app/api/v202604/themes/{theme_id}/widget-shares', 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.fluid.app/api/v202604/themes/{theme_id}/widget-shares",
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([
'widget_name' => 'shared-card',
'files' => [
[
'path' => 'widgets/shared-card/index.liquid',
'encoding' => 'utf8',
'content' => '<p>Hello</p>{% schema %}{"name":"Shared card","settings":[]}{% endschema %}'
]
]
]),
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://api.fluid.app/api/v202604/themes/{theme_id}/widget-shares"
payload := strings.NewReader("{\n \"widget_name\": \"shared-card\",\n \"files\": [\n {\n \"path\": \"widgets/shared-card/index.liquid\",\n \"encoding\": \"utf8\",\n \"content\": \"<p>Hello</p>{% schema %}{\\\"name\\\":\\\"Shared card\\\",\\\"settings\\\":[]}{% endschema %}\"\n }\n ]\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("https://api.fluid.app/api/v202604/themes/{theme_id}/widget-shares")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"widget_name\": \"shared-card\",\n \"files\": [\n {\n \"path\": \"widgets/shared-card/index.liquid\",\n \"encoding\": \"utf8\",\n \"content\": \"<p>Hello</p>{% schema %}{\\\"name\\\":\\\"Shared card\\\",\\\"settings\\\":[]}{% endschema %}\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/v202604/themes/{theme_id}/widget-shares")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"widget_name\": \"shared-card\",\n \"files\": [\n {\n \"path\": \"widgets/shared-card/index.liquid\",\n \"encoding\": \"utf8\",\n \"content\": \"<p>Hello</p>{% schema %}{\\\"name\\\":\\\"Shared card\\\",\\\"settings\\\":[]}{% endschema %}\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"share": {
"id": 481,
"url": "https://admin.fluid.app/widgets/shared/7a6b3d1e9c024f58b7e3a19d0f6c8b253e914a7c2d580f6b1e39c47d82a05f61",
"name": "care-card",
"summary": "Reusable theme widget with its templates, assets and translations."
},
"status": 201,
"meta": {}
}{
"message": "<string>",
"error": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"error": {
"message": "<string>",
"details": {}
},
"status": 123,
"meta": {}
}{
"error": {
"message": "<string>",
"details": {}
},
"status": 123,
"meta": {}
}