My Products
Help
tommy nilsen
PARTNER

Download document

by tommy nilsen (Updated ‎28-11-2024 11:46 by tommy nilsen PARTNER )

I have attached a document to a voucher using the api mentioned here
https://docs.vismasoftware.no/businessnxtapi/howto/voucherdocument/
I used the File Service approach

How can I , at a later stage , download this document ?

 

This query

 

mutation {
useCompany(no: xxxx) {
incomingAccountingDocument_processings{ downloadIncomingDocument(filter:{incomingAccountingDocumentNo:{_eq:490}})
{
succeeded
}}}}

 

returns this result, but no document
{
"data": {
"useCompany": {
"incomingAccountingDocument_processings": {
"downloadIncomingDocument": {
"succeeded": true
}}}},
"extensions": {
"vbnxt-trace-id": "000000000000000044339d81760aab8c"
}}

5 REPLIES 5

by Øyvind Årseth

@tommy nilsen @Florian Haase Use the viewDocuments-processing to fetch the document, it should be available in all relevant tables.
The processing downloadIncomingDocument downloads documents from AutoInvoice to Business NXT🙂

Florian Haase
PARTNER

We did find the processing but it does return a guid in filepath (i think that proofs that the document is saved on blob). But filebytes is empty. 

If you get a guid with format "companyId.guid" in filePath the document is in Fileservice. Anyway, this processing returns documents regardless of storage location. Add args: {returnFileBytes: 1} to your mutation, I suspect it is missing?

Florian Haase
PARTNER

Thank you, now it works 🙂

Florian Haase
PARTNER

by Florian Haase

Is it not possible to download the documents again?