Integration und Verwendung der Producer Tasks API

Die Hauptfunktion der Producer Tasks API besteht darin, durch Eingabe der von der Producer Audios Generation API generierten Aufgaben-ID den Ausführungsstatus dieser Aufgabe abzufragen.

Dieses Dokument erläutert ausführlich die Integration der Producer Tasks API und hilft Ihnen, diese API mühelos zu integrieren und ihre leistungsstarken Funktionen vollständig zu nutzen. Mit der Producer Tasks API können Sie den Ausführungsstatus von Aufgaben der Producer Audios Generation API einfach abfragen.

Antragsverfahren

Um die Producer Audios Generation API zu verwenden, rufen Sie zunächst die Ace Data Cloud Konsole auf und beschaffen Sie Ihren API-Token zur späteren Verwendung.

Falls Sie noch nicht angemeldet oder registriert sind, werden Sie automatisch zur Anmeldeseite weitergeleitet, wo Sie sich registrieren und anmelden können. Anschließend kehren Sie automatisch zur aktuellen Seite zurück.

Der API-Key einer allgemeinen Anwendung kann für die im Konto freigeschalteten Dienste verwendet werden; der Key einer spezialisierten Anwendung wird entsprechend dem Dienstumfang dieser Anwendung verwendet. Bitte überprüfen Sie die Berechtigungen, die Gültigkeitsdauer und die Limits des Keys und stellen Sie sicher, dass das Guthaben der Anwendung für diese Anfrage ausreicht. Das verfügbare Testguthaben richtet sich nach der Anzeige im Konto. Bei unzureichendem Guthaben klicken Sie einfach auf die Schaltfläche „Aufladen“.

📘 Vollständige Dokumentation: Producer Audios Generation API →

Anfragebeispiel

Die Producer Tasks API kann verwendet werden, um die Ergebnisse der Producer Audios Generation API abzufragen. Informationen zur Verwendung der Producer Audios Generation API finden Sie in der Dokumentation Producer Audios Generation API .

Wir verwenden eine vom Dienst der Producer Audios Generation API zurückgegebene Aufgaben-ID als Beispiel, um die Verwendung dieser API zu demonstrieren. Angenommen, wir haben eine Aufgaben-ID: 1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad. Im Folgenden wird demonstriert, wie durch Übergabe einer Aufgaben-ID.

Beispielabbildung einer Aufgabe

Anfrage-Header und Anfrage-Body festlegen

Anfrage-Header umfassen:

  • accept: Gibt an, dass das Antwortergebnis im JSON-Format empfangen werden soll; hier wird application/json eingetragen.
  • authorization: Der Schlüssel für den API-Aufruf, der nach der Beantragung direkt aus der Dropdown-Liste ausgewählt werden kann.

Anfrage-Body umfasst:

  • id: Die übermittelte Aufgaben-ID.
  • action: Die Art der Aktion für die Aufgabe.

Die Einstellungen sind in der folgenden Abbildung dargestellt:

Codebeispiele

Wie in der Abbildung dargestellt, wurde auf der rechten Seite der Seite bereits automatisch Code in verschiedenen Sprachen generiert:

Einige Codebeispiele sind wie folgt:

CURL

curl -X POST 'https://api.acedata.cloud/producer/tasks' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
  "action": "retrieve"
}'

Antwortbeispiel

Nach einer erfolgreichen Anfrage gibt die API detaillierte Informationen zu dieser Aufgabe zurück. Zum Beispiel:

{
  "_id": "69541b81ff2676299ccc3b29",
  "id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
  "api_id": "01d96900-9f8c-41d7-814c-95c7a885ba61",
  "application_id": "920ba772-867a-48ae-8efa-9b9f94136199",
  "created_at": 1767119745.524,
  "started_at": 1767119745.584,
  "finished_at": 1767119785.589,
  "elapsed": 40.005,
  "credential_id": "eeae817d-d6ff-493e-8f88-6c62391da7c6",
  "request": {
    "action": "generate",
    "model": "FUZZ-2.0 Pro",
    "instrumental": false,
    "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
    "custom": true,
    "callback_url": "https://webhook.site/0d73431d-f833-4be4-9276-b6e1690d55c1"
  },
  "trace_id": "1da03537-4eb8-410d-b849-43f03085a3bb",
  "type": "audios",
  "user_id": "ad7afe47-cea9-4cda-980f-2ad8810e51cf",
  "response": {
    "task_id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
    "data": [
      {
        "id": "1dd08826-478e-43a6-868f-aff5ababac2c",
        "title": "Woke up with the sun in my eyes",
        "image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
        "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
        "audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3",
        "video_url": null,
        "image_id": "1dd08826-478e-43a6-868f-aff5ababac2c",
        "topic": null,
        "seed": "1490770667",
        "sound": "",
        "created_at": "2025-12-30T18:36:00.994141Z",
        "model": "FUZZ-2.0 Pro",
        "progress": "100%",
        "state": "succeeded",
        "duration": "135.2330158730159"
      }
    ]
  }
}

Das zurückgegebene Ergebnis enthält mehrere Felder. Das Feld request entspricht dem beim Start der Aufgabe übermittelten Anfrage-Body, während das Feld response dem nach Abschluss der Aufgabe zurückgegebenen Antwort-Body entspricht. Die Felder werden im Folgenden erläutert.

  • id, die ID des Generierungsauftrags, die diesen Generierungsauftrag eindeutig identifiziert.
  • request, die Anfrageinformationen des abgefragten Auftrags.
  • response, die Antwortinformationen des abgefragten Auftrags.
  • created_at, der Erstellungszeitpunkt des Auftrags, Unix-Zeitstempel (Sekunden, Gleitkommazahl).
  • started_at, der Zeitpunkt, zu dem die Ausführung des Auftrags begonnen hat, Unix-Zeitstempel (Sekunden, Gleitkommazahl).
  • finished_at, der Abschlusszeitpunkt des Auftrags, Unix-Zeitstempel (Sekunden, Gleitkommazahl). Dieses Feld wird nicht zurückgegeben, wenn der Auftrag noch nicht abgeschlossen ist.
  • elapsed, die Ausführungsdauer des Auftrags in Sekunden (Gleitkommazahl, auf 3 Dezimalstellen gerundet). Dieses Feld wird nicht zurückgegeben, wenn der Auftrag noch nicht abgeschlossen ist.

Stapelabfrage

Hierbei werden die Auftragsdetails anhand mehrerer Auftrags-IDs abgefragt. Im Unterschied zur obigen Abfrage muss für action retrieve_batch ausgewählt werden.

Anfrage-Body umfasst:

  • ids: Array der hochgeladenen Auftrags-IDs.
  • action: Die auf den Auftrag anzuwendende Aktion.

Nehmen Sie die Einstellungen wie in der folgenden Abbildung gezeigt vor:

Codebeispiel

Auf der rechten Seite der Seite wurde bereits automatisch Code in verschiedenen Sprachen generiert, wie in der Abbildung gezeigt:

Einige Codebeispiele sind nachfolgend aufgeführt:

Antwortbeispiel

Nach einer erfolgreichen Anfrage gibt die API die vollständigen Detailinformationen zu allen Aufträgen dieser Stapelabfrage zurück. Zum Beispiel:

  "items": [
    {
      "_id": "69541b81ff2676299ccc3b29",
      "id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
      "api_id": "01d96900-9f8c-41d7-814c-95c7a885ba61",
      "application_id": "920ba772-867a-48ae-8efa-9b9f94136199",
      "created_at": 1767119745.524,
      "started_at": 1767119745.584,
      "finished_at": 1767119785.589,
      "elapsed": 40.005,
      "credential_id": "eeae817d-d6ff-493e-8f88-6c62391da7c6",
      "request": {
        "action": "generate",
        "model": "FUZZ-2.0 Pro",
        "instrumental": false,
        "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
        "custom": true,
        "callback_url": "https://webhook.site/0d73431d-f833-4be4-9276-b6e1690d55c1"
      },
      "trace_id": "1da03537-4eb8-410d-b849-43f03085a3bb",
      "type": "audios",
      "user_id": "ad7afe47-cea9-4cda-980f-2ad8810e51cf",
      "response": {
        "task_id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
        "data": [
          {
            "id": "1dd08826-478e-43a6-868f-aff5ababac2c",
            "title": "Woke up with the sun in my eyes",
            "image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
            "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
            "audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3",
            "video_url": null,
            "image_id": "1dd08826-478e-43a6-868f-aff5ababac2c",
            "topic": null,
            "seed": "1490770667",
            "sound": "",
            "created_at": "2025-12-30T18:36:00.994141Z",
            "model": "FUZZ-2.0 Pro",
            "progress": "100%",
            "state": "succeeded",
            "duration": "135.2330158730159"
          }
        ]
      }
    }, {
      "_id": "69541b81ff2676299ccc3b29",
      "id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
      "api_id": "01d96900-9f8c-41d7-814c-95c7a885ba61",
      "application_id": "920ba772-867a-48ae-8efa-9b9f94136199",
      "created_at": 1767119745.524,
      "started_at": 1767119745.584,
      "finished_at": 1767119785.589,
      "elapsed": 40.005,
      "credential_id": "eeae817d-d6ff-493e-8f88-6c62391da7c6",
      "request": {
        "action": "generate",
        "model": "FUZZ-2.0 Pro",
        "instrumental": false,
        "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
        "custom": true,
        "callback_url": "https://webhook.site/0d73431d-f833-4be4-9276-b6e1690d55c1"
      },
      "trace_id": "1da03537-4eb8-410d-b849-43f03085a3bb",
      "type": "audios",
      "user_id": "ad7afe47-cea9-4cda-980f-2ad8810e51cf",
      "response":
{
        "task_id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
        "data": [
          {
            "id": "1dd08826-478e-43a6-868f-aff5ababac2c",
            "title": "Woke up with the sun in my eyes",
            "image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
            "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
            "audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3",
            "video_url": null,
            "image_id": "1dd08826-478e-43a6-868f-aff5ababac2c",
            "topic": null,
            "seed": "1490770667",
            "sound": "",
            "created_at": "2025-12-30T18:36:00.994141Z",
            "model": "FUZZ-2.0 Pro",
            "progress": "100%",
            "state": "succeeded",
            "duration": "135.2330158730159"
          }
        ]
      }
    }
  ],
  "count": 2
}

Das zurückgegebene Ergebnis enthält mehrere Felder, wobei items die konkreten Detailinformationen zu den Batch-Aufgaben enthält. Die konkreten Informationen zu jeder Aufgabe entsprechen den oben genannten Feldern. Die Feldinformationen lauten wie folgt.

  • items: Alle konkreten Detailinformationen zu den Batch-Aufgaben. Es ist ein Array, dessen Elemente jeweils dasselbe Format wie das oben beschriebene Rückgabeergebnis für die Abfrage einer einzelnen Aufgabe haben.
  • count: Die Anzahl der hier im Batch abgefragten Aufgaben.

CURL

curl -X POST 'https://api.acedata.cloud/producer/tasks' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "ids": ["1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad","1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad"],
  "action": "retrieve_batch"
}'

Fehlerbehandlung

Wenn beim Aufrufen der API ein Fehler auftritt, gibt die API den entsprechenden Fehlercode und die entsprechende Meldung zurück. Zum Beispiel:

  • 400 token_mismatched: Fehlerhafte Anfrage, möglicherweise aufgrund fehlender oder ungültiger Parameter.
  • 400 api_not_implemented: Fehlerhafte Anfrage, möglicherweise aufgrund fehlender oder ungültiger Parameter.
  • 401 invalid_token: Nicht autorisiert, ungültiges oder fehlendes Autorisierungstoken.
  • 429 too_many_requests: Zu viele Anfragen, Sie haben das Anfragelimit überschritten.
  • 500 api_error: Interner Serverfehler, auf dem Server ist ein Fehler aufgetreten.

Beispiel einer Fehlerantwort

{
  "success": false,
  "error": {
    "code": "api_error",
    "message": "fetch failed"
  },
  "trace_id": "2cf86e86-22a4-46e1-ac2f-032c0f2a4e89"
}

Fazit

Durch dieses Dokument haben Sie erfahren, wie Sie mit der Producer Tasks API alle konkreten Detailinformationen zu einzelnen oder mehreren Aufgaben abfragen können. Wir hoffen, dass Ihnen dieses Dokument dabei hilft, die API besser zu integrieren und zu verwenden. Bei Fragen wenden Sie sich bitte jederzeit an unser technisches Supportteam.