Queued Applications¶
A new application can be created in a queued state in one session, then selected, populated and submitted in another session. This is useful for systems that want to create applications and specify some of their data, to prevent a user from entering the wrong information.
When you create a queued application, you must:
Specify the branch that contains the application. This means that any user with permission to see data for the specified branch can populate the application with documents.
Specify all application-level custom fields. These are configurable within the system and will be presented to users when they select the queued application to process. An example field could be Employee Id or Applicant Id. Use of these fields is the whole reason for queued applications and without them there is no benefit in creating a queued application.
Note
Please contact TrustID if you need additional application-level custom fields added to your account.
Creating a New Queued Application¶
Create a new queued application as shown below:
Request
POST {{server}}/VPE/dataAccess/createQueuedDocumentContainer/
Content-Type: application/json
{
"DeviceId": "device-id",
"SessionId": "...",
"BranchId": "..."
}
For endpoint details, see /dataAccess/createQueuedDocumentContainer/.
var api = new TVS.Api();
api.login('username', 'password').then(function(loginInfo) {
var customFields=null;
return api. createQueuedDocumentContainer(api.Branch.Id, customFields);
});
The application will be immediately visible to users to select using the TrustID web or mobile apps.
Using Application-level Custom Fields¶
When you create a new queued application, you must specify custom fields at application-level.
For information on how to obtain a list of custom fields at application-level and how to use the list to construct data to send, see Application-level Custom Fields. The final request should look something like this:
POST {{server}}/VPE/dataAccess/createQueuedDocumentContainer/
Content-Type: application/json
{
"DeviceId": "device-id",
"SessionId": "...",
"BranchId": "..."
"ApplicationFlexibleFieldValues": [
{
"FlexibleFieldVersionId": "36fda3bf-b6c3-46d7-94f2-8b7b6ae8cd54",
"FieldValueString": "Software Development and IT Department"
}
]
}
For endpoint details, see /dataAccess/createQueuedDocumentContainer/.
var api = new TVS.Api();
api.login('username', 'password').then(function(loginInfo) {
// get application-level custom fields that are available in the system
return api.getApplicationFlexibleFields(loginInfo.User);
}).then(function(flexibleFields) {
// create a new (empty) container with application-level custom fields
// attached, assuming a field with the name 'ApplicantId' exists
var customFields = Container.createCustomFields(flexibleFields, {
'ApplicantId': '123456'
})
return api. createQueuedDocumentContainer(api.Branch.Id, customFields);
});
Note
Retrieving Branches shows how to use the API to retrieve a list of possible branch Ids.
Using Callback Properties Creating a Queued Application¶
When you create a queued application, you can specify callback properties to be able to receive callback at certain events within the queued application workflow.
You can specify ContainerEventCallbackUrl to link container with callback url and you can specify ContainerEventCallbackHeaders used by callback, request should look something like this:
POST {{server}}/VPE/dataAccess/createQueuedDocumentContainer/
Content-Type: application/json
{
"DeviceId": "device-id",
"SessionId": "...",
"BranchId": "..."
"ApplicationFlexibleFieldValues": [
{
"FlexibleFieldVersionId": "36fda3bf-b6c3-46d7-94f2-8b7b6ae8cd54",
"FieldValueString": "Software Development and IT Department"
}
],
"ContainerEventCallbackUrl": "https://www.my-company.co.uk/web-hooks/container-event-callback/",
"ContainerEventCallbackHeaders"::[
{
"Header":"Authorization",
"Value":"..."
}
],
"ClientApplicationReference": "MyReference"
}
For endpoint details, see /dataAccess/createQueuedDocumentContainer/.
var api = new TVS.Api();
api.login('username', 'password').then(function(loginInfo) {
// get application-level custom fields that are available in the system
return api.getApplicationFlexibleFields(loginInfo.User);
}).then(function(flexibleFields) {
// create a new (empty) container with application-level custom fields
// attached, assuming a field with the name 'ApplicantId' exists
var customFields = Container.createCustomFields(flexibleFields, {
'ApplicantId': '123456'
})
return api.createQueuedDocumentContainer(api.Branch.Id, customFields, 'MyReference', 'https://www.my-company.co.uk/web-hooks/container-event-callback/');
});