Get Content Version
curl --request GET \
--url https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions/{version}import requests
url = "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions/{version}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions/{version}', 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}/versions/{version}",
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}/versions/{version}"
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}/versions/{version}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions/{version}")
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_bodyContent
Get Content Version
Retrieve a specific version of a content item
GET
/
app
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
content
/
{id}
/
versions
/
{version}
Get Content Version
curl --request GET \
--url https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions/{version}import requests
url = "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions/{version}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions/{version}', 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}/versions/{version}",
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}/versions/{version}"
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}/versions/{version}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/versions/{version}")
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_bodyRetrieves the content data for a specific historical version. Use this to view or compare previous versions of content.
Path Parameters
Response
Returns the Content object as it existed at the specified version.{
"data": {
"id": "cont123",
"name": "Getting Started Guide",
"typeId": "ct-article",
"status": "published",
"version": 2,
"content": {
"title": "Getting Started Guide v2",
"components": [
{
"type": "TextBlock",
"props": {
"text": "Welcome to the guide..."
}
}
]
},
"tags": ["guide", "beginner"],
"isTemplate": false,
"metadata": {
"createdBy": "user123",
"createdAt": "2024-03-20T10:00:00Z",
"updatedBy": "user456",
"lastUpdatedAt": "2024-03-21T10:00:00Z",
"publishedBy": "user456",
"publishedAt": "2024-03-21T10:00:00Z"
},
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-21T10:00:00Z"
}
}
Error Responses
Version Not Found
{
"error": {
"code": "NOT_FOUND",
"message": "Content version 5 for ID cont123 was not found"
}
}
Content Not Found
{
"error": {
"code": "NOT_FOUND",
"message": "Content not found"
}
}
Code Examples
curl -X GET "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/cont123/versions/2" \
-H "Authorization: Bearer YOUR_JWT"
const response = await fetch(
'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/cont123/versions/2',
{
headers: {
'Authorization': 'Bearer YOUR_JWT'
}
}
);
const { data: contentAtVersion } = await response.json();
console.log(`Content title at version 2: ${contentAtVersion.content.title}`);
// Compare with current version
const currentResponse = await fetch(
'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/cont123',
{
headers: {
'Authorization': 'Bearer YOUR_JWT'
}
}
);
const { data: currentContent } = await currentResponse.json();
console.log(`Current title: ${currentContent.content.title}`);
let url = URL(string: "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/cont123/versions/2")!
var request = URLRequest(url: url)
request.setValue("Bearer YOUR_JWT", forHTTPHeaderField: "Authorization")
// Make GET request
This endpoint returns the content exactly as it was at the specified version. To revert content to a previous version, use the rollback endpoint.