Skip to main content
GET
/
api
/
job-result
/
:jobId
Get Job Result
curl --request GET \
  --url https://api.example.com/api/job-result/:jobId
import requests

url = "https://api.example.com/api/job-result/:jobId"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.example.com/api/job-result/: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-result/: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-result/: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-result/:jobId")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/api/job-result/: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": "Result for job with ID abc123 not found or job not completed"
}

Endpoint

GET /api/job-result/:jobId

Authentication

No authentication required.

Path Parameters

jobId
string
required
The unique identifier of the completed job

Response

success
boolean
Indicates if the request was successful
message
string
Human-readable status message
data
object

Example Request

curl https://api.distylia.com/api/job-result/550e8400-e29b-41d4-a716-446655440000

Example Response - Image

{
  "success": true,
  "message": "Job result retrieved successfully",
  "data": {
    "id": "content-123",
    "type": "text",
    "format": "image",
    "caption": "Ready to boost your productivity? Check out these 5 game-changing tips! 🚀",
    "hashtags": "#productivity #workfromhome #timemanagement #efficiency #success",
    "audioUrl": null,
    "createdAt": "2024-01-08T10:32:15.000Z",
    "metadata": {
      "platform": "instagram",
      "visualTemplate": "minimal",
      "slideCount": null
    },
    "images": [
      {
        "id": "img-1",
        "url": "https://storage.example.com/content/image-123.png",
        "slideNumber": 1,
        "createdAt": "2024-01-08T10:32:15.000Z"
      }
    ],
    "videos": []
  }
}
{
  "success": true,
  "message": "Job result retrieved successfully",
  "data": {
    "id": "content-456",
    "type": "text",
    "format": "carousel",
    "caption": "Swipe through for 5 essential remote work tips! 💼✨",
    "hashtags": "#remotework #workfromhome #productivity #digitalnomad #workflow",
    "audioUrl": null,
    "createdAt": "2024-01-08T10:35:20.000Z",
    "metadata": {
      "platform": "instagram",
      "visualTemplate": "magazine",
      "slideCount": 5
    },
    "images": [
      {
        "id": "img-1",
        "url": "https://storage.example.com/content/slide-1.png",
        "slideNumber": 1,
        "createdAt": "2024-01-08T10:35:20.000Z"
      },
      {
        "id": "img-2",
        "url": "https://storage.example.com/content/slide-2.png",
        "slideNumber": 2,
        "createdAt": "2024-01-08T10:35:21.000Z"
      }
      // ... more slides
    ],
    "videos": []
  }
}

Example Response - Reel

{
  "success": true,
  "message": "Job result retrieved successfully",
  "data": {
    "id": "content-789",
    "type": "text",
    "format": "reel",
    "caption": "Quick productivity tips to level up your work! 🎯",
    "hashtags": "#productivitytips #reels #motivation #worklife #shorts",
    "audioUrl": "https://storage.example.com/audio/audio-123.mp3",
    "createdAt": "2024-01-08T10:40:30.000Z",
    "metadata": {
      "platform": "tiktok",
      "visualTemplate": "neon",
      "maxDuration": 30,
      "captions": {
        "enabled": true,
        "style": "modern",
        "position": "bottom",
        "fontSize": "medium"
      }
    },
    "images": [],
    "videos": [
      {
        "id": "vid-1",
        "url": "https://storage.example.com/content/reel-789.mp4",
        "duration": 28,
        "createdAt": "2024-01-08T10:40:30.000Z"
      }
    ]
  }
}

Error Responses

{
  "error": "Job ID is required"
}
{
  "success": false,
  "error": "Result for job with ID abc123 not found or job not completed"
}

Notes

  • Only call this endpoint after the job status is completed
  • Result URLs are publicly accessible and permanent
  • All media files are hosted on Azure Blob Storage
  • For carousels, images are ordered by slideNumber