Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Gini API enables you to upload a document as a single file or page by page, in parts.

Upload a single file document

This is the standard way of uploading a document to the Gini extraction system. A PDF document can contain single or multiple pages. JPEG and PNG documents are also accepted. When it is uploaded, it is processed by the system normally and without any adjustments regarding its structure.

Request
Headers

Header

Value

Content-Type

multipart/form-data; boundary=...

*/*

Accept

application/vnd.gini.v1+json

x-document-metadata-branchid

some customer specific id

x-document-metadata-deviceclass

desktop_device or mobile_device

...

  • branchid is used to group uploads from a specific client, for example, branches for banks

  • deviceclass specifies from which kind of device the upload comes, for example, if it was uploaded from a desktop computer or a smartphone

Requesting Query Parameters

If the upload is performed without multipart/form-data you can optionally provide a file name for the submitted document with a query parameter:

Name

Type

Description

filename

string

(Optional) File name of the submitted document.

Body

Only in case of Content-Type: multipart/form-data (applications running in a web browser):

Key

Description

Content-Disposition

form-data

file

File contents of document.

Response
Headers

Status Code

Description

201 (Created)

Operation is successful.

Header

Value

Content-Type

application/vnd.gini.v1+json

Location

Absolute URI (created document URI). Can be used to check progress and receive document information.

Errors

Status Code

Description

400 (Bad Request)

Returned when a file is sent in an invalid format.

401 (Unauthorized)

Authorization credentials are either missing, wrong or outdated.

415

Content type is not supported.

503

Service unavailable. Please retry later.

...

Info

application/vnd.gini.v1.partial+<FILE_TYPE>

For example, `application/vnd.gini.v1.partial+png` for images

Headers

Header

Value

Content-Type

multipart/form-data; boundary=...

*/*

Accept

application/vnd.gini.v1+json

x-document-metadata-branchid

some customer specific id

x-document-metadata-deviceclass

desktop_device or mobile_device

...

  • branchid is used to group uploads from a specific client (eg branches for banks)

  • deviceclass specifies from which kind of device the upload comes from. Eg. if it was uploaded from a desktop computer or a smart phone.

Request Query Parameters

Name

Type

Description

filename

string

(Optional) File name of the submitted document.

Body

File contents of the document.

Response
Headers

Status Code

Description

201 (Created)

Operation is successful.

Header

Value

Content-Type

application/vnd.gini.v1+json

Location

Absolute URI (created partial document URI) which should be referred by a composite document.

Errors

Status Code

Description

400 (Bad Request)

Returned when the sent file has invalid format.

401 (Unauthorized)

Authorization credentials are either missing, wrong or outdated.

415

Content type is not supported.

503

Service unavailable. Please retry later.

...

Info

application/vnd.gini.v1.composite+json

Headers

Header

Value

Content-Type

application/vnd.gini.v1.composite+json

Accept

application/vnd.gini.v1+json

Request Query Parameters

If the upload is performed without multipart/form-data, you can optionally provide a file name for the submitted document with a query parameter:

Name

Type

Description

filename

string

(Optional) File name of the submitted document.

Body

Raw bytes of the composite jsonJSON.

Key

Description

partialDocuments

A list of partial documents (the location is returned after the partial documents are successfully uploaded).

Response
Headers

Status Code

Description

201 (Created)

Operation is successful.

Header

Value

Content-Type

application/vnd.gini.v1+json

Location

Absolute URI of created document (document URI) to check progress and getting document information.

Errors

Status Code

Description

400 (Bad Request)

Returned when a file in an invalid format is sent

401 (Unauthorized)

Authorization credentials are either missing, wrong or outdated.

415

content type not supported.

503

Service unavailable. Please retry later.

...