Reply 3
Dat werkt inderdaad. De rechten waren het probleem.
Replies happen on the forum.
Go to sourceWe want to retrieve the packing slip PDFs generated by Exact Online for sales orders via Invantive. Are we accessing the correct tables/endpoints for this?
We use the UniversalSQL editor in Invantive Online. The ultimate goal is to store the PDFs for sales orders with DeliveryStatus = 21 in a separate SQL Server table and then export them to our WMS. We keep a local record of which files have been retrieved and processed.
In Exact Online we can open the associated packing slip and PDF via a goods delivery. This refers to the generated packing slip, not a manually added order attachment.
We can derive the document ID and the attachment ID from the browser links. We use the same Exact user in Exact Online and Invantive.
The administration code and GUIDs in the examples below are fictitious.
These tables do not return any rows:
ExactOnlineREST.Documents.DocumentsExactOnlineREST.Documents.DocumentsBulkExactOnlineREST.Documents.DocumentAttachmentsExactOnlineREST.Documents.DocumentAttachmentsBulkDocumentAttachmentFilesIncrementalEven a targeted search using the known attachment ID yields no results:
use 1234567@eol;
select ID
, Document
, FileName
, Url
from ExactOnlineREST.Documents.DocumentAttachments@eol
where ID = to_guid('11111111-2222-3333-4444-555555555555');
For data previously retrieved from GoodsDeliveries, the fields Document and DocumentSubject are empty.
Using the known download link, we can successfully retrieve the binary PDF content:
use 1234567@eol;
select DocumentContents as PdfContent
from ExactOnlineHTML.Documents.AttachmentByUrl@eol
(
'https://start.exactonline.nl/docs/SysAttachment.aspx?Download=1&ID=11111111-2222-3333-4444-555555555555&_Division_=1234567'
);
Downloading a known attachment therefore works. What is still missing is the ability to automatically identify the correct document/attachment ID for a goods delivery or packing slip.
Our questions
Documents and DocumentAttachments, or do generated packing slips follow a different path?AttachmentByUrl?The route via the Document* tables should work.
Advice is to check the rights of the Exact Online user used within Exact Online to request this information.
In SessionIOs@DataDictionary you can possibly check whether an HTTP 403 occurs; it signals within "no rows" whether there is an authorization problem.
Dat werkt inderdaad. De rechten waren het probleem.
Nieuwe vraag afgesplitst naar: Printen pakbon via Invantive