ilovepdf / ilovepdf-php

iLovePDF Rest Api - PHP Library (https://developer.ilovepdf.com)
146 stars 39 forks source link

Webhook is never triggered #43

Closed Radon8472 closed 2 months ago

Radon8472 commented 1 year ago

I tried to run a task, that should trigger a webhook when finished (Like example webhook_send).

That is my code:

require_once('vendor/autoload.php');

use Ilovepdf\OfficepdfTask;

// Load my keys into $keys
$myTask = new OfficepdfTask($keys[0],$keys[1]);
$file1 = $myTask->addFile('my-test.ppt');
$myTask->setOutputFilename('outfile-office.pdf');

$myTask->setWebhook('http://my-url.de:20000/pdf-download-hook');

// We don't download here because with the webhook we ordered the files must be processed in background.
// Notification will be sent once it's ready

//   $myTask->execute(); // see info add "Own research"

Expected behavior:

Actual behavior:

Own reseach:

EDIT: When I add the same webhook as webhook into my global api config, it is called successfull, but dynamical adding webhooks via Task->setWebhook() seems to have no effect.

maztch commented 2 months ago

setWebook method will be changed to setProcessInBackground. This will send the process task to be run on background and no wait for response, params will be true or false