Get Resolved Content
curl --request GET \
--url https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/resolvedimport requests
url = "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/resolved"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/resolved', 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.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/resolved",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/resolved"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/resolved")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/resolved")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"content": "<string>",
"package": {
"version": "<string>",
"components": {},
"assets": {}
},
"dependencies": {}
}Content
Get Resolved Content
Get content with all dependencies resolved and ready for rendering
GET
/
app
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
content
/
{id}
/
resolved
Get Resolved Content
curl --request GET \
--url https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/resolvedimport requests
url = "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/resolved"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/resolved', 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.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/resolved",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/resolved"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/resolved")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/resolved")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"content": "<string>",
"package": {
"version": "<string>",
"components": {},
"assets": {}
},
"dependencies": {}
}Retrieves everything needed to render a content item, including its compiled code, assets, and all resolved package dependencies. This is the format used by client SDKs to render content.
Path Parameters
string
required
Organization ID
string
required
Project ID
string
required
Content ID
Response
string
The compiled BindJS code for this content, ready for execution
object
object
Map of dependency identifiers to their resolved content
Example Response
{
"content": "const body = () => { const props = {title: 'Getting Started', subtitle: 'Your complete guide', heroImage: 'asset124', author: 'Jane Doe', components: [...]}; return ArticleLayout(props); }",
"package": {
"version": "1.0.0",
"components": {
"ArticleLayout": "const body = (props, children) => { return VStack([Header(props), ...children]); }",
"ArticleParagraph": "const body = (props) => { return Text(props.text); }",
"ArticleHeading": "const body = (props) => { return Text(props.text).font(.headline); }",
"ArticleImage": "const body = (props) => { return Image(props.image); }"
},
"assets": {
"ArticleLayout": [
{ "name": "hero-image", "url": "https://cdn.metabind.ai/assets/hero-image.jpg" }
],
"ArticleImage": [
{ "name": "dashboard-screenshot", "url": "https://cdn.metabind.ai/assets/dashboard.png" }
]
}
},
"dependencies": {
"shared-ui@2.0.0": {
"components": {
"Button": "const body = (props, children) => { ... }",
"Card": "const body = (props, children) => { ... }"
},
"assets": {}
}
}
}
Use Cases
Mobile SDK Integration
The resolved format is optimized for client SDKs:// iOS Swift example
let resolved = try await metabind.getResolvedContent(id: "cont123")
// Execute content code
let contentCode = resolved.content
// Access package components
let articleLayout = resolved.package.components["ArticleLayout"]
// Access dependency components
let button = resolved.dependencies["shared-ui@2.0.0"]?.components["Button"]
Web Rendering
const resolved = await metabind.getResolvedContent('cont123');
// Execute content code with package context
const componentCode = resolved.content;
const packageComponents = resolved.package.components;
// Render with all dependencies available
const renderer = new BindJSRenderer(packageComponents, resolved.dependencies);
renderer.render(componentCode);
When accessed with API keys, returns the latest published version. For optimization scenarios where packages are cached locally, use the standard
/content/{id} endpoint to fetch just the content with the compiled field.Error Responses
Content Not Found
{
"error": {
"code": "NOT_FOUND",
"message": "Content not found"
}
}
Not Published
When accessed via API key, only published content is returned:{
"error": {
"code": "NOT_PUBLISHED",
"message": "Content is not published"
}
}
Code Examples
curl -X GET "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/cont123/resolved" \
-H "Authorization: Bearer YOUR_JWT"
const response = await fetch(
'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/cont123/resolved',
{
headers: {
'Authorization': 'Bearer YOUR_JWT'
}
}
);
const resolved = await response.json();
console.log(`Content ready to render`);
console.log(`Package version: ${resolved.package.version}`);
console.log(`Components: ${Object.keys(resolved.package.components).join(', ')}`);
console.log(`Dependencies: ${Object.keys(resolved.dependencies).join(', ')}`);