This article is intended to help users understand how to use the Vodori API schema in order to create the API queries required by their application.
- Visit How to register your application if you have not yet registered your application with the Vodori API.
- Visit the Vodori API Quick Start Guide if you have not yet retrieved the Vodori API schema for your application.
It is recommended to use an application such as Altair GraphQL Client to view your schema. These clients will convert the schema.json file into an easily consumable and searchable resource.
Example from Altair GraphQL Client below
Selecting a Vodori GraphQL type displays additional type, field, and argument information.
DocumentCollection Type below
Further selecting argument information displays the fields available on the selected argument.
DocumentCollectionFilter type below
Selecting the fieldsFilter displays the fields available to each filter type. At this level, users are able to view the available postfixes available to the given filter.
FieldsFilter type below
Given the schema above, the following query can be used to retrieve documents with a kind of Promotional.
Query
{
documentCollection(
skip: 0
limit: 1000
where: {
fieldsFilter: {
kind:"promotional"
}
}
sortBy: { sortableField: CREATED, orderDirection: ASC }
) {
skip
limit
total
nodes {
fields {
kind
filename
expirationDate
}
sys {
documentId
}
}
}
}
Response
{
"data": {
"documentCollection": {
"skip": 0,
"limit": 1000,
"total": 2,
"nodes": [
{
"fields": {
"kind": "promotional",
"filename": "promotional-document-1.pdf",
"expirationDate": "2022-09-24T14:09:09.933Z"
},
"sys": {
"documentId": "1004-v1"
}
},
{
"fields": {
"kind": "promotional",
"filename": "promotional-document-1009.pdf",
"expirationDate": "2022-09-24T16:37:19.809Z"
},
"sys": {
"documentId": "1009-v2"
}
}
]
}
}
}As with all GraphQL requests, the node definition in the query drives the schema of the response object. Additional properties can be included or omitted from the node definition to meet the requirements of the consuming application.
While DocumentFilters and DocumentCollectionFilters can be used to retrieve out-of-the-box properties, customers are required to use customer-specific types to retrieve customer-specific properties and corresponding values.
Visit How to use customer-specific types with the Vodori API for more information on how to use these customer-specific types.
Comments
0 comments
Article is closed for comments.