...
Page Properties | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
Resources & Remarks Modification History
|
Excerpt |
---|
In this tutorial, we will discuss various ways to retrieve objects via the Core API from the yuuvis® API system using an OkHttp3 Java client. |
Check out our graphical overview of the architecture which describes the basic use case flow for retrieving content or metadata.
Section | ||||||
---|---|---|---|---|---|---|
| ||||||
|
Requirements
To work through this tutorial, the following is required:
- Set-up yuuvis® API system (see
...
- Installation Guide)
A user with at least read permissions on a document type in the system (see tutorial for permissions) - Simple Maven project
...
Table of Contents
...
Maven Configuration
Our Java client will submit its requests to the Core API using OkHttp 3.12 by Square, Inc. Therefore, the following block must be added to the Maven dependencies in the pom.xml
of the project:
...
The direct access to a document takes place via its object ID via GET request to the endpoint /api/dms/objects/{objectId}
. The objectId
serves as a unique identifier of a document and can be obtained from the response of the API call of an import (see Tutorial for updating documents: Determining the objectId after import).
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
String objectId = "1234567890"; //example-objectId Request metadataRequest = new Request.Builder() .header("Authorization", "Basic " + auth) .header("X-ID-TENANT-NAME", tenant) .url(baseUrl+ "/api/dms/objects/" + objectId) .get().build(); Response metadataResponse = client.newCall(metadataRequest).execute(); String metadataResponseString = metadataResponse.body().string(); |
...
If a specific version of the document is to be requested, the endpoint to be called for the documents' metadata changes to /api/dms/objects/{objectId}/versions/{versionNr}
and for the documents' content to /api/dms/objects/{objectId}/versions/{versionNr}/contents/file
. More about this topic can be found in the Updating Documents via Core API tutorial tutorial under Versioning.
Retrieving Documents via Search Endpoint
The Core API provides a search endpoint (/api/dms/objects/search
) that can process search queries written in the proprietary CMIS-Based Search Query Language. The search query is sent to the search endpoint in JSON format in the body of a POST request.
...
Info | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||
More Tutorials
|