= 200 && $http_code < 300) { logMasterDebug("Erfolgreich hochgeladen: $filename in Ordner für Template $template_id"); if ($submission_id) { $ch_del = curl_init("https://docusign.fuyuzakura.de/api/v1/submissions/" . $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); curl_exec($ch_del); curl_close($ch_del); } echo "Erfolg!"; } else { logMasterDebug("Nextcloud Upload Fehler. HTTP: $http_code"); http_response_code(500); } } else { logMasterDebug("Fehler beim Herunterladen der PDF von DocuSeal. HTTP-Code: $down_status"); } } else { logMasterDebug("Keine PDF-URL im Payload gefunden."); } ?>