= 200 && $http_code < 300) { echo "Erfolg!"; logDebug("DATEI ERFOLGREICH IN NEXTCLOUD ERSTELLT: $filename"); $submission_id = $data['data']['id'] ?? null; if ($submission_id) { $ch_del = curl_init("URL EINFÜGEN" . $submission_id); curl_setopt($ch_del, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_setopt($ch_del, CURLOPT_HTTPHEADER, [ "X-Auth-Token: " . $api_key, "Content-Type: application/json" ]); curl_setopt($ch_del, CURLOPT_RETURNTRANSFER, true); $del_result = curl_exec($ch_del); $del_status = curl_getinfo($ch_del, CURLINFO_HTTP_CODE); curl_close($ch_del); logDebug("DocuSeal Löschauftrag ID $submission_id gesendet. Status: $del_status. Antwort: $del_result"); } } else { http_response_code(500); logDebug("UPLOAD FEHLGESCHLAGEN. HTTP-Code: " . $http_code . " Antwort: " . $result); } } else { logDebug("FEHLER: PDF konnte nicht per cURL heruntergeladen werden. Status: " . $down_status); } } } else { logDebug("Event $event wird ignoriert."); } ?>