Get document data via API
You can get the document data by querying a context, like a contact or a portfolio, or by querying all documents with a certain tag or name.
Get documents within a context
The query below returns document data for a contact and also for its portfolios, transactions, trade orders and linked securities. Replace <contactID>
with a contact ID and run the query.
query { contact(id:<contactID>) { name documents { identifier fileName fullPath } portfolios { name documents { identifier fileName fullPath } transactions { security { name documents { identifier fileName fullPath } } documents { identifier fileName fullPath } } tradeOrders { documents { identifier fileName fullPath } } } } }
Get documents by tag, name, or path
Get documents with a certain tag. In the example below, the response will list all documents with the "Document signing-Waiting" tag.
query { documents(filterTags: ["Document signing-Waiting"]) { identifier fileName fullPath data mimeType url } }
Get documents with a certain name. In the example below, the response will list all documents with the Client.txt
name.
query { documents(filterText:"Client.txt") { identifier fileName fullPath data mimeType url } }
Get data related to the FileName.txt
document saved on the contact with ID 3.
query filterDocuments{ documents(filterText:"FileName.txt", path:"/Contacts/3/"){ identifier fileName fullPath data tags } }