...
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. |
We additionally provide a JavaScript version of this tutorial. 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) |
---|
|
|
|
...
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(); |
...