Document Type Web Service API

 

CumulusPro provides the Admin Panel so users can maintain the configuration information. Alternatively, when the information is already stored in your own repository, Document Types, including Field Definitions and Lookup Values can be queried and maintained using the Document Type Web Service API.

 

This means, the document types in the Admin Panel can be queried and updated with the following calls:

 

  1. List Document Types
  2. Add Document Type
  3. Modify Document Type
  4. Delete Document Type

 

For the architectural diagram, please refer to the diagram in Extended Scenario

 

List Document Types

POST https://CP-Server/v2.0/DocumentTypeService.svc/json/ListDocumentTypes HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=utf-8
Host: iconnector-configuration.azurewebsites.net
Content-Length: 38
Expect: 100-continue
Connection: Keep-Alive

An example of the JSON body (this is the Web Request Key which is unique for one Configuration):

"e18c0a16-9d82-4e13-a683-4dea593b8dbd"

 

An example of the JSON response:

[
    {
        "CustomConfiguration": null,
        "DisplayName": "The New Document",
        "DocumentFormat": "PDF",
        "FieldDefinitions": [
            {
                "DefaultValue": null,
                "DisplayName": "Lookup Field",
                "FieldDatatype": "lookup",
                "IsReadOnly": null,
                "IsRequired": null,
                "LookupValues": [
                    {
                        "DisplayValue": "Value 1",
                        "Value": "Value1"
                    },
                    {
                        "DisplayValue": "Value 2",
                        "Value": "Value2"
                    }
                ],
                "MaximumLength": null,
                "Name": "LookupField",
                "ServerLookupKey": null
            },
            {
                "DefaultValue": null,
                "DisplayName": "String Field",
                "FieldDatatype": "string",
                "IsReadOnly": null,
                "IsRequired": null,
                "LookupValues": [],
                "MaximumLength": null,
                "Name": "StringField",
                "ServerLookupKey": null
            }
        ],
        "GetFieldMetadataFromServer": null,
        "JPEGQuality": null,
        "MobileConfigurationName": null,
        "Name": "NewDocument",
        "SaveNameTemplate": null,
        "ScannerConfigurationName": null,
        "UniqueId": "6f858b38-5c48-4503-81ce-bdbbb77e5db2",
        "ValidateOnSubmit": true
    }
]

 

Add Document Type

A new Document Type can be added to an existing Configuration using the AddDocumentType Web Method. If no UniqueId is specified in the DocumentType, a new UniqueId will be generated. If a UniqueId is specified, no existing DocumentType should exist in the Configuration with the same UniqueId.

 

An example of the HTTP headers is shown here:

POST https://CP-Server/v2.0/DocumentTypeService.svc/json/AddDocumentType HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=utf-8
Host: iconnector-configuration.azurewebsites.net
Cookie: ARRAffinity=a0571c8d3e0db29b5d4cdc34fced5f8ffef370c09bab5d3679abe85d59f67512
Content-Length: 857
Expect: 100-continue

 

An example of the JSON body:

{
    "WebServiceKey": "e18c0a16-9d82-4e13-a683-4dea593b8dbd",
    "DocumentType": {
        "UniqueId": null,
        "Name": "NewDocument",
        "DisplayName": "The New Document",
        "SaveNameTemplate": null,
        "DocumentFormat": "PDF",
        "JPEGQuality": null,
        "GetFieldMetadataFromServer": null,
        "CustomConfiguration": null,
        "ValidateOnSubmit": null,
        "ScannerConfigurationName": null,
        "MobileConfigurationName": null,
        "FieldDefinitions": [
            {
                "Name": "StringField",
                "DisplayName": "String Field",
                "FieldDatatype": "string",
                "LookupValues": null,
                "IsRequired": null,
                "DefaultValue": null,
                "ServerLookupKey": null,
                "MaximumLength": null,
                "IsReadOnly": null
            },
            {
                "Name": "LookupField",
                "DisplayName": "Lookup Field",
                "FieldDatatype": "lookup",
                "LookupValues": [
                    {
                        "Value": "Value1",
                        "DisplayValue": "Value 1"
                    },
                    {
                        "Value": "Value2",
                        "DisplayValue": "Value 2"
                    }
                ],
                "IsRequired": null,
                "DefaultValue": null,
                "ServerLookupKey": null,
                "MaximumLength": null,
                "IsReadOnly": null
            }
        ]
    }
}

 

An example of the JSON response:

{
    "CustomConfiguration": null,
    "DisplayName": "The New Document",
    "DocumentFormat": "PDF",
    "FieldDefinitions": [
        {
            "DefaultValue": null,
            "DisplayName": "String Field",
            "FieldDatatype": "string",
            "IsReadOnly": null,
            "IsRequired": null,
            "LookupValues": null,
            "MaximumLength": null,
            "Name": "StringField",
            "ServerLookupKey": null
        },
        {
            "DefaultValue": null,
            "DisplayName": "Lookup Field",
            "FieldDatatype": "lookup",
            "IsReadOnly": null,
            "IsRequired": null,
            "LookupValues": [
                {
                    "DisplayValue": "Value 1",
                    "Value": "Value1"
                },
                {
                    "DisplayValue": "Value 2",
                    "Value": "Value2"
                }
            ],
            "MaximumLength": null,
            "Name": "LookupField",
            "ServerLookupKey": null
        }
    ],
    "GetFieldMetadataFromServer": null,
    "JPEGQuality": null,
    "MobileConfigurationName": null,
    "Name": "NewDocument",
    "SaveNameTemplate": null,
    "ScannerConfigurationName": null,
    "UniqueId": "430ddc3a-1127-4485-a83e-5b99a414e7a1",
    "ValidateOnSubmit": null
}

 

Modify Document Type

An existing Document Type can be modified using the ModifyDocumentType Web Method. This method works exactly the same as the AddDocumentType method, but requires the UniqueId of the document to match an existing DocumentType in the Configuration.

 

Delete Document Type

A Document Type can be deleted from an existing Configuration using the DeleteDocumentType Web Method.

 

An example of the HTTP headers is shown here:

POST https://CP-Server/v2.0/DocumentTypeService.svc/json/DeleteDocumentType HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=utf-8
Host: iconnector-configuration.azurewebsites.net
Cookie: ARRAffinity=a0571c8d3e0db29b5d4cdc34fced5f8ffef370c09bab5d3679abe85d59f67512
Content-Length: 118
Expect: 100-continue

 

An example of the JSON body:

{
    "WebServiceKey": "e18c0a16-9d82-4e13-a683-4dea593b8dbd",
    "DocumentTypeUniqueId": "430ddc3a-1127-4485-a83e-5b99a414e7a1"
}

 

An example of the JSON response:

true

 

 

Create your own Knowledge Base