Anhänge
Basis-URL: https://app.neuroflash.com/api/attachment-service
Anhang hochladen
POST
/conversations/{conversation_id}/attachmentsPfadparameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
conversation_id | string | Ja |
Anfrage-Body
FeldTypErforderlichBeschreibung
base64ContentobjectNeinBase64-codierter Dateiinhalt. Gegenseitig ausschließend mit contentUrl; genau einer der beiden muss angegeben werden. Maximale dekodierte Dateigröße beträgt 10 MB.contentUrlobjectNeinHTTP(S)-URL, von der der Dateiinhalt heruntergeladen wird. Gegenseitig ausschließend mit base64Content; genau einer der beiden muss angegeben werden. Maximale heruntergeladene Dateigröße beträgt 10 MB.mimeTypeobjectNeinMIME-Typ der Datei. Optional für textbasierte Formate: Wenn weggelassen oder auf text/plain gesetzt, wird der Typ aus der Dateinamenerweiterung abgeleitet. Für Binärformate ist es erforderlich und muss dem Dateiinhalt entsprechen.filenamestringJaUrsprünglicher Dateiname des Anhangs.Antwort
FeldTypBeschreibung
idstringconversationIdstringcreatedByUserIdstringfileTypestringfileSizeintegerfileNamestringcreatedAtstringupdatedAtstringbase64ContentobjectplaintextContentobject_linksobject
contentstringBeispiel
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/attachment-service/conversations/{conversation_id}/attachments" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"base64Content": {},
"contentUrl": {},
"mimeType": {},
"filename": "string"
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/attachment-service/conversations/{conversation_id}/attachments",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"base64Content": {},
"contentUrl": {},
"mimeType": {},
"filename": "string"
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/attachment-service/conversations/${conversationId}/attachments`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"base64Content": {},
"contentUrl": {},
"mimeType": {},
"filename": "string"
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"base64Content": map[string]any{},
"contentUrl": map[string]any{},
"mimeType": map[string]any{},
"filename": "string",
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/attachment-service/conversations/"+conversationID+"/attachments", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Antwort:
{
"id": "string",
"conversationId": "string",
"createdByUserId": "string",
"fileType": "string",
"fileSize": 0,
"fileName": "string",
"createdAt": "string",
"updatedAt": "string",
"base64Content": {},
"plaintextContent": {},
"_links": {
"content": "string"
}
}
Anhänge auflisten
GET
/conversations/{conversation_id}/attachmentsPfadparameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
conversation_id | string | Ja |
Abfrageparameter
| Parameter | Typ | Standard | Beschreibung |
|---|---|---|---|
page | integer | 1 | Seitenzahl (1-basiert) |
size | integer | 20 | Anzahl der Elemente pro Seite |
excludedFields | string | — |
Antwort
FeldTypBeschreibung
dataarray<object>
idstringconversationIdstringcreatedByUserIdstringfileTypestringfileSizeintegerfileNamestringcreatedAtstringupdatedAtstringbase64ContentobjectplaintextContentobject_linksobject
contentstringpageobject
sizeintegertotalElementsintegertotalPagesintegercurrentPageintegerBeispiel
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/attachment-service/conversations/{conversation_id}/attachments" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/attachment-service/conversations/{conversation_id}/attachments",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/attachment-service/conversations/${conversationId}/attachments`,
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/attachment-service/conversations/"+conversationID+"/attachments", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Antwort:
{
"data": [
{
"id": "string",
"conversationId": "string",
"createdByUserId": "string",
"fileType": "string",
"fileSize": 0,
"fileName": "string",
"createdAt": "string",
"updatedAt": "string",
"base64Content": {},
"plaintextContent": {},
"_links": {
"content": "string"
}
}
],
"page": {
"size": 0,
"totalElements": 0,
"totalPages": 0,
"currentPage": 0
}
}
Anhang löschen
DELETE
/conversations/{conversation_id}/attachments/{attachment_id}Pfadparameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
conversation_id | string | Ja | |
attachment_id | string | Ja |
Beispiel
- cURL
- Python
- Node.js
- Go
curl -X DELETE "https://app.neuroflash.com/api/attachment-service/conversations/{conversation_id}/attachments/{attachment_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
requests.delete(
f"https://app.neuroflash.com/api/attachment-service/conversations/{conversation_id}/attachments/{attachment_id}",
headers={"Authorization": f"Bearer {token}"},
)
await fetch(
`https://app.neuroflash.com/api/attachment-service/conversations/${conversationId}/attachments/${attachmentId}`,
{
method: "DELETE",
headers: { Authorization: `Bearer ${token}` },
}
);
req, _ := http.NewRequest("DELETE", "https://app.neuroflash.com/api/attachment-service/conversations/"+conversationID+"/attachments/"+attachmentID+"", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Antwort:
{}
Anhang abrufen
GET
/attachments/{attachment_id}Pfadparameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
attachment_id | string | Ja |
Abfrageparameter
| Parameter | Typ | Standard | Beschreibung |
|---|---|---|---|
excludedFields | string | — |
Antwort
FeldTypBeschreibung
idstringconversationIdstringcreatedByUserIdstringfileTypestringfileSizeintegerfileNamestringcreatedAtstringupdatedAtstringbase64ContentobjectplaintextContentobject_linksobject
contentstringBeispiel
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/attachment-service/attachments/{attachment_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/attachment-service/attachments/{attachment_id}",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/attachment-service/attachments/${attachmentId}`,
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/attachment-service/attachments/"+attachmentID+"", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Antwort:
{
"id": "string",
"conversationId": "string",
"createdByUserId": "string",
"fileType": "string",
"fileSize": 0,
"fileName": "string",
"createdAt": "string",
"updatedAt": "string",
"base64Content": {},
"plaintextContent": {},
"_links": {
"content": "string"
}
}