Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Page Properties
hiddentrue

Status

Status
colourPurpleYellow
titlestartedfor review

Approver

Pavel Shkadzko

The Gini Accounting API renders preview images of the document pages. In order to retrieve a list of pages for a document, issue a GET request to the pages sub-resource of the document.

Code Block
languagejson
//retrieving document pages

    GET /documents/{id}/pages
Request
Path

...

parameters

Name

Value

id

Document ID

Headers

Header

Value

Accept

application/vnd.gini.v1+json

Code Block
languagejson
//retrieve document pages

curl -H 'Authorization: BEARER <token>'
    -X GET -H 'Accept: application/vnd.gini.v1+json'
    -i https://pay-api.gini.net/documents/c292af40-d06a-11e2-9a2f-000000000000/pages
Response
Headers

Status Code

Description

200 (OK)

The request was successful.

404 (Not Found)

The requested document does not exist.

...

Info

Image downloads require a corresponding `Accept` header such as `image/jpeg` or `image/*`.

Code Block
languagejson
//the response will be a list of pages.

[
  {
    "images" : {
      "large" : "https://pay-api.gini.net/documents/c292af40-d06a-11e2-9a2f-000000000000/pages/1/large",
      "medium" : "https://pay-api.gini.net/documents/c292af40-d06a-11e2-9a2f-000000000000/pages/1/medium"
    },
    "pageNumber" : 1
  },
  {
    "pageNumber" : 2,
    "images" : {
      "large" : "https://pay-api.gini.net/documents/c292af40-d06a-11e2-9a2f-000000000000/pages/2/large",
      "medium" : "https://pay-api.gini.net/documents/c292af40-d06a-11e2-9a2f-000000000000/pages/2/medium"
    }
  }
]