...
...
...
...
...
Page Properties | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
Resources & Remarks
Modification History
|
Excerpt |
---|
This tutorial shows how documents can be imported into a yuuvis® API system via the Core API. This tutorial is an extension of the Java import tutorial, applying its concepts to a different popular programming language, JavaScript. |
Section |
Column |
Check out our graphical overview of the architecture which describes the basic use case flow forimporting documents.
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)
Column | ||||
---|---|---|---|---|
Table of Contents
|
Project Requirements
...
Project Requirements
In this tutorial, we are going to implement the yuuvis® API Import HTTP POST Request in JavaScript. Our Goal is to import documents using the yuuvis® API. For access to the yuuvis® API, make sure you provide credentials and a valid base URL to your script like this:
...
Code Block | ||||
---|---|---|---|---|
| ||||
var singleFormData = new FormData() var metadataBlob = new Blob([JSON.stringify(singleMetadata)],{type:"application/json"}) var contentBlob = new Blob([file],{type:"text/plain"}) singleFormData.append('data', metadataBlob, "metadata") singleFormData.append('cid_63apple', contentBlob, "contentdata") |
Assembling the Request
Now that we have created JSON representations for our content and metadata, we can assemble our multipart HTTP request object. We are going to go over some simple methods to accomplish this and give examples for both browser-based front-end and node.js-based back-end applications.
...
Code Block | ||||
---|---|---|---|---|
| ||||
var multiFormData = new FormData() var metadataBlob = new Blob([JSON.stringify(singleMetadata)],{type:"application/json"}) var contentBlob1 = new Blob([file],{type:"text/plain"}) var contentBlob2 = new Blob([file2],{type:"text/plain"}) multiFormData.append('data', metadataBlob, "metadata") multiFormData.append('cid_63apple', contentBlob1, "contentdata1") multiFormData.append('cid_64apple', contentBlob2, "contentdata2") |
Assembling the Request
The multipart request JSON assembly is similar to the singular import. The same function executeRequest(request_object)
can be used to send the request.
...
Info | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||
More Tutorials
|