...
...
...
Page Properties |
---|
|
Product Version |
|
---|
Report Note |
|
---|
Assignee |
|
---|
Resources & Remarks Modification History Name | Date | Product Version | Action |
---|
Antje | 08 FEB 2021 | 2.4 | New page properties macro. |
|
Excerpt |
---|
This tutorial shows how documents can be imported into a yuuvis® API system via the Core API. During this tutorial, a short Java application will be developed that implements the HTTP requests for importing documents. A We additionally provide a JavaScript version of this tutorial can be found here. |
Check out our graphical overview of the architecture which describes the basic use case flow for importing documents.
Section |
---|
|
Column |
---|
Table of Contents Table of Contents |
---|
exclude | (Table of Contents|More Tutorials|Updating Documents|Retrieving Documents|Deleting Documents) |
---|
|
|
|
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
Column |
---|
Table of Contents Table of Contents |
---|
exclude | (Table of Contents|More Tutorials|Updating Documents|Retrieving Documents|Deleting Documents) |
---|
|
|
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:
...
We use a Request.Builder()
to create a request object with the multipart body, headers, and the URL. The following headers are necessary for the import because they contain user information of the user accessing the endpoint: Authorization header that contains the Base64-coded credentials of the user and an X-ID-TENANT-NAME header that contains the tenant name of the user. If the used OkHttp client supports cookie handling, the Authorization header can be omitted after the client's first request, since the logon information is stored in a session cookie (see alsoLogin Tutorial).
Code Block |
---|
language | java |
---|
title | Building a POST Request for an Import |
---|
linenumbers | true |
---|
|
Request request = new Request.Builder()
.header("Authorization", "Basic "+ auth)
.header("X-ID-TENANT-NAME", tenant)
.url(baseUrl + "/api/dms/objects") //baseUrl: "http://<host>:<port>"
.post(requestBody)
.build(); |
ResponseTo display the response of the API to the console, we create an associated response object when the request is executed. Please note that an IOException can be thrown by the OkHttpClient when creating the response object.
...
The assembly of the request object is identical to the normal import.
Response
If successful, the response object contains a multi-element objects
list that contains the metadata records of all objects imported in this batch import.
...
Info |
---|
|
More Tutorials
Section |
---|
Column |
---|
| This tutorial uses code examples to show how to import documents via Core API into a yuuvis® API system using a Java client. Insert excerpt |
---|
| Retrieving Documents via Core API |
---|
| Retrieving Documents via Core API |
---|
nopanel | true |
---|
| Keep reading
|
Column |
---|
| This tutorial introduces some ways to retrieve metadata or content from a DMS document in the yuuvis® system via Core API. via Core API | | Updating Documents via Core API |
---|
nopanel | true |
---|
| Keep reading |
Column |
---|
| A short tutorial that shows how to delete a DMS document in the yuuvis® system via Core API using the example of a Java client. Insert excerpt |
---|
| Deleting Documents via Core API |
---|
| Deleting Documents via Core API |
---|
nopanel | true |
---|
| Keep reading |
|
|