Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Einige Methoden der Dialogflow API lösen einen lang andauernden Vorgang aus.
Diese Methoden sind asynchron und der Vorgang ist möglicherweise noch nicht abgeschlossen, wenn die Methode eine Antwort zurückgibt.
Sie können den Status prüfen oder Vorgänge abbrechen.
Vorgangsstatus abrufen
Das folgende Beispiel zeigt, wie Sie den Status eines Vorgangs abrufen.
Wenn Sie viele Vorgänge prüfen müssen, sollten Sie die Rate einschränken oder stattdessen die Methode Liste verwenden.
REST
Rufen Sie die Methode get für den Typ Operations auf.
Ersetzen Sie diese Werte in den folgenden Anfragedaten:
PROJECT_ID: ID Ihres GCP-Projekts
OPERATION_ID: Ihre Vorgangs-ID
API_VERSION: entweder v2 oder v2beta1
HTTP-Methode und URL:
GET https://dialogflow.googleapis.com/API_VERSION/projects/my-gcp-project/operations/OPERATION_ID
Wenn Sie die Anfrage senden möchten, maximieren Sie eine der folgenden Optionen:
Wenn der Vorgang abgeschlossen ist, wird der state-Wert SUCCESSFUL zurückgegeben.
Vorgänge auflisten und abbrechen
Sie können nicht nur einen bestimmten Vorgang ausführen, sondern auch Vorgänge auflisten und abbrechen.
Siehe die Methoden list und cancel für den Typ Operations.
Die list-Ergebnisse können Vorgänge enthalten, die nichts mit Ihrer aktuellen Aufgabe zu tun haben. Achten Sie daher darauf, die Ergebnisse zu filtern.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003eThe Dialogflow API uses long-running operations for asynchronous tasks, which may not be completed when the method returns.\u003c/p\u003e\n"],["\u003cp\u003eYou can check the status of an operation by calling the \u003ccode\u003eget\u003c/code\u003e method of the \u003ccode\u003eOperations\u003c/code\u003e type, using the operation's ID.\u003c/p\u003e\n"],["\u003cp\u003eWhen checking many operations, it is recommended to either rate limit calls or use the \u003ccode\u003elist\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eTo interact with the API, you'll need to replace placeholders like \u003ccode\u003ePROJECT_ID\u003c/code\u003e, \u003ccode\u003eOPERATION_ID\u003c/code\u003e, and \u003ccode\u003eAPI_VERSION\u003c/code\u003e in the provided request examples.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003elist\u003c/code\u003e and \u003ccode\u003ecancel\u003c/code\u003e methods of the \u003ccode\u003eOperations\u003c/code\u003e type allow for listing and canceling operations, but \u003ccode\u003elist\u003c/code\u003e may contain irrelevant results.\u003c/p\u003e\n"]]],[],null,["# Long-running operations\n\nSome methods of the Dialogflow API return a long-running operation.\nThese methods are asynchronous,\nand the operation may not be completed when the method returns a response.\nYou can check on the status or cancel operations.\n\nGet an operation status\n-----------------------\n\nThe following shows how to poll an operation's status.\nIf you have many operations to check,\nyou should rate limit your calls or\nuse the [list](#list) method instead. \n\n### REST\n\nCall the `get` method for the\n[`Operations`](/dialogflow/docs/reference/common-types#operations)\ntype.\n\n\nBefore using any of the request data,\nmake the following replacements:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your GCP project ID\n- \u003cvar translate=\"no\"\u003eOPERATION_ID\u003c/var\u003e: your operation ID\n- \u003cvar translate=\"no\"\u003eAPI_VERSION\u003c/var\u003e: either `v2` or `v2beta1`\n\n\nHTTP method and URL:\n\n```\nGET https://dialogflow.googleapis.com/API_VERSION/projects/my-gcp-project/operations/OPERATION_ID\n```\n\nTo send your request, expand one of these options:\n\n#### curl (Linux, macOS, or Cloud Shell)\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) , or by using [Cloud Shell](/shell/docs), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nExecute the following command:\n\n```\ncurl -X GET \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"x-goog-user-project: PROJECT_ID\" \\\n \"https://dialogflow.googleapis.com/API_VERSION/projects/my-gcp-project/operations/OPERATION_ID\"\n```\n\n#### PowerShell (Windows)\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nExecute the following command:\n\n```\n$cred = gcloud auth print-access-token\n$headers = @{ \"Authorization\" = \"Bearer $cred\"; \"x-goog-user-project\" = \"PROJECT_ID\" }\n\nInvoke-WebRequest `\n -Method GET `\n -Headers $headers `\n -Uri \"https://dialogflow.googleapis.com/API_VERSION/projects/my-gcp-project/operations/OPERATION_ID\" | Select-Object -Expand Content\n```\n\nYou should receive a JSON response similar to the following:\n\n```\n{\n \"name\": \"projects/PROJECT_ID/operations/some-operation-name-OPERATION_ID\",\n \"metadata\": {\n \"@type\": \"type.googleapis.com/google.cloud.dialogflow.API_VERSION.SomeOperationType\",\n \"state\": \"DONE\"\n },\n \"done\": true,\n ...\n}\n```\n\nWhen the operation has completed,\na `state` value of `SUCCESSFUL` is returned.\n\n\u003cbr /\u003e\n\nList and cancel operations\n--------------------------\n\nIn addition to getting a specific operation,\nyou can list and cancel operations.\nSee the `list` and `cancel` methods for the\n[`Operations`](/dialogflow/docs/reference/common-types#operations)\ntype.\n\nThe `list` results may contain operations unrelated to your current task,\nso be sure to filter the results."]]