Open carstengrimm opened 4 years ago
it seems in the restapi.php this part is not working and leaving it out will make the site show the response:
$result = $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { if ($app->config('debug') === true) { $msg = 'ERROR ' . get_class($object) . '->generateDocument: object->error:' . $object->error. ' $result='.$result. ' dblasterror='.$db->lasterror; } else { $msg = 'ERROR'; } $app->halt('500', $msg); }
but either way, it seems that this is only generating the file, if i were to use it, e.g to send it as an email attachment, i would have to look up for the file and load it as an attachment?
Hi. dolibarr 12 have a "documents" api endpoint, that has a "builddoc" method, which does the same.
see https://wiki.dolibarr.org/index.php?title=Module_Web_Services_API_REST_(developer)
the method is PUT on /documents/builddoc with a json objects with the following parameters (example) :
{ "modulepart": "invoice", "original_file": "FA2012-1234/FA2012-1234.pdf", "doctemplate": "crabe", "langcode": "fr_FR" }
I was using this module (dolibarr_apigendoc) but now I don't need it anymore :)
i have just seen there's this custom module but it seems that the api creation is not working in dolibarr 12.x anymore, i haven't been able to use 10.x+ versions.
When entering the correct URL with facture/ID?key=xxxx
the screen will stay blank. Not existing ID's will throw an error ofc.