Development Guides

Retrieve stored Client Documents or Quarterly Report

Purpose: Reports that are run and stored as part of a quarterly or month end process can be retrieved from the client document endpoint. These may then be presented to or download by a user as part of an Advisor or Client Portal.

Simple Use Case:  Advisor wants to download the previous quarter’s portfolio evaluation report for review with a client.

Scope and Outputs: This solution is specifically for documents that have been created previously and then uploaded to the Household via the Report Batch tool, manually via the UI by a user, or via the API. For reports generated on demand, please refer to the guide on running PDF reports through the API.

Supported formats for stored documents include .pdf, .docx, .xlsx, .png, and .jpg. While a firm does have a default list of document categories, each customer can create new and custom document categories.

Process Overview:

  1. Call for a list of documents for a given client
  2. Download a document from the list given in the previous call

Process Steps:

  1. Using a given Client ID acquired by an input, search call, or client list, call for the list of documents available for that client.

GET /Portfolio/Clients/{clientId}/Documents

  1. Retrieve the document by passing the Client ID  and Document ID to the download endpoint.

GET /Portfolio/Clients/{client id}/Documents/{document id}/Download

Process Tips or Controls:

  1. The response from the document endpoint has three fields which are used to identify if the files are set to be viewable by Advisors, Reps, or Clients within the Report Batch feature. These flags are used with steps to ensure the Advisor or Rep level has had a chance to approve the statements before making them accessible. For example, if    “isViewable” = false, these documents should not be made available to a client user.

Fetch Documents for a ClientId
curl -X GET \
https://api.orionadvisor.com/api/v1/Portfolio/Clients/6/Documents \
 -H ‘authorization: Session {{OAS Token}}

Download document by clientId and documentId :
curl -X GET \
 https://api.orionadvisor.com/api/v1/Portfolio/Clients/6/Documents/6073/Download \
 -H ‘accept: application/octet-stream’ \
 -H ‘authorization: Session {{OAS Token}}