This endpoint is used to directly view a document based on the unique identifier.
By default, the document is streamed inline. Optionally, by passing ?mode=url, the endpoint returns a short-lived signed URL instead.
Definition
Route: /documents/{document_id}/view
Method: GET
OperationId: View
Permissions
The user must be a member of one of the following groups to view a document:
documents:manager
documents:viewer
Request
Headers
Name
Description
Notes
accept
The expected format of the response
application/octet-stream
osg-client-id
The unique identifier assigned to your organization
client_customer_id
The unique identifier assigned to your client
correlation_id
The unique identifier for correlation
Parameters
Name
Type
Description
document_id
string
The unique identifier of the document
Query Parameters
Name
Type
Description
mode
string
Optional. When set to url, the endpoint returns a short-lived signed URL instead of streaming the document inline. If omitted, the document is streamed inline.
Tip
When retrieving a document that was generated using SendCommunication the DocumentId is the same as the CommunicationId.
Responses
Success (Inline)
Returned when mode is not specified. The document is streamed inline.
Headers
Key
Value
Type
Description
content-disposition
attachment; filename={filename}
FileStream
content-type
{mimeType}
string
Status
Description
Body
200
The request was successful.
FileStream
Success (URL Mode)
Returned when mode=url is specified. The endpoint returns a JSON body containing a short-lived, signed URL that provides access to the requested document only.