PrizmDoc
Form Definitions

Form Definitions

GET /FormDefinitions

Routes key: GetFormDefinitions

Gets the list of forms available on the server.

GET http://localhost:3000/FormDefinitions

Successful Response:

200 OK
Content-Type: application/json
[{
    "name": "Form 1",
    "formRoles": {
        "formRole1": {
            "formRoleId": "formRole1",
            "fieldColor": "#439fe0",
            "displayName": "one",
            "sortIndex": 1
        },
        "formRole2": {
            "formRoleId": "formRole2",
            "fieldColor": "#58bb63",
            "displayName": "two",
            "sortIndex": 2
        }
    },
    "formDefinitionId": "03f3e9c4a976419da576276acc427700"
},{
    "name": "Form 2",
    "formRoles": {},
    "formDefinitionId": "04a6032f3eaa4a8a9eb1b5fce1cb99e9"
}]

Errored Response:

When an unknown error occurs while gathering data:

580 Server Error
Content-Type: application/json
{ "errorCode": "InternalError" }

GET /FormDefinitions/{formDefinitionId}

Routes key: GetFormDefinition

Gets a specific form definition from the server.

http://localhost:3000/FormDefinitions/03f3e9c4a976419da576276acc427700

Successful Response:

200 OK
Content-Type: application/json
{
    "templateDocumentId": "Form 1.pdf",
    "globalSettings": { ... global settings ... },
    "formRoles": { ... form roles ... },
    "groups": {},
    "formName": "Form 1",
    "formData": [ ... form data ... ]
}

Errored Responses:

When the form definition does not exist:

404 Not Found
Content-Type: application/json
{ "errorCode": "NotFound" }

When an unknown error occurs while gathering data:

580 Server Error
Content-Type: application/json
{ "errorCode": "InternalError" }

POST /FormDefinitions

Routes key: CreateFormDefinition

Creates a new form definition using the uploaded data.

POST http://localhost:3000/FormDefinitions
Content-Type: application/json
{
    "templateDocumentId": "Form 3.pdf",
    "globalSettings": { ... global settings ... },
    "formRoles": { ... form roles ... },
    "groups": {},
    "formName": "Form 3",
    "formData": [ ... form data ... ]
}

Successful Response:

201 Created
Content-Type: application/json
{ "formDefinitionId": "5418c96283bc469783bd30e7c8fdc059" }

Errored Responses:

When an unknown error occurs while gathering data:

580 Server Error
Content-Type: application/json
{ "errorCode": "InternalError" }

POST /FormDefinitions/{formDefinitionId}

Routes key: UpdateFormDefinition

Updates an existing form definition with the new uploaded data. This will overwrite all of the existing data with the new uploaded data.

POST http://localhost:3000/FormDefinitions/03f3e9c4a976419da576276acc427700
Content-Type: application/json
{
    "templateDocumentId": "Form 1.pdf",
    "globalSettings": { ... global settings ... },
    "formRoles": { ... form roles ... },
    "groups": {},
    "formName": "Form 1 - updated",
    "formData": [ ... form data ... ]
}

Successful Response:

200 OK

Errored Responses:

When the form definition does not exist:

404 Not Found
Content-Type: application/json
{ "errorCode": "NotFound" }

When an unknown error occurs while gathering data:

580 Server Error
Content-Type: application/json
{ "errorCode": "InternalError" }

DELETE /FormDefinitions/{formDefinitionId}

Routes key: DeleteFormDefinition

Deletes a form definition from the server.

DELETE http://localhost:3000/FormDefinitions/03f3e9c4a976419da576276acc427700

Alternatively, the POST method is supported for this request in combination with an X-HTTP-Method-Override header, as such:

POST http://localhost:3000/FormDefinitions/03f3e9c4a976419da576276acc427700
X-HTTP-Method-Override: DELETE

Successful Response:

204 No Content

Errored Responses:

When the form definition does not exist:

404 Not Found
Content-Type: application/json
{ "errorCode": "NotFound" }

When an unknown error occurs while gathering data:

580 Server Error
Content-Type: application/json
{ "errorCode": "InternalError" }

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback