Versions Compared

Key

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

...

Code Block
[ {
  "documentId" : "DOC123edf",
  "uploadId" : "UPxx456",
  "uploadedDate" : "2016-09-20T14:03:00.152Z",
  "access" : "PRIVATE",
  "uploadedFile" : {
    "filename" : "uploadedFile.pdf",
    "id" : "FILE466tgh",
    "url" : "http://your-giles-host.net/giles/rest/files/FILE466tgh/content",
    "path" : "username/UPxx456/DOC123edf/uploadedFile.pdf",
    "content-type" : "application/pdf",
    "size" : 3852180
  },
  "extractedText" : {
    "filename" : "uploadedFile.pdf.txt",
    "id" : "FILE123cvb",
    "url" : "http://your-giles-host.net/giles/rest/files/FILE123cvb/content",
    "path" : "username/UPxx456/DOC123edf/uploadedFile.pdf.txt",
    "content-type" : "text/plain",
    "size" : 39773
  },
  "pages" : [ {
    "nr" : 0,
    "image" : {
      "filename" : "uploadedFile.pdf.0.tiff",
      "id" : "FILEYUI678",
      "url" : "http://your-giles-host.net/giles/rest/digilib?fn=username%FILEYUI678%2FDOC123edf0%2FuploadedFile.pdf.0.tiff",
      "path" : "username/UPxx456/DOC123edf/uploadedFile.pdf.0.tiff",
      "content-type" : "image/tiff",
      "size" : 2032405
    },
    "text" : {
      "filename" : "uploadedFile.pdf.0.txt",
      "id" : "FILE789UIO",
      "url" : "http://your-giles-host.net/giles/rest/files/FILE789UIO/content",
      "path" : "username/UPxx456/DOC123edf/uploadedFile.pdf.0.txt",
      "content-type" : "text/plain",
      "size" : 4658
    },
    "ocr" : {
      "filename" : "uploadedFile.pdf.0.tiff.txt",
      "id" : "FILE789U12",
      "url" : "http://your-giles-host.net/giles/rest/files/FILE789U12/content",
      "path" : "username/UPxx456/DOC123edf/uploadedFile.pdf.0.tiff.txt",
      "content-type" : "text/plain",
      "size" : 4658
    }
  }, {
    "nr" : 1,
    "image" : {
      "filename" : "uploadedFile.pdf.1.tiff",
      "id" : "FILE045tyhG",
      "url" : "http://your-giles-host.net/giles/rest/digilib?fn=username%2FFILE045tyhG%2FDOC123edf0%2FuploadedFile.pdf.1.tiff",
      "path" : "username/UPxx456/DOC123edf/uploadedFile.1.tiff",
      "content-type" : "image/tiff",
      "size" : 2512354
    },
    "text" : {
      "filename" : "uploadedFile.pdf.1.txt",
      "id" : "FILEMDSPfeVm",
      "url" : "http://your-giles-host.net/giles/rest/files/FILEMDSPfeVm/content",
      "path" : "username/UPxx456/DOC123edf/uploadedFile.pdf.1.txt",
      "content-type" : "text/plain",
      "size" : 5799
    },
    "ocr" : {
      "filename" : "uploadedFile.pdf.1.tiff.txt",
      "id" : "FILEMDSPfe12",
      "url" : "http://your-giles-host.net/giles/rest/files/FILEMDSPfe12/content",
      "path" : "username/UPxx456/DOC123edf/uploadedFile.pdf.1.tiff.txt",
      "content-type" : "text/plain",
      "size" : 5799
    }
  }

Checking the Progress of an Upload

Status
colourYellow
titleGET
/api/v2/files/upload/check/{progress_id}

You can get information about the status of an upload via this endpoint by providing the progress id of an upload.

The response will look something like this:

Code Block
{
  "msg" : "Upload in progress. Please check back later.",
  "uploadUrl" : "http://your-giles-org.net/giles/api/v2/resources/files/upload/UPxasNDgVKLKAl",
  "uploadId" : "UPxasNDgVKLKAl",
  "msgCode" : "010"
}

You can use the upload id to get more details about the upload. If an upload has not been completely processed, the upload endpoint will return incomplete data.

Depending on if it is an error or not, the provided code will be in a different json property. Possible message codes, this endpoint returns are:

Json property

Code

Description

errorCode

404

An upload with the provided progress id does not exist.

msgCode

010

Processing of the upload is in progress.

Besides this, the endpoint may return the following HTTP status codes:

Status Code

Description

200 OK

Upload has been processed.

202 Accepted

Processing in progress

403 Forbidden

User does not have access to upload.

404 Not Found

Upload with provided progress id does not exist.

500 Internal Server Error

Something went wrong on Giles' side.

Retrieving Data

Getting info about an upload

...