PrizmDoc Viewer v13.5 - Updated
Form Definitions
API Reference > PAS API > Form Definitions

Introduction

Available URLs

URL Description
GET /FormDefinitions Gets the list of forms available on the server.
GET /FormDefinitions/{formDefinitionId} Gets a specific form definition from the server.
POST /FormDefinitions Creates a new form definition using the uploaded data.
POST /FormDefinitions/{formDefinitionId} Updates an existing form definition with the new uploaded data. This will overwrite all of the existing data with the new uploaded data.
DELETE /FormDefinitions/{formDefinitionId} Deletes a form definition from the server.

GET /FormDefinitions

Routes key: GetFormDefinitions

Gets the list of forms available on the server.

GET pas_base_url/FormDefinitions

Successful Response

HTTP/1.1 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"
}]

Error Responses

When an unknown error occurs while gathering data:

HTTP/1.1 580 Server Error
Content-Type: application/json

{
    "errorCode": "InternalError"
}

GET /FormDefinitions/{formDefinitionId}

Routes key: GetFormDefinition

Gets a specific form definition from the server.

GET pas_base_url/FormDefinitions/03f3e9c4a976419da576276acc427700

Successful Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "templateDocumentId": "Form 1.pdf",
    "globalSettings": { ... global settings ... },
    "formRoles": { ... form roles ... },
    "groups": {},
    "formName": "Form 1",
    "formData": [ ... form data ... ]
}

Error Responses

When the form definition does not exist:

HTTP/1.1 404 Not Found
Content-Type: application/json

{
    "errorCode": "NotFound"
}

When an unknown error occurs while gathering data:

HTTP/1.1 580 Server Error
Content-Type: application/json

{
    "errorCode": "InternalError"
}

POST /FormDefinitions

Routes key: CreateFormDefinition

Creates a new form definition using the uploaded data.

POST pas_base_url/FormDefinitions
Content-Type: application/json

{
    "templateDocumentId": "Form 3.pdf",
    "globalSettings": { ... global settings ... },
    "formRoles": { ... form roles ... },
    "groups": {},
    "formName": "Form 3",
    "formData": [ ... form data ... ]
}

Successful Response

HTTP/1.1 201 Created
Content-Type: application/json

{
    "formDefinitionId": "5418c96283bc469783bd30e7c8fdc059"
}

Error Responses

When an unknown error occurs while gathering data:

HTTP/1.1 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 pas_base_url/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

HTTP/1.1 200 OK

Error Responses

When the form definition does not exist:

HTTP/1.1 404 Not Found
Content-Type: application/json

{
    "errorCode": "NotFound"
}

When an unknown error occurs while gathering data:

HTTP/1.1 580 Server Error
Content-Type: application/json

{
    "errorCode": "InternalError"
}

DELETE /FormDefinitions/{formDefinitionId}

Routes key: DeleteFormDefinition

Deletes a form definition from the server.

DELETE pas_base_url/FormDefinitions/03f3e9c4a976419da576276acc427700

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

POST pas_base_url/FormDefinitions/03f3e9c4a976419da576276acc427700
X-HTTP-Method-Override: DELETE

Successful Response

HTTP/1.1 204 No Content

Error Responses

When the form definition does not exist:

HTTP/1.1 404 Not Found
Content-Type: application/json

{
    "errorCode": "NotFound"
}

When an unknown error occurs while gathering data:

HTTP/1.1 580 Server Error
Content-Type: application/json

{
    "errorCode": "InternalError"
}