Download a document's contents

The bytes behind one entry from the loan's document list.

This is the only call on the v4 API whose success is not the standard
{data, meta} envelope.
A document is a file, so a successful
response is the file, with its type and filename in the usual headers.
Failures are still enveloped, so you tell the two apart by status code
and Content-Type exactly as you would anywhere else.

Read retrievable on the document first. Several kinds of entry on
a loan hold no file we can serve — a report a provider has not returned
yet, a link to a document in someone's Google Drive, a record whose file
was never stored. They look entirely ordinary in the list, which is why
that flag exists.

Three possible answers

  • 200 with the file — Content-Type is the document's own type.
  • 200 with JSON — the document lives at an external service (Google
    Drive, Dropbox, Box) and we hold no copy of it. The body is the usual
    envelope and data.url is the address recorded against it.
  • An error — everything else. error.details.reason names the case
    precisely, and for a vendor report error.details.retryable says
    whether waiting will help.

⚠️ Two of those are 200, so check Content-Type before writing the
body to a file.
application/json means you were handed a link, not
a document. This used to be a redirect instead; that was removed because
an API client has no browser session with Google or Dropbox, so
following it returned a sign-in page which clients then saved as the
document.

⚠️ Range requests are not supported. No Accept-Ranges is sent, a
Range header is ignored, and every request transfers the whole file.
A browser PDF viewer cannot seek within one of these.

⛔ The id is not a number and must not be built by hand. Use the
value the document list or the checklist returned, as-is.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
integer
required
≥ 1

The loan file id.

string
required

The opaque code the document list returned for this document. Send it back exactly as received.

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/octet-stream
application/json