POST
/
project-setup-results
Get Project Setup Runs Results
curl --request POST \
  --url https://client.camb.ai/apis/project-setup-results \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "run_ids": [
    12345,
    6789
  ]
}'
[
  {
    "run_id": 1,
    "project_details": {
      "project_name": "<string>",
      "project_description": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "source_language": 1,
      "target_languages": [
        1
      ],
      "duration": 123,
      "folder_id": 1,
      "studio_url": "<string>"
    }
  }
]

Overview

he Get Bulk Project Setup Results endpoint is your go-to tool for managing multiple content localization projects with ease. By retrieving comprehensive setup results for multiple projects in a single API call, this endpoint empowers project managers, content creators, and automation workflows to stay on top of large-scale localization efforts in CAMB.AI Studio.

With this endpoint, you can:

  • Retrieve detailed setup results for multiple projects simultaneously.
  • Gain insights into project readiness, including status, duration, and language configurations.

Why Use This Endpoint? This endpoint is a game-changer for teams managing multiple localization projects. It provides a unified view of your project portfolio, helping you coordinate tasks, allocate resources efficiently, and make data-driven decisions to keep your content pipeline on track.

import requests
from typing import Any


def fetch_bulk_story_results(run_ids: list[int]) -> dict[str, Any] | None:
    """
    Retrieves multiple story conversion outputs in a single request

    Args:
        run_ids: List of unique run identifiers from story processing tasks

    Returns:
        List of story result dictionaries, or None if request fails
    """
    headers = {
        "x-api-key": "your-api-key-here",
        "Content-Type": "application/json",
    }

    payload = {"run_ids": run_ids}

    try:
        response = requests.post(
            "https://client.camb.ai/apis/stories-results",
            headers=headers,
            json=payload,
        )
        response.raise_for_status()

        results = response.json()
        print(f"Retrieved {len(results)} story results successfully")

        return results

    except requests.exceptions.HTTPError as e:
        print(f"Error {e.response.status_code}: {e.response.text}")
        return None
    except requests.exceptions.RequestException as e:
        print(f"Request failed: {e}")
        return None


def process_bulk_results(results: dict[str, Any]) -> None:
    """
    Process and display bulk story results

    Args:
        results: List of story result dictionaries
    """
    for i, run_id_key in enumerate(results, start=1):
        print(f"\n--- Story {i} ---")
        print(f"Main Audio: {results.get(run_id_key, {}).get('audio_url')}")
        print(f"Dialogue Track: {results.get(run_id_key, {}).get('dialogue_url')}")

        transcription = results.get(run_id_key, {}).get("transcription", {})
        if transcription:
            print(f"Transcript entries: {len(transcription)}")
            first_entry = transcription[0]
            print(
                f"First line: [{first_entry['start']}-{first_entry['end']}ms] "
                f"{first_entry['speaker']}: {first_entry['text'][:50]}..."
            )


# Example usage with multiple run IDs
run_ids_to_fetch = [9872, 9873, 9874, 9875, 9876]

bulk_results = fetch_bulk_story_results(run_ids_to_fetch)

if bulk_results:
    process_bulk_results(bulk_results)

    # Example: Save audio URLs for batch download
    audio_urls = [
        bulk_results.get(result, {}).get("audio_url") for result in bulk_results
    ]
    print(f"\nExtracted {len(audio_urls)} audio URLs for batch processing")

Best Practices for Effective Use

To maximize the value of this endpoint, consider these strategies:

  1. Group Projects Strategically: Organize run_ids by priority, language pairs, or deadlines to align with your team’s workflow.
  2. Batch Efficiently: Balance the number of run_ids in each request to ensure fast response times and manageable data processing.

Authorizations

x-api-key
string
header
required

The x-api-key is a custom header required for authenticating requests to our API. Include this header in your request with the appropriate API key value to securely access our endpoints. You can find your API key(s) in the 'API' section of our studio website.

Body

application/json

Response

200
application/json

Successful Response

An array containing the results of one to five project setup runs. Each item in the array is an object that contains the project details.