Get Job Status
curl --request GET \
--url https://api.example.com/api/job-status/:jobIdimport requests
url = "https://api.example.com/api/job-status/:jobId"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/job-status/:jobId', 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/job-status/:jobId",
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/job-status/:jobId"
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/job-status/:jobId")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/job-status/:jobId")
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": "Job ID is required"
}
{
"success": false,
"error": "Job with ID abc123 not found"
}
API Reference
Get Job Status
Check the status of a content generation job
GET
/
api
/
job-status
/
:jobId
Get Job Status
curl --request GET \
--url https://api.example.com/api/job-status/:jobIdimport requests
url = "https://api.example.com/api/job-status/:jobId"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/job-status/:jobId', 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/job-status/:jobId",
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/job-status/:jobId"
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/job-status/:jobId")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/job-status/:jobId")
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": "Job ID is required"
}
{
"success": false,
"error": "Job with ID abc123 not found"
}
Endpoint
GET /api/job-status/:jobId
Authentication
No authentication required.Path Parameters
string
required
The unique identifier of the job returned from the content generation endpoint
Response
boolean
Indicates if the request was successful
object
Show properties
Show properties
string
The job identifier
string
Current job status:
pending, processing, completed, failedstring
Job type:
text or pdfstring
Content format:
image, carousel, or reelstring
Original filename (for PDF jobs) or null
number
Completion percentage (0-100)
string
ISO timestamp when job was created
string
ISO timestamp of last update
string
Error message if status is
failed, otherwise nullExample Request
curl https://api.distylia.com/api/job-status/550e8400-e29b-41d4-a716-446655440000
Example Response
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"type": "text",
"format": "carousel",
"filename": null,
"progress": 45,
"createdAt": "2024-01-08T10:30:00.000Z",
"updatedAt": "2024-01-08T10:30:45.000Z",
"errorMessage": null
}
}
Status Values
| Status | Description |
|---|---|
pending | Job is queued and waiting to start |
processing | Job is currently being processed |
completed | Job finished successfully |
failed | Job encountered an error |
Polling Recommendations
- Poll every 5-10 seconds for status updates
- Stop polling once status is
completedorfailed - Use exponential backoff if implementing automatic polling
Error Responses
{
"error": "Job ID is required"
}
{
"success": false,
"error": "Job with ID abc123 not found"
}