Skip to content
Sreejith Narayanan edited this page Nov 3, 2015 · 5 revisions

Forms are documents which are classified and recognised by GlyphX. So, in order to process any document a form need to be created and processed. Forms APIs allows to create, update and delete forms programatically. All the APIs have to be aunthenticated either using Basic Auth or Session Auth

List Forms

Gets all the forms belonging to the user

GET /forms/

View Type

List view

Headers

For Session Auth

Content-Type=application/json
sessionid=<valid sessionid>

For Basic Auth

Content-Type=application/json
Authorization=<base64 encoded username, password combination>

Parameters

None

Response

Response will be a JSON providing the list of forms

{
  "objects": [
    {
      "form_num": "scan jpeg",
      "id": "56386711aa762006fddd2598",
      "resource_uri": "/forms/56386711aa762006fddd2598/"
    },
    {
      "form_num": "Scan 3",
      "id": "563865bcaa762006fddd2585",
      "resource_uri": "/forms/563865bcaa762006fddd2585/"
    },
    {
      "form_num": "Scan 3",
      "id": "563851d5aa762006fddd2572",
      "resource_uri": "/forms/563851d5aa762006fddd2572/"
    }
	],
	"meta": {
      "total_count": 103,
      "limit": 20,
      "offset": 0
}

Detail Forms

Gets the details of a single form

GET /forms/<id>

View Type

Detail view

Headers

For Session Auth

Content-Type=application/json
sessionid=<valid sessionid>

For Basic Auth

Content-Type=application/json
Authorization=<base64 encoded username, password combination>

Parameters

None

Response

Response will be a JSON providing the detail information about the form

{
  "objects": {
    "account": "mquotient(53dhc987c5a4b3396ebe9a9b)",
    "template": null,
    "form_num": "scan jpeg",
    "id": "56386711aa762006fddd2598",
    "resource_uri": "/forms/56386711aa762006fddd2598/pages/"
  },
  "meta": {
    "total_count": 1,
    "limit": 20,
    "offset": 0
  }
}

Create

Creating a form involves two steps

  1. Creating the form using the first page in form
  2. Updating the form with additional pages of the form if there are any

As soon as the each page is received, they will be scheduled for processing. Any processing steps that require data from more than one page will wait till all the required pages are received. While creating or updating the form, the image for the page is required to be provided. GlyphX provides two options for sending the image

  1. The image can be sent as base64 encoded string and part of the POST data.
  2. The image can be sent as a raw file using
# Create the form using the first page
POST /forms/

View Type

Detail view

Headers

For Session Auth

Content-Type=application/json
sessionid=<valid sessionid>

For Basic Auth

Content-Type=application/json
Authorization=<base64 encoded username, password combination>

Parameters

None

Response

Response will be a JSON providing the detail information about the form

{
  "objects": {
    "account": "mquotient(53dhc987c5a4b3396ebe9a9b)",
    "template": null,
    "form_num": "scan jpeg",
    "id": "56386711aa762006fddd2598",
    "resource_uri": "/forms/56386711aa762006fddd2598/pages/"
  },
  "meta": {
    "total_count": 1,
    "limit": 20,
    "offset": 0
  }
}

Clone this wiki locally