Documents
Create Document
Creates a document in the Document Store. A document is formed by the metadata and the file(s).
The metadata has some system fields that are automatically managed (id
, _hidden
, author
, dateCreated
, dateModified
, lastModifier
, currentVersion
, content
and documentStore
) and some fields that we can send as parameters when creating the document (description
and categories
).
When setting a date property, keep in mind that we accept both timestamps and date formatted strings. The timestamp follows Unix time conventions, representing the time in milliseconds since January 1st, 1970 UTC.
In case of using a string, it must adhere to the following format Make sure you set the correct timezone during creation or update, that is the one where the documents are created or consulted. Otherwise users may experience troubles locating documents. |
The content type is automatically inferred from the file extension.
Parameters
HTTP Headers
HTTP headers allow pass additional information with the request or the response. BigContent headers are used for recurrent details like authentication or document store.
Name | Example | Description |
---|---|---|
|
The Content-Type entity header is used to indicate the media type of the resource.
In this case, it must be |
|
|
|
Document Store identifier |
|
|
Mandatory header of String type that authorizes you as the user with the right to execute this operation. The string is a Bearer Token returned from the operation create token |
|
john@company.com |
Optional header that allows to send an additional user identifier associated with the operation. May be required depending on specific document store configuration. The value is a free style string to identify the individual user who has sent the request. |
|
|
Establishes if the content is sent in chunks according to rfc7230 (https://tools.ietf.org/html/rfc7230#section-4.1). Required to send files of 2048MB or larger. |
Multipart body
The body’s type is multipart/form-data
.
It contains the two entities that compose a document, the file and the metadata.
Name | Example | Description |
---|---|---|
metadata |
It is a Json object that provides information about the document. |
|
file |
- |
The file we want to store in the system. |
Metadata JSON object must to be sent with encoding UTF-8 (RFC 7159/8.1. Character Encoding). If it is not sent in UTF-8, metadata and filename may be incorrectly stored, and even for some special cases operations may fail with error message. |
- Metadata Example
{
"description" : "Invoice template",
"categories" : [
{
"_name": "template",
"Type": "invoice",
"date": "2018-10-24T07:10:51.709Z",
"boolean": true
}
]
}
Responses
Success
Successful responses can be easily identified being always 20x (e.g. 200, 201).
Field | Value | Description |
---|---|---|
Status code |
|
|
|
|
The Content-Type entity header is used to indicate the media type of the resource.
In this case, it must be |
Body |
|
A unique ID auto generated that identifies the document. |
Error
In case of error, the response body contains a JSON object with additional information:
-
span-id
: auto-generated identifier of the request. Please provide this when asking for support in our forum. -
message
: descriptive message of the error. This is aimed for developers and is specially important forBad Request
errors., where contains hints on how to fix the request.Error messages should not be used to validate errors since they may be subject to change.
{
"span-id" : "7eb38962-2618-85f9-brte-4f15f6729590",
"message" : "No match found for the Id"
}
Status code | Message | Description |
---|---|---|
400 |
|
The JSON body has a bad structure. Message points where is the problem with line and column numbers as well as what is the problem (e.g. double "{", or a missing ",", …) |
400 |
|
The encoding used to send the object was not |
400 |
|
The category name is null, have blank value or was not sent |
400 |
|
The category definition with the specified name, does not have that property |
400 |
|
The category property type does not match the one we are sending.
For example, it expects a |
400 |
|
We are not sending the value for a mandatory property |
400 |
|
No category has been found to match the |
400 |
|
The category you are trying to assign is already assigned If you want to modify it, you must delete and reassign it, or use update metadata |
400 |
|
The category property has a valid set of values, and the one we are sending is not valid |
400 |
|
The category property has a valid set of values, and the one we are sending is not valid |
401 |
|
Has passed more than an hour since the last create token or refresh token operation |
401 |
|
The token sent is not valid |
401 |
|
An empty token has been sent |
401 |
|
The header indicating the document store that you want to access, must be set |
403 |
|
We dont have access to that document store, or it is misspelled |
404 |
|
The document doesn’t exists in the specified Document Store |
415 |
|
The Content-Type header is not correctly set |
429 |
|
Contact with the service provider to increase your service plan. |
500 |
|
If it happens consistently, please report it on our forum |
Code examples
curl "https://api.everisbigcontent.com/edms/rest/v1/documents" \
-X POST \
-H 'Content-Type: multipart/form-data' \
-H "Authorization: Bearer ha9r6DG4e5AQ84gferAd8EQ..." \
-H "Document-Store: invoice_store" \
-F metadata='{"description" : "Invoice template"};type=application/json' \
-F file=@file_path
json=$(echo '{"description":"Encoding characters: á ö $ % &"};type=application/json' | iconv -f iso-8859-1 -t UTF-8)
curl "https://api.everisbigcontent.com/edms/rest/v1/documents" \
-X POST \
-H 'Content-Type: multipart/form-data' \
-H "Authorization: Bearer ha9r6DG4e5AQ84gferAd8EQ..." \
-H "Document-Store: invoice_store" \
-F metadata=json \
-F file=@file_path
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
String url = "https://api.everisbigcontent.com/edms/rest/v1/";
String token = "Bearer ha9r6DG4e5AQ84gferAd8EQ...";
String documentStore = "invoice_store";
File file = new File("src/main/resources/invoice.pdf");
String metadata = "{"description" : "Invoice template"}";
HttpPost post = new HttpPost(url);
post.setHeader("Authorization", token);
post.setHeader("Document-Store", documentStore);
byte[] bytes = Files.readAllBytes(file.toPath());
HttpEntity multipart = MultipartEntityBuilder.create()
.addTextBody("metadata", metadata, ContentType.APPLICATION_JSON)
.addBinaryBody("file", file, ContentType.DEFAULT_BINARY, "text.txt")
.build();
post.setEntity(multipart);
CloseableHttpClient client = HttpClients.createDefault();
CloseableHttpResponse execute = client.execute(post);
HttpEntity entity = execute.getEntity();
String jsonResponse = EntityUtils.toString(entity, StandardCharsets.UTF_8);
var request = require('request');
var fs = require('fs');
var token = "ha9r6DG4e5AQ84gferAd8EQ...";
var documentStore = "invoice_store";
var formData = {
file: {
value: fs.createReadStream("./resources/invoice.pdf"),
options: {
contentType: 'application/pdf'
}
},
metadata: {
value: `{"description" : "Invoice template"}`,
options: {
contentType: 'application/json'
}
}
}
request.post({
headers: {
"Authorization": "Bearer " + token,
"Content-Type": "multipart/form-data",
"Document-Store": "documentStore"
},
url: 'https://api.everisbigcontent.com/edms/rest/v1/documents',
formData : formData
}, function(error, response, body){
console.log(body);
});
Delete Document
Deletes a document, including all its contents and metadata from the document store.
Optionally, users with administrative rights can override the document store’s default deletion policy adding the type
parameter.
In other words, if no type is set, the document store default value is applied.
There are 3 supported different types of deletion: metadata_flagging
, metadata_deletion
and physical_deletion
.
Any of them can be set as the default one in the document store.
Being metadata_flagging
set automatically as the default value.
-
metadata_flagging
: doesn’t actually delete any information about the document. Instead, it sets the deleted document or content as hidden, so only users with administration privileges are able to manipulate them.
Hidden documents are flagged with the_hidden
property, which is only visible by administrators. Once hidden, a document or content can be easily restored by admins using the appropriate operations (restore document, restore content). -
metadata_deletion
: deletes only the metadata, without deleting the binary contents. The binary files will be unreachable, even for admins, but won’t be lost. If a restore is needed, make a request to the BigContent support team. -
physical_deletion
: deletes the whole document permanently, including both metadata and content files. Restoration WILL NOT be possible under ANY circumstances.
Parameters
HTTP Headers
HTTP headers allow pass additional information with the request or the response. BigContent headers are used for recurrent details like authentication or document store.
Name | Example | Description |
---|---|---|
|
|
Document Store identifier |
|
|
Mandatory header of String type that authorizes you as the user with the right to execute this operation. The string is a Bearer Token returned from the operation create token |
|
john@company.com |
Optional header that allows to send an additional user identifier associated with the operation. May be required depending on specific document store configuration. The value is a free style string to identify the individual user who has sent the request. |
Path
Name | Value | Detail |
---|---|---|
id |
|
Unique non-sequential auto-generated identifier of the document |
Query Parameters
Name | Value | Detail |
---|---|---|
|
|
Type of deletion to be applied. Overrides the type defined in the document store configuration |
Type | Explanation |
---|---|
|
The document |
|
All the metadata of the document is permanently deleted. Only the binary files will be preserved. (If a restore is needed, make a request to the BigContent support team) |
|
The whole document is permanently deleted, including both metadata and binary files. Restoration will not be possible under ANY circumstances. |
Responses
Success
Successful responses can be easily identified being always 20x (e.g. 200, 201).
Field | Example | Description |
---|---|---|
Status code |
|
|
Error
In case of error, the response body contains a JSON object with additional information:
-
span-id
: auto-generated identifier of the request. Please provide this when asking for support in our forum. -
message
: descriptive message of the error. This is aimed for developers and is specially important forBad Request
errors., where contains hints on how to fix the request.Error messages should not be used to validate errors since they may be subject to change.
{
"span-id" : "7eb38962-2618-85f9-brte-4f15f6729590",
"message" : "No match found for the Id"
}
Status code | Message | Description |
---|---|---|
400 |
|
You have sent a deletion type different from |
401 |
|
Has passed more than an hour since the last create token or refresh token operation |
401 |
|
The token sent is not valid |
401 |
|
An empty token has been sent |
401 |
|
The header indicating the document store that you want to access, must be set |
403 |
|
We dont have access to that document store, or it is misspelled |
403 |
|
Physical deletion is an operation reserved for admins. |
404 |
|
The document doesn’t exists in the specified Document Store |
500 |
|
If it happens consistently, please report it on our forum |
Code examples
$ curl "https://api.everisbigcontent.com/edms/rest/v1/documents/qga8r5hsy9rw5weggf93lopa58?type=metadata_flagging" \
-X DELETE \
-H "Authorization: Bearer ha9r6DG4e5AQ84gferAd8EQ..." \
-H "Document-Store: invoice_store"
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.*;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
String url = "https://api.everisbigcontent.com/edms/rest/v1/documents/qga8r5hsy9rw5weggf93lopa58?type=metadata_flagging";
String token = "Bearer ha9r6DG4e5AQ84gferAd8EQ...";
String documentStore = "invoice_store";
HttpDelete delete = new HttpDelete(url);
delete.setHeader("Authorization", token);
delete.setHeader("Document-Store", documentStore);
CloseableHttpClient client = HttpClients.createDefault();
CloseableHttpResponse execute = client.execute(delete);
HttpEntity entity = execute.getEntity();
var request = require('request');
var token = "ha9r6DG4e5AQ84gferAd8EQ...";
var documentStore = "invoice_store";
request.delete({
headers: {
'Authorization': 'Bearer ' + token,
'Document-Store': documentStore
},
url: 'https://int-api.everisbigcontent.com/edms/rest/v1/documents/qga8r5hsy9rw5weggf93lopa58?type=metadata_flagging'
}, function (error, response, body) {
});
Restore Document
Restores the specified document if it is hidden.
Only user with admin privileges can perform this operation |
Parameters
HTTP Headers
HTTP headers allow pass additional information with the request or the response. BigContent headers are used for recurrent details like authentication or document store.
Name | Example | Description |
---|---|---|
|
|
Document Store identifier |
|
|
Mandatory header of String type that authorizes you as the user with the right to execute this operation. The string is a Bearer Token returned from the operation create token |
|
john@company.com |
Optional header that allows to send an additional user identifier associated with the operation. May be required depending on specific document store configuration. The value is a free style string to identify the individual user who has sent the request. |
|
|
The Content-Type entity header is used to indicate the media type of the resource.
In this case, it must be |
Path
Name | Value | Detail |
---|---|---|
id |
|
Unique non-sequential auto-generated identifier of the document |
Body
As indicated by headers, the body of the http request must be a JSON.
- Restore Example
{
"_hidden" : false
}
Responses
Success
Successful responses can be easily identified being always 20x (e.g. 200, 201).
Field | Example | Description |
---|---|---|
Status code |
|
|
Error
In case of error, the response body contains a JSON object with additional information:
-
span-id
: auto-generated identifier of the request. Please provide this when asking for support in our forum. -
message
: descriptive message of the error. This is aimed for developers and is specially important forBad Request
errors., where contains hints on how to fix the request.Error messages should not be used to validate errors since they may be subject to change.
{
"span-id" : "7eb38962-2618-85f9-brte-4f15f6729590",
"message" : "No match found for the Id"
}
Status code | Message | Description |
---|---|---|
400 |
|
The JSON body has a bad structure. Message points where is the problem with line and column numbers as well as what is the problem (e.g. double "{", or a missing ",", …) |
401 |
|
Has passed more than an hour since the last create token or refresh token operation |
401 |
|
The token sent is not valid |
401 |
|
An empty token has been sent |
401 |
|
The header indicating the document store that you want to access, must be set |
403 |
|
We dont have access to that document store, or it is misspelled |
404 |
|
The document doesn’t exists in the specified Document Store |
415 |
|
The Content-Type header is not correctly set |
500 |
|
If it happens consistently, please report it on our forum |
Code examples
curl "https://api.everisbigcontent.com/edms/rest/v1/metadata/qga8r5hsy9rw5weggf93lopa58" \
-X PUT \
-H "Authorization: Bearer ha9r6DG4e5AQ84gferAd8EQ..." \
-H "Document-Store: invoice_store" \
-H 'Content-Type: application/json' \
-d '{"_hidden" : false}'
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
String url = "https://api.everisbigcontent.com/edms/rest/v1/metadata/qga8r5hsy9rw5weggf93lopa58";
String token = "Bearer ha9r6DG4e5AQ84gferAd8EQ...";
String documentStore = "invoice_store";
HttpPut put = new HttpPut(url);
put.setHeader("Authorization", token);
put.setHeader("Document-Store", documentStore);
StringEntity json = new StringEntity("{\"_hidden\": false}");
json.setContentType(ContentType.APPLICATION_JSON.toString());
put.setEntity(json);
CloseableHttpClient client = HttpClients.createDefault();
CloseableHttpResponse execute = client.execute(put);
HttpEntity entity = execute.getEntity();
var request = require('request');
var token = "Bearer ha9r6DG4e5AQ84gferAd8EQ...";
var documentStore = "invoice_store";
request.put({
headers: {
"Authorization": token,
"Document-Store": documentStore
},
url: "https://api.everisbigcontent.com/edms/rest/v1/metadata/qga8r5hsy9rw5weggf93lopa58",
json : {"_hidden" : false}
}, function(error, response, body){
console.log(body);
});