How do you get a link to the pdf in GET /documents/download

I do have an external app to Dolibarr that requires to download a document and do something with the document. However, I am struggling to understand, how does one get the actual link to the PDF via REST API. Below is the response I am getting. Could please anyone help.

The GET /documents/download API documents read like this:

Note that, this API is similar to using the wrapper link “documents.php” to download a file (used for internal HTML links of documents into application), but with no need to have a session cookie (the token is used instead).

When I am using the internal HTML links, the documents download immediately when I am logged into Dolibarr. IF I am not logged in, Dolibarr prompts for a username and password. How can I simulate the same behaviour as the web browser.

I am able to login using the /login api. There is token returned in the response. How do I pass this in the subsequent request to Dolibarr?