Get Content
curl --request GET \
--url https://api.example.com/api/content/:idimport requests
url = "https://api.example.com/api/content/:id"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/content/:id', 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/api/content/:id",
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/api/content/:id"
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/api/content/:id")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/content/:id")
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{
"error": "Content ID is required"
}
{
"success": false,
"error": "Content with ID xyz not found"
}
API Reference
Get Content
Retrieve content by its unique identifier
GET
/
api
/
content
/
:id
Get Content
curl --request GET \
--url https://api.example.com/api/content/:idimport requests
url = "https://api.example.com/api/content/:id"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/content/:id', 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/api/content/:id",
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/api/content/:id"
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/api/content/:id")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/content/:id")
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{
"error": "Content ID is required"
}
{
"success": false,
"error": "Content with ID xyz not found"
}
Endpoint
GET /api/content/:id
Authentication
No authentication required.Path Parameters
Response
Show properties
Show properties
Example Request
curl https://api.distylia.com/api/content/content-123
Example Response
{
"success": true,
"data": {
"id": "content-123",
"type": "text",
"format": "image",
"caption": "Transform your productivity with these essential tips! ๐",
"hashtags": "#productivity #success #worklife #motivation",
"audioUrl": null,
"createdAt": "2024-01-08T10:30:00.000Z",
"metadata": {
"platform": "instagram",
"visualTemplate": "infographic",
"slideCount": null,
"customPrompt": null
},
"images": [
{
"id": "img-1",
"url": "https://storage.example.com/content/image-123.png",
"slideNumber": 1,
"createdAt": "2024-01-08T10:30:00.000Z"
}
],
"videos": []
}
}
Error Responses
{
"error": "Content ID is required"
}
{
"success": false,
"error": "Content with ID xyz not found"
}
Use Cases
- Retrieve previously generated content
- Access content using a known content ID
- View content details and metadata
- Get direct URLs to media files
Notes
- This endpoint returns the same structure as the job result endpoint
- Content IDs are permanent and donโt expire
- Use this endpoint when you have the content ID but not the job ID