Gesprächsdetails abrufen
Gesprächsdetails abrufen
Rufen Sie alle Nachrichten innerhalb eines Gesprächs mit dem Parameter conversation_id ab. Die Antwort enthält message_id, Benutzeranfragen, Nachrichtentypen, Nachrichteninhalte, Zeitstempel und weitere Details.
Anfragemethode
GET
Endpoint
https://api-${endpoint}.gptbots.ai/v2/messages
Authentifizierung
Siehe API-Übersicht für Authentifizierungsanweisungen.
Anfrage
Beispielanfrage
curl -X GET 'https://api-${endpoint}.gptbots.ai/v2/messages?conversation_id=xxxxxx&page=1&page_size=100' \
-H 'Authorization: Bearer ${API Key}'
curl -X GET 'https://api-${endpoint}.gptbots.ai/v2/messages?conversation_id=xxxxxx&page=1&page_size=100' \
-H 'Authorization: Bearer ${API Key}'
Dieser Codeblock im schwebenden Fenster
Anfrage-Header
| Feld | Typ | Beschreibung |
|---|---|---|
| Authorization | Bearer ${API Key} | Verwenden Sie Authorization: Bearer ${API Key} zur Authentifizierung. Den API-Key erhalten Sie auf der API-Key-Seite. |
Anfrageparameter
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
| conversation_id | string | Ja | Gesprächskennung. |
| page | int | Ja | Seitenzahl der Abfrage. |
| page_size | int | Ja | Anzahl der Einträge pro Seite, maximal 100. |
Antwort
Beispielantwort
{
"total": 2,
"conversation_content": [
{
"message_id": "645dd86906931c4a9e0ffb1f",
"parent_message_id": "545dd86906931c4a9e0ffb1f",
"create_time": 1683871849906,
"feedback": "POSITIVE",
"role": "user",
"content": [
{
"branch_content": [
{
"type": "text",
"text": "Ich habe 2 Bilddateien hochgeladen, bitte OCR durchführen und 2 JSON-Datensätze zurückgeben."
},
{
"type": "image",
"image": [
{
"url": "https://gptbots.ai/example.png",
"format": "jpeg",
"name": "TAXI1",
"size": 1024
},
{
"url": "https://gptbots.ai/example.png",
"format": "png",
"name": "TAXI2",
"size": 1024
}
]
},
{
"type": "audio",
"audio": [
{
"url": "https://gptbots.ai/example.mp3",
"format": "mp3",
"name": "example1 audio",
"size": 1024
}
]
},
{
"type": "document",
"document": [
{
"url": "https://gptbots.ai/example.pdf",
"format": "pdf",
"name": "example pdf",
"size": 1024
}
]
}
]
}
]
},
{
"message_id": "745dd86906931c4a9e0ffb1f",
"parent_message_id": "645dd86906931c4a9e0ffb1f",
"create_time": 1683871849906,
"feedback": "POSITIVE",
"role": "assistant",
"content": [
{
"from_component_branch": "1",
"branch_content": [
{
"type": "text",
"text": "Hallo, kann ich Ihnen irgendwie weiterhelfen?"
},
{
"type": "audio",
"audio": [
{
"url": "http://gptbots.ai/example.mp3",
"transcript": "Transkribierter Inhalt der Audiodatei"
}
]
}
]
},
{
"from_component_branch": "2",
"branch_content": [
{
"type": "document",
"document": [
{
"url": "https://gptbots.ai/example.pdf",
"format": "pdf",
"name": "example pdf"
}
]
},
{
"type": "image",
"image": [
{
"url": "https://gptbots.ai/example.png",
"format": "png",
"name": "TAXI2"
}
]
}
]
}
]
}
]
}
{
"total": 2,
"conversation_content": [
{
"message_id": "645dd86906931c4a9e0ffb1f",
"parent_message_id": "545dd86906931c4a9e0ffb1f",
"create_time": 1683871849906,
"feedback": "POSITIVE",
"role": "user",
"content": [
{
"branch_content": [
{
"type": "text",
"text": "Ich habe 2 Bilddateien hochgeladen, bitte OCR durchführen und 2 JSON-Datensätze zurückgeben."
},
{
"type": "image",
"image": [
{
"url": "https://gptbots.ai/example.png",
"format": "jpeg",
"name": "TAXI1",
"size": 1024
},
{
"url": "https://gptbots.ai/example.png",
"format": "png",
"name": "TAXI2",
"size": 1024
}
]
},
{
"type": "audio",
"audio": [
{
"url": "https://gptbots.ai/example.mp3",
"format": "mp3",
"name": "example1 audio",
"size": 1024
}
]
},
{
"type": "document",
"document": [
{
"url": "https://gptbots.ai/example.pdf",
"format": "pdf",
"name": "example pdf",
"size": 1024
}
]
}
]
}
]
},
{
"message_id": "745dd86906931c4a9e0ffb1f",
"parent_message_id": "645dd86906931c4a9e0ffb1f",
"create_time": 1683871849906,
"feedback": "POSITIVE",
"role": "assistant",
"content": [
{
"from_component_branch": "1",
"branch_content": [
{
"type": "text",
"text": "Hallo, kann ich Ihnen irgendwie weiterhelfen?"
},
{
"type": "audio",
"audio": [
{
"url": "http://gptbots.ai/example.mp3",
"transcript": "Transkribierter Inhalt der Audiodatei"
}
]
}
]
},
{
"from_component_branch": "2",
"branch_content": [
{
"type": "document",
"document": [
{
"url": "https://gptbots.ai/example.pdf",
"format": "pdf",
"name": "example pdf"
}
]
},
{
"type": "image",
"image": [
{
"url": "https://gptbots.ai/example.png",
"format": "png",
"name": "TAXI2"
}
]
}
]
}
]
}
]
}
Dieser Codeblock im schwebenden Fenster
Erfolgreiche Antwort
| Feld | Typ | Beschreibung |
|---|---|---|
| total | string | Gesamtanzahl der Nachrichten im Gespräch. |
| conversation_content | JSON Array | Details zu den Nachrichten. |
| message_id | string | Eindeutige Kennung der Nachricht. |
| parent_message_id | string | Eindeutige Kennung der übergeordneten Nachricht. |
| create_time | long | Zeitstempel der Erstellung der Nachricht. |
| feedback | string | Benutzer-Feedback zur Nachricht, Werte: POSITIVE, NEGATIVE. Kein Feedback = leer. |
| role | string | Nachrichtenrolle: user oder assistant. |
| content | JSON Array | Nachrichteninhalt. |
| from_component_branch | string | Komponenten-Branch-ID der Nachrichtenquelle. Bei Benutzer-Nachrichten und regulären Agenten leer. |
| branch_content | JSON Array | Branch-Inhalt der Nachricht. |
| type | string | Nachrichtentyp: text, image, audio, document, video, file. |
| text | string | Inhalt der Textnachricht. |
| image | JSON Array | Inhalt der Bildnachricht. |
| audio | JSON Array | Inhalt der Audionachricht. |
| document | JSON Array | Inhalt der Dokumentennachricht. |
| video | JSON Array | Inhalt der Videonachricht. |
| file | JSON Array | Inhalt der Dateinachricht. |
Fehlerantwort
| Feld | Typ | Beschreibung |
|---|---|---|
| code | int | Fehlercode. |
| message | string | Fehlerdetails. |
Fehlercodes
| Code | Nachricht |
|---|---|
| 40000 | Ungültige Parameter |
| 40005 | Paginierungsparameter überschreitet tatsächliche Anzahl |
| 40127 | Entwickler-Authentifizierung fehlgeschlagen |
| 40356 | Gespräch existiert nicht |
| 20059 | Agent wurde gelöscht |
