API to download document file

Hi Team,
I have a question related to API request to directly download the file. I tried the Swagger port to API and anything works fine with document_id and document_file_id. I copy pasted the curl code from the Swagger and tested in the terminal (and python), however I get “not found” (404) error. All other things via curl work (e.g. listing documents or cabinets). I used the download_url from the response listing all documents in a cabinet so I am sure I did not mess up the file and document IDs. The download process in the Swagger works. I am not sure what I am missing. I’d like to emphasize that this is a home project and I am not really experienced programmer. Thanks in advance!

Did you send the authentication token with the request?

1 Like

As @bwakkie suggests, when using Swagger you are accessing the API via the same user logged in the web interface.

If you want to access the API in another manner you need to send the credentials or an API key otherwise the system doesn’t know who it is talking to and cannot apply access controls.

I’d like to emphasize that this is a home project and I am not really experienced programmer.

While Mayan can work in home environments, it is not designed or meant for this.

Thanks for explanation. Please, you can delete that post.

I’ll keep searching for alternatives!