Cas d'usage de l'API
Prérequis
pip install aiohttp1. Créer une Pièce Jointe Associée à une Demande de Droit
import aiohttp
import asyncio
async def create_attachment(workspace_id, api_key, attachment_data):
url = f"https://api.dastra.eu/v1/ws/{workspace_id}/datasubjectattachments"
headers = {
"Content-Type": "application/json",
"X-Api-Key": api_key
}
async with aiohttp.ClientSession() as session:
async with session.post(url, json=attachment_data, headers=headers) as response:
return await response.json()
# Exemple d'utilisation
workspace_id = "votre_workspace_id"
api_key = "votre_api_key"
attachment_data = {
# Remplir avec les données de votre pièce jointe
"dataSubjectRequestId": "id_de_la_demande",
"fileName": "exemple.pdf",
"fileContent": "contenu_encodé_base64"
}
response = asyncio.run(create_attachment(workspace_id, api_key, attachment_data))
print(response)2. Envoyer un Message avec la Pièce Jointe dans une Demande de Droit
3. Récupérer les Nouvelles Demandes Selon des Filtres
Conclusion
Mis à jour
Ce contenu vous a-t-il été utile ?