Link Resource

Allows users to share a document content through a public link(s).
Users do not need to authenticate to access a document using a link. However, links availability can be limited to a certain time if necessary.

Allows users to generate one or many links from a set of document versions. One link will be returned for each document version provided.

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.

Table 1. Headers
Name Example Description

Content-Type

multipart/form-data

The Content-Type entity header is used to indicate the media type of the resource. In this case, it must be multipart/form-data

Document-Store

invoice_store

Document Store identifier

Authorization

Bearer ha9r6DG4e5AQ84gferAd8EQ…​

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

Access-User

john@company.com
or john
or 211555
or …​

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.

Query parameters

Table 2. Query parameters
Name Value Detail

inline

true or false

Optional boolean query parameter. The response will include the content-disposition header. If true the header value will be inline. On the contrary, if it is 'false', the value will be 'attached'. Default value: `true`

Body

As indicated by headers, the body of the http request must be a JSON.

There is a limit of 20 links for each call.
{
  "documents": [
    {
      "id": "bhbnbzkolnbcrlla7gf4zt4ubi",
      "version": 1.0
    },
    {
      "id": "bksgdpkolnbcrlla7gf4zjhgvp",
      "version": 3.0
    }
  ],
  "ttl": "10d"
}
Table 3. Body
Name Value Detail

id

bhbnbzkolnbcrlla7gf4z

Document id from the document we want to create the link

version

1.0

Optional: Indicates which one of the versions will be downloaded. Default: current one.

ttl

10d

Optional: TTL (Time To Live) is the time for a link is valid. Permit values: 15s, 10d, 20d, 30d, no-limit. Default: 10 days.

Responses

Successful responses can be easily identified being always 20x (e.g. 200, 201).

Table 4. Success response
Field Example Description

Status code

200

OK

Content-Type

application/json

The Content-Type entity header is used to indicate the media type of the resource. In this case, it must be application/json

include::partial$tables/headers.adoc[tag=body-json-response-link](s)

HTTP Headers

Table 5. Headers
Name Example Description

Content-Disposition

inline or attachment

If inline the content can be displayed inside the web page. If attachment the content should be downloaded

JSON response
[{
    "id": "bhbnbzkolnbcrlla7jct",
    "version": "1.0",
    "location": "https://api.everisbigcontent.com/edms/rest/v1/links/D2cDdblmft"
  },
  {
    "id": "ehbnbzkolnjgdnckrled",
    "version": "3.0",
    "location": "https://api.everisbigcontent.com/edms/rest/v1/links/R2cDodtyd"
  }
]
Table 6. Link
Name Value Detail

id

bhbnbzkolnbcrlla7gf4z

Id from the document we want to create the link

location

https://api.everisbigcontent.com/edms/rest/v1/links/D2cDdbgvju

The link to download a document

Query parameters

Table 7. Query parameters
Name Value Detail

inline

true or false

Optional boolean query parameter. The response will include the content-disposition header. If true the header value will be inline. On the contrary, if it is 'false', the value will be 'attached'. Default value: `true`

Error

In case of error, the response body contains a JSON object with additional information:

  • id: Document id

  • version: Version number of the content

  • code: HTTP error code of the equivalent request

  • msg: Descriptive message of the error

    Error messages should not be used to validate errors since they may be subject to change.
Example
[{
    "id":"qga8r5hsy9rw5weggf93lopa58",
    "version":"1.0",
    "error":{
      "code":"400",
      "msg":"document not found"
    }
}]
Table 8. Error messages
Status code Message Description

400

Malformed JSON exception (line _, col _): …​

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

over twenty document not permitted

There are a limit of 20 links, that you can create for a one call.

400

document id is mandatory

Field id was sent as null/empty value

400

TTL format not valid

Field ttl was sent as null/invalid value

400

version format not valid

Field version was sent as null/invalid value

401

Malformed token

The token sent is not valid

401

The Document-Store header must be set

The header indicating the document store that you want to access, must be set

403

Unauthorized

We dont have access to that document store, or it is misspelled

404

No match found for the Id

The document doesn’t exists in the specified Document Store

404

document version does not exist

The version of the document was not found

415

Content type _ not supported

The Content-Type header is not correctly set

500

Internal server error

If it happens consistently, please report it on our forum

Code examples

  • cURL

  • Java

  • Node.js

curl "https://api.everisbigcontent.com/edms/rest/v1/links"\
-X POST \
-H "Authorization: Bearer ha9r6DG4e5AQ84gferAd8EQ" \
-H "Document-Store: invoice_store" \
-H "Content-Type: application/json" \
-d "{ \"documents\": [ { \"id\": \"kcwylhbjwzgjrey7oij3\" }], \"ttl\": \"10d\" }"
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

String url = "https://dev-api.everisbigcontent.com:9090/edms/rest/v1/links";
String JSON = "{ \"documents\": [ { \"id\": \"kcwylhbjwzgjrey7oij3jokuyh\" }], \"ttl\": \"10d\" }";

HttpPost httpPost = new HttpPost(url);
httpPost.setHeader("Authorization","Bearer " + "ha9r6DG4e5AQ84gferAd8EQ...");
httpPost.setHeader("Content-Type", "application/json");
httpPost.setHeader("Document-Store", invoice_store);
httpPost.setEntity(new StringEntity(JSON));

CloseableHttpClient client = HttpClients.createDefault();
CloseableHttpResponse execute = client.execute(httpPost);
HttpEntity entity = execute.getEntity();

String jsonResponse = EntityUtils.toString(entity, StandardCharsets.UTF_8);
var request = require('request');
var token = 'ha9r6DG4e5AQ84gferAd8EQ...'

request.post({
  headers: {
    'Content-Type': 'application/json',
    'Document-Store': 'big_content_dev',
    'Authorization': 'Bearer ' + token,
  url: 'https://api.everisbigcontent.com/edms/rest/v1/links',
  json: {
    "documents": [ { "id": "kcwylhbjwzgjrey7oij3jhfdes" }], "ttl": "10d"
  }
}, function (error, response, body) {
  console.log(body)
});

Creates a single link for a document, only will be valid for 15 seconds.

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.

Table 9. Headers
Name Example Description

Document-Store

invoice_store

Document Store identifier

Content-Type

application/json

The Content-Type entity header is used to indicate the media type of the resource. In this case, it must be application/json

Query parameters

Table 10. Query parameters
Name Value Detail

inline

true or false

Optional boolean query parameter. The response will include the content-disposition header. If true the header value will be inline. On the contrary, if it is 'false', the value will be 'attached'. Default value: `true`

Body

As indicated by headers, the body of the http request must be a JSON.

The link created only will be valid for 15 seconds.
{
  "id": "bhbnbzkolnbcrlla7gf4zt4ubi",
  "version": 1.0
}
Table 11. Body
Name Value Detail

id

bhbnbzkolnbcrlla7gf4z

Document id from the document we want to create the link

version

1.0

Optional: Indicates which one of the versions will be downloaded. Default: current one.

Responses

Successful responses can be easily identified being always 20x (e.g. 200, 201).

Table 12. Success response
Field Example Description

Status code

200

OK

Content-Type

application/json

The Content-Type entity header is used to indicate the media type of the resource. In this case, it must be application/json

Body

JSON response

JSON object containing the link

HTTP Headers

Table 13. Headers
Name Example Description

Content-Disposition

inline or attachment

If inline the content can be displayed inside the web page. If attachment the content should be downloaded

JSON response
[
  {
    "id": "bhbnbzkolnbcrlla7jct",
    "location": "https://api.everisbigcontent.com/edms/rest/v1/links/embeddable/D2cDdblmft"
  }
]
Table 14. Link
Name Value Detail

id

bhbnbzkolnbcrlla7gf4z

Id from the document we want to create the link

location

https://api.everisbigcontent.com/edms/rest/v1/links/embeddable/D2cDdbgvju

The link to download a document

Error

In case of error, the response body contains a JSON object with additional information:

  • id: Document id

  • version: Version number of the content

  • code: HTTP error code of the equivalent request

  • msg: Descriptive message of the error

    Error messages should not be used to validate errors since they may be subject to change.
Example
[{
    "id":"qga8r5hsy9rw5weggf93lopa58",
    "version":"1.0",
    "error":{
      "code":"400",
      "msg":"document not found"
    }
}]
Table 15. Error messages
Status code Message Description

400

Malformed JSON exception (line _, col _): …​

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

document id is mandatory

Field id was sent as null/empty value

400

version format not valid

Field version was sent as null/invalid value

401

Malformed token

The token sent is not valid

401

The Document-Store header must be set

The header indicating the document store that you want to access, must be set

403

Unauthorized

We dont have access to that document store, or it is misspelled

404

No match found for the Id

The document doesn’t exists in the specified Document Store

404

document version does not exist

The version of the document was not found

415

Content type _ not supported

The Content-Type header is not correctly set

500

Internal server error

If it happens consistently, please report it on our forum

Code examples

  • cURL

  • Java

  • Node.js

curl "https://api.everisbigcontent.com/edms/rest/v1/links/embedabble"\
-X POST \
-H "Authorization: Bearer ha9r6DG4e5AQ84gferAd8EQ" \
-H "Document-Store: invoice_store" \
-H "Content-Type: application/json" \
-d "{ \"id\": \"kcwylhbjwzgjrey7oij3\"}"
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

String url = "https://dev-api.everisbigcontent.com:9090/edms/rest/v1/links/embedabble";
String JSON = "{\"id\": \"kcwylhbjwzgjrey7oij3jokuyh\"}";

HttpPost httpPost = new HttpPost(url);
httpPost.setHeader("Authorization","Bearer " + "ha9r6DG4e5AQ84gferAd8EQ...");
httpPost.setHeader("Content-Type", "application/json");
httpPost.setHeader("Document-Store", invoice_store);
httpPost.setEntity(new StringEntity(JSON));

CloseableHttpClient client = HttpClients.createDefault();
CloseableHttpResponse execute = client.execute(httpPost);
HttpEntity entity = execute.getEntity();

String jsonResponse = EntityUtils.toString(entity, StandardCharsets.UTF_8);
var request = require('request');
var token = 'ha9r6DG4e5AQ84gferAd8EQ...'

request.post({
  headers: {
    'Content-Type': 'application/json',
    'Document-Store': 'big_content_dev',
    'Authorization': 'Bearer ' + token},
  url: 'https://api.everisbigcontent.com/edms/rest/v1/links/embedabble',
  json: {
    "id": "kcwylhbjwzgjrey7oij3jhfdes"
  }
}, function (error, response, body) {
  console.log(body)
});

The operation downloads a document, deciphering a hash passed via a link, the link and hash is generated in the Create Link operation.

The way to call this operation is with the response of the Create link operation mentioned above.

Parameters

Path

Table 16. Path
Name Value Detail

Hash

hgFxTdnIh1xTd171qZx1iQYce4_BrrzGpDhOknJGjMU-JUhigR1R_EbID4TdClrhwJDBGCz26x9Wt1aN6uN6Ftd4U3zA-Vy4P7rMO-fGUvkbNCAPLBZilUFXbenzUx-vcO90EUBZqlgaAjv-eHoEY=

Unique non-sequential auto-generated hash of the document

Query parameters

Table 17. Query parameters
Name Value Detail

inline

true or false

Optional boolean query parameter. The response will include the content-disposition header. If true the header value will be inline. On the contrary, if it is 'false', the value will be 'attached'. Default value: `true`

Responses

Successful responses can be easily identified being always 20x (e.g. 200, 201).

Table 18. Success response
Field Example Description

Status code

200

OK

Content-Type

application/pdf

The Content-Type entity header is used to indicate the media type of the resource. For example, it could be application/pdf or image/jpeg

Content-Disposition

[inline or attachment]; filename=“invoice11.pdf”;

If inline the content can be displayed inside the web page. If attachment the content should be downloaded. Filename is the content name

Body

HTTP Binary data

A stream data over http that contains the file

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 for Bad 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.
Example
{
  "span-id" : "b1652500-5b7d-4f7c-8cf0-b21f12ac76e5",
  "message" : "Malformed hash exception"
}
Table 19. Error messages
Status code Message Description

400

Malformed hash exception

The hash sent is not valid

500

Internal server error

If it happens consistently, please report it on our forum

Nothing

Unsecured Conection

When access at the link, you see browser that isn’t supported. Please see System Requirements

Code examples

  • cURL

  • Java

  • Node.js

curl -o filename.txt "https://api.everisbigcontent.com/edms/rest/v1/links/hgFxTdnIh1xTd171qZx1iQYce4_BrrzGpDhOknJGjMU-JUhigR1R_EbID4TdClrhwJDBGCz26x9Wt1aN6uN6Ftd4U3zA-Vy4P7rMO-fGUvkbNCAPLBZilUFXbenzUx-vcO90EUBZqlgaAjv-eHoEY=?inline=true"
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
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/links/hgFxTdnIh1xTd171qZx1iQYce4_BrrzGpDhOknJGjMU-JUhigR1R_EbID4TdClrhwJDBGCz26x9Wt1aN6uN6Ftd4U3zA-Vy4P7rMO-fGUvkbNCAPLBZilUFXbenzUx-vcO90EUBZqlgaAjv-eHoEY=?inline=true";

HttpGet get = new HttpGet(url);

CloseableHttpClient client = HttpClients.createDefault();
CloseableHttpResponse execute = client.execute(get);
HttpEntity entity = execute.getEntity();

byte[] bytes = EntityUtils.toByteArray(entity);
File f = new File("filename.txt");
FileOutputStream os = new FileOutputStream(f);
os.write(bytes);
os.flush();
var request = require('request');

request.get({
headers: {},
url: "https://api.everisbigcontent.com/edms/rest/v1/links/hgFxTdnIh1xTd171qZx1iQYce4_BrrzGpDhOknJGjMU-JUhigR1R_EbID4TdClrhwJDBGCz26x9Wt1aN6uN6Ftd4U3zA-Vy4P7rMO-fGUvkbNCAPLBZilUFXbenzUx-vcO90EUBZqlgaAjv-eHoEY=?inline=true",
}, function(error, response, body){
});