openapi: 3.2.0
info:
version: 1.0.0
x-logo:
url: https://developers.unqork.io/unqork-logo.png
backgroundColor: '#FFFFFF'
title: Unqork Customer Submissions API
description: "\nUnqork's customer REST API, based on open standards, allows you to set and retrieve module submission data, as well as control other aspects of your Unqork environment. You can use any web development language to access the API, as communication is over secured HTTP.\n## URI Structure and Methods\nAll API communication will occur over SSL (HTTPS). All API responses are in JSON format.\nAll Unqork requests begin with the prefix:\n\n```\n https://{yourSubdomain}.unqork.io/api/1.0\n```\n\nFor example, if your subdomain is **xyzfinancial**, you would use the prefix `https://xyzfinancial.unqork.io/api/1.0`.\n\nThe next segment of the URI path will vary based on the endpoint of the request.\n\nA given endpoint (resource) has a series of actions (methods) associated with it. The Unqork API supports these standard HTTP methods:\n\n- **GET** - retrieves data\n\n- **PUT** - updates existing data\n\n- **POST** - creates new data\n\n- **DELETE** - deletes existing data\n\nFor example, you can use the POST action on the module submission resource to create a new module submission.\n## Paging\nPaged endpoints use the [Link header](https://www.w3.org/wiki/LinkHeader). If the link header \"next\" is present, then there are more items to retrieve, and the \"next\" should be followed.\n## Cloud Storage Delivery\nUnqork exposes generated PDFs, uploaded attachments, and other file-like pieces of submission data via Cloud Storage Delivery URLs. These are signed, expiring links that allow the user to securely retrieve files stored in Unqork. Links can appear inside raw submission data, or they can be returned from PDF transform submission endpoints.\n\nThese links cannot be shared with other parties; only the user who generates the unique link (by either submitting the file or accessing the submission where the file has been saved) will be able to use that specifically generated link. This means that the user must be authenticated (either in the browser, or by passing a valid OAuth Bearer token) in order to retrieve the file.\n\nCloud Storage Delivery URLs will look like this:\n\n`https://xyzfinancial.unqork.io/fbu/files/{filePath}?signature={signature}`\n\nThe file can be retrieved by accessing the link in the browser, or like this:\n\n```\n $ curl -H \"Authorization: Bearer {access_token}\" https://xyzfinancial.unqork.io/fbu/files/{filePath}?signature={signature}\n```\n## Nomenclature\nPreviously, \"Modules\" were called \"Forms\". This nomenclature change affects all endpoints documented here in paths, request parameters, and response bodies (e.g. `forms -> modules`, `formId -> moduleId`; however, the behaviors of the endpoints are the same. The previous endpoints will continue to be supported, but they will be deprecated in the future.\n## API Access Notes\n#### Express Module and Workflow Access \nExpress Module and Workflow Access is determined by a User's Role and the Module's permissions. An Express User's Role is specified at the environment level, but can be overwritten at the Application level using Application Roles. If Module Permissions are used, the permission settings will specify what access (Read, Write, Obfuscate, or None) a User will have to the Module. Anonymous Users may also be able to access a Module if the permission settings allow it.\n#### Submission Access \nSubmission Access is determined by a User's Role, Groups, and if they are the owner of the Submission. A Submission owner is the user that created or updated the Submission. If a user is a Submission owner, Designer Administrator, or an Express Super User, the user has access to the Submission. If the User does not have access to the Module or Workflow that the Submission is associated with, then the User will not have access to the Submission. See Express Module and Workflow Access ([Express Module and Workflow Access](#express-module-workflow-access)). A User's Role Groups can also provide a User Access to a Submission. A User needs to have Intersecting Groups with the Submission Owner. Intersecting Groups means a User has a Role with a Group (Groups assigned directly to the User do not count) that is in the Submission owner's groups (the Submission owners Role Groups or the Submission owners User Groups). If a User has Intersecting Groups:\n- And the Group type is ignore role, a User that has Intersecting Groups can access the Submission.\n- And the Group type is Role descendents, a User that has Intersecting Groups and the Submission owner's Role is a descendant of the User's Role then the User can access the Submission.\n- And the Group type is own Role and descendents, a User that has Intersecting Groups and the Submission owner's Role is a descendent of the User's Role or the User's Role is the same as the Submission owner's Role then the User can access the Submission.\n"
servers:
- url: https://{host}/api/1.0
variables:
host:
default: env.unqork.io
description: Environment host
security:
- OAuth2: []
tags:
- name: Submissions
paths:
/modules/{moduleId}/submissions:
get:
x-unqork-service: true
tags:
- Submissions
summary: Get Module Submissions
operationId: getModuleSubmissions
description: "Returns module submission objects for a given module. This is a paged endpoint (see Paging). Module submission data is transformed and returned in a specific format, based on the specified transform. JSON submission data is returned as an object, XML data is returned as a string, and PDF data is returned as a [Cloud Storage Delivery URL](#section/Cloud-Storage-Delivery) to the rendered PDF (and optionally base 64 data).\n### Authorization Required:\n - See Submission Access ([Submission Access](#submission-access))\n"
parameters:
- $ref: '#/components/parameters/ModuleID'
- name: transformName
in: query
description: Transform to apply to module for output. Transform must be configured and designated for for output. Available transforms may be listed via the /transforms endpoint
schema:
type: string
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/Offset'
- $ref: '#/components/parameters/SubmissionSortBy'
- $ref: '#/components/parameters/SubmissionSortOrder'
- $ref: '#/components/parameters/IncludeDeleted'
- $ref: '#/components/parameters/MetadataFilterString'
- name: includeRaw
in: query
description: Whether to include the untransformed raw submission data in addition to the transformed data. Raw submission data may contain [Cloud Storage Delivery URLs](#section/Cloud-Storage-Delivery).
schema:
type: boolean
- name: includeBase64
in: query
description: Whether to include base64 PDF data in addition to the PDF url (for "njk-pdf" transforms)
schema:
type: boolean
- name: resolveCloudStorageUrls
in: query
description: When `transformName` is specified, Cloud Storage URLs are already resolved to the original base64 value. When this flag is specified, resolve Cloud Storage URLs to base64 data inside "rawData", as well.
schema:
type: boolean
- $ref: '#/components/parameters/DataFields'
- name: filter
in: query
description: "Filter conditions against submissions. Currently supported filter conditions are `userId`, `created`, and `modified`. The filters should be `;` separated, as shown below. NOTE: When filtering on `created` and `modified`, all timestamps are in UTC.\n\nExamples:\n - `filter=userId=john@doe.com` will fetch all submissions owned by \"john@doe.com\"\n - `filter=userId=john@doe.com;created>2019-06-11T21:50:57.067Z` will fetch all submissions owned by \"john@doe.com\" and created after \"2019-06-11T21:50:57.067Z\" (UTC)\n - `filter=modified=2019-06-11T21:50:57.067Z` will fetch submissions modified at exactly \"2019-06-11T21:50:57.067Z\" (UTC)\n - `filter=created>2019-06-11T00:00:00.000Z;created<2019-06-20T00:00:00.000Z` will fetch submissions created between \"2019-06-11T00:00:00.000Z\" (UTC) and \"2019-06-20T00:00:00.000Z\" (UTC)\n\n\nSupported operators (as specified in this library [api-query-params](https://github.com/loris/api-query-params)):\n - key=val `type=public`\n - key>val `count>5`\n - key>=val `rating>=9.5`\n - key `email=/@gmail\\.com$/i`\n - key!=/value/ `phone!=/^06/`\n\nNote: multiple forward slashes (/) are interpreted as a regex. To use a string comparison wrap your parameter with string(). Ex. email=string(/@gmail\\.com$/i).\n"
schema:
type: string
responses:
'200':
description: Submissions
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RetrievedSubmissionResponse'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
post:
x-unqork-service: true
tags:
- Submissions
summary: Create Module Submission(s)
operationId: createModuleSubmissions
description: "Creates one or more new module submission. Submission ID is auto-generated and returned. Module submission data must be provided as a JSON object. In case of multiple submissions, Request Body must contain an Array of below defined request body structure. Max Limit per request is 50.\n### Authorization Required:\n - See Submission Access ([Submission Access](#submission-access))\n"
parameters:
- $ref: '#/components/parameters/ModuleID'
- name: transformName
in: query
description: Transform to apply to module for input. Transform must be configured and designated for for input. Available transform types may be listed via the /transforms endpoint.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/NewSubmissionRequest'
responses:
'201':
description: Submission created
content:
application/json:
schema:
$ref: '#/components/schemas/SavedSubmissionResponse'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
put:
x-unqork-service: true
tags:
- Submissions
summary: Update Multiple Module Submissions
operationId: updateModuleSubmissions
description: "Updates multiple module submissions. This operation supports partial \"data\" updates, i.e. data that is sent in \"data\" may include some but not all of the submission data. Partial metadata updates are supported without including the entire metadata object. To increment a numeric data key (will also initialize), use \"incrementData\" To delete a data key, use \"unsetData\". To delete a metadata key, use \"unsetMetadata\". To replace the entire data object, use the \"replaceData\" flag. Module submission data must be provided as a JSON object. Max Limit per request is 50.\n### Authorization Required:\n - See Submission Access ([Submission Access](#submission-access))\n"
parameters:
- $ref: '#/components/parameters/ModuleID'
- name: replaceData
in: query
description: Whether to completely replace the submission data with the object passed in "data". This option is available to "Administrator" users only.
schema:
type: boolean
default: false
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateSubmissionsRequest'
responses:
'200':
description: Submission updates
content:
application/json:
schema:
$ref: '#/components/schemas/UpdatedSubmissionsResponse'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
delete:
x-unqork-service: true
tags:
- Submissions
summary: Deletes Multiple Module Submissions
operationId: deleteModuleSubmissions
description: "Deletes multiple module submission based on the ID supplied. Note that module submissions are soft-deleted (marked deleted, but not removed). Default Max Limit per request is 50\n### Authorization Required:\n - See Submission Access ([Submission Access](#submission-access))\n"
parameters:
- $ref: '#/components/parameters/ModuleID'
- name: destroy
in: query
description: Whether to hard delete the submission from database. Value of 'destroy=true' will delete the submission. This option requires administrator privileges. Once deleted, the submission cannot be retrieved.
schema:
type: boolean
default: false
- name: ids
in: query
description: 'A comma seperated list of the ids required to be deleted. Note - Max limit is 50 Per Request Example - ?ids=id1,id2,id3....
'
schema:
type: string
responses:
'200':
description: Submission deleted
content:
application/json:
schema:
$ref: '#/components/schemas/UpdatedSubmissionsResponse'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/modules/{moduleId}/submissions/{submissionId}:
get:
x-unqork-service: true
tags:
- Submissions
summary: Get Module Submission
operationId: getModuleSubmission
description: "Gets a single module submission. Module submission data is transformed and returned is a specific format, based on the specified transform. JSON submission data is returned as an object, XML data is returned as a string, and PDF data is returned as a [Cloud Storage Delivery URL](#section/Cloud-Storage-Delivery) to the rendered PDF (and optionally base 64 data).\n### Authorization Required:\n - See Submission Access ([Submission Access](#submission-access))\n"
parameters:
- $ref: '#/components/parameters/ModuleID'
- name: submissionId
in: path
description: ID of module submission to retrieve
required: true
schema:
type: string
- name: transformName
in: query
description: Transform to apply to module for output. Transform must be configured and designated for for output. Available transforms may be listed via the /transforms endpoint
schema:
type: string
- name: includeRaw
in: query
description: Whether to include the untransformed raw submission data in addition to the transformed data. Raw submission data may contain [Cloud Storage Delivery URLs](#section/Cloud-Storage-Delivery).
schema:
type: boolean
- name: includeBase64
in: query
description: Whether to include base64 PDF data in addition to the PDF url (for "njk-pdf" transforms)
schema:
type: boolean
- name: resolveCloudStorageUrls
in: query
description: When `transformName` is specified, Cloud Storage URLs are already resolved to the original base64 value. When this flag is specified, resolve Cloud Storage URLs to base64 data inside "rawData", as well.
schema:
type: boolean
- $ref: '#/components/parameters/DataFields'
responses:
'200':
description: Submission
content:
application/json:
schema:
$ref: '#/components/schemas/RetrievedSubmissionResponse'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
put:
x-unqork-service: true
tags:
- Submissions
summary: Update Module Submission
operationId: updateModuleSubmission
description: "Updates a single module submission. This operation supports partial \"data\" updates, i.e. data that is sent in \"data\" may include some but not all of the submission data. Partial metadata updates are supported without including the entire metadata object. To increment a numeric data key (will also initialize), use \"incrementData\" To delete a data key, use \"unsetData\". To delete a metadata key, use \"unsetMetadata\". Module submission data must be provided as a JSON object.\n### Authorization Required:\n - See Submission Access ([Submission Access](#submission-access))\n"
parameters:
- $ref: '#/components/parameters/ModuleID'
- name: submissionId
in: path
description: ID of module submission to update
required: true
schema:
type: string
- name: transformName
in: query
description: Transform to apply to module for input. Transform must be configured and designated for for input. Available transform types may be listed via the /transforms endpoint.
schema:
type: string
- name: replaceData
in: query
description: Whether to completely replace the submission data with the object passed in "data". This option is available to "Administrator" users only.
schema:
type: boolean
default: false
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdatedSubmissionRequest'
responses:
'200':
description: Submission updated
content:
application/json:
schema:
$ref: '#/components/schemas/SavedSubmissionResponse'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
delete:
tags:
- Submissions
summary: Delete Module Submission
operationId: deleteModuleSubmission
description: "Deletes a single module submission based on the ID supplied. Note that module submissions are soft-deleted (marked deleted, but not removed).\n### Authorization Required:\n - See Submission Access ([Submission Access](#submission-access))\n"
parameters:
- $ref: '#/components/parameters/ModuleID'
- name: submissionId
in: path
description: ID of module submission to delete
required: true
schema:
type: string
- name: destroy
in: query
description: Whether to hard delete the submission from database. Value of 'destroy=true' will delete the submission. This option requires administrator privileges. Once deleted, the submission cannot be retrieved back.
schema:
type: boolean
default: false
responses:
'204':
description: Submission deleted
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/modules/{moduleId}/submissions/{submissionId}/restore:
post:
x-unqork-service: true
tags:
- Submissions
summary: Restore a Deleted Module Submission
operationId: restoreDeletedModuleSubmission
description: "Restore a soft-deleted submission.\n### Authorization Required:\n - See Submission Access ([Submission Access](#submission-access))\n"
parameters:
- $ref: '#/components/parameters/ModuleID'
- name: submissionId
in: path
description: ID of module submission to restore
required: true
schema:
type: string
responses:
'204':
description: Successfully Restored
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/workflows/{workflowId}/submissions/{submissionId}/restore:
post:
x-unqork-service: true
tags:
- Submissions
summary: Restore a Deleted Workflow Submission
operationId: restoreDeletedWorkflowSubmission
description: "Restore a soft-deleted submission.\n### Authorization Required:\n - See Submission Access ([Submission Access](#submission-access))\n"
parameters:
- $ref: '#/components/parameters/WorkflowID'
- name: submissionId
in: path
description: ID of workflow submission to restore
required: true
schema:
type: string
responses:
'204':
description: Successfully Restored
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/submissions:
get:
tags:
- Submissions
summary: Get Submissions Across Modules and Workflows
operationId: getAllSubmissions
description: "Returns submission objects across all modules and workflows. This is a paged endpoint (see Paging). This endpoint is available to \"Administrator\" users only.\n### Authorization Required:\n - See Submission Access ([Submission Access](#submission-access))\n"
parameters:
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/Offset'
- $ref: '#/components/parameters/SubmissionSortBy'
- $ref: '#/components/parameters/SubmissionSortOrder'
- $ref: '#/components/parameters/IncludeDeleted'
- $ref: '#/components/parameters/MetadataFilterString'
- $ref: '#/components/parameters/DataFields'
responses:
'200':
description: Submissions
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RetrievedSubmissionResponse'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/submissions/merge/{submissionIds}:
get:
x-unqork-service: true
tags:
- Submissions
summary: Get Merged Submissions
operationId: getMergedSubmissions
description: "Submission super access is required. This endpoint returns the merged submission object across provided submission ids. The submissions are merged in the order specified by sortOrder and sortBy. If not specified, the submission objects are applied from left to right. Subsequent submission overwrite property assignment of previous sources.\n### Authorization Required:\n - See Submission Access ([Submission Access](#submission-access))\n"
parameters:
- name: submissionIds
in: path
description: A comma separated list of submission ids to merge.
required: true
schema:
type: string
- name: conflictCheckFields
in: query
description: A comma separated list of fields to report conflicts on.
schema:
type: string
- name: reportConflicts
in: query
description: If `reportConflicts` is specified, an array called 'conflicts' will be appended at the top level of the object.
schema:
type: string
- name: sortBy
in: query
description: A comma separated list of fields to sort by.
required: false
schema:
type: string
- name: sortOrder
in: query
description: A comma separated list of sort orders. If `sortOrder` is unspecified, all values are sorted in ascending order. Otherwise, specify an order of "desc" for descending or "asc" for ascending sort order of corresponding values.
required: false
schema:
type: string
enum:
- asc
- desc
default: asc
responses:
'200':
description: Submissions
content:
application/json:
schema:
$ref: '#/components/schemas/RetrievedSubmissionMergeResponse'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/workflows/{workflowId}/submissions:
get:
x-unqork-service: true
tags:
- Submissions
summary: Get Workflow Submissions
operationId: getWorkflowSubmissions
description: "Returns workflow submission objects for a given workflow. This is a paged endpoint (see Paging). Workflow submission data is transformed and returned in a specific format, based on the specified transform. JSON submission data is returned as an object, XML data is returned as a string, and PDF data is returned as a [Cloud Storage Delivery URL](#section/Cloud-Storage-Delivery) to the rendered PDF (and optionally base 64 data).\n### Authorization Required:\n - See Submission Access ([Submission Access](#submission-access))\n"
parameters:
- $ref: '#/components/parameters/WorkflowID'
- name: transformName
in: query
description: Transform to apply to form for output. Transform must be configured and designated for for output. Available transforms may be listed via the /transforms endpoint
schema:
type: string
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/Offset'
- $ref: '#/components/parameters/SubmissionSortBy'
- $ref: '#/components/parameters/SubmissionSortOrder'
- $ref: '#/components/parameters/IncludeDeleted'
- $ref: '#/components/parameters/MetadataFilterString'
- name: includeRaw
in: query
description: Whether to include the untransformed raw submission data in addition to the transformed data. Raw submission data may contain [Cloud Storage Delivery URLs](#section/Cloud-Storage-Delivery).
schema:
type: boolean
- name: includeBase64
in: query
description: Whether to include base64 PDF data in addition to the PDF url (for "njk-pdf" transforms)
schema:
type: boolean
- name: resolveCloudStorageUrls
in: query
description: When `transformName` is specified, Cloud Storage URLs are already resolved to the original base64 value. When this flag is specified, resolve Cloud Storage URLs to base64 data inside "rawData", as well.
schema:
type: boolean
- $ref: '#/components/parameters/DataFields'
- name: filter
in: query
description: "Filter conditions against submissions. Currently supported filter conditions are `userId`, `created`, and `modified`. The filters should be `;` separated, as shown below. NOTE: When filtering on `created` and `modified`, all timestamps are in UTC.\n\nExamples:\n - `filter=userId=john@doe.com` will fetch all submissions owned by \"john@doe.com\"\n - `filter=userId=john@doe.com;created>2019-06-11T21:50:57.067Z` will fetch all submissions owned by \"john@doe.com\" and created after \"2019-06-11T21:50:57.067Z\" (UTC)\n - `filter=modified=2019-06-11T21:50:57.067Z` will fetch submissions modified at exactly \"2019-06-11T21:50:57.067Z\" (UTC)\n - `filter=created>2019-06-11T00:00:00.000Z;created<2019-06-20T00:00:00.000Z` will fetch submissions created between \"2019-06-11T00:00:00.000Z\" (UTC) and \"2019-06-20T00:00:00.000Z\" (UTC)\n\n\nSupported operators (as specified in this library [api-query-params](https://github.com/loris/api-query-params)):\n - key=val `type=public`\n - key>val `count>5`\n - key>=val `rating>=9.5`\n - key `email=/@gmail\\.com$/i`\n - key!=/value/ `phone!=/^06/`\n\nNote: multiple forward slashes (/) are interpreted as a regex. To use a string comparison wrap your parameter with string(). Ex. email=string(/@gmail\\.com$/i).\n"
schema:
type: string
responses:
'200':
description: Submissions
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RetrievedSubmissionResponse'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
delete:
x-unqork-service: true
tags:
- Submissions
summary: Deletes Multiple Workflow Submissions
operationId: deleteWorkflowSubmissions
description: "Deletes multiple workflow submissions based on the ID(s) supplied. Note that workflow submissions are soft-deleted (marked deleted, but not removed). Default Max Limit per request is 50\n### Authorization Required:\n - See Submission Access ([Submission Access](#submission-access))\n"
parameters:
- $ref: '#/components/parameters/WorkflowID'
- name: destroy
in: query
description: Whether to hard delete the submission(s) from database. Value of 'destroy=true' will delete the submission(s). This option requires administrator privileges. Once deleted, the submission(s) cannot be retrieved.
schema:
type: boolean
default: false
- name: ids
in: query
description: 'A comma separated list of the ID(s) to be deleted. Note - Max limit is 50 Per Request Example - ?ids=id1,id2,id3....
'
schema:
type: string
required: true
responses:
'200':
description: Submission(s) deleted
content:
application/json:
schema:
$ref: '#/components/schemas/UpdatedSubmissionsResponse'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/workflows/{workflowId}/submissions/{submissionId}:
get:
x-unqork-service: true
tags:
- Submissions
summary: Get Workflow Submission
operationId: getWorkflowSubmission
description: "Gets a single workflow submission. Workflow submission data is transformed and returned is a specific format, based on the specified transform. JSON submission data is returned as an object, XML data is returned as a string, and PDF data is returned as a [Cloud Storage Delivery URL](#section/Cloud-Storage-Delivery) to the rendered PDF (and optionally base 64 data).\n### Authorization Required:\n - See Submission Access ([Submission Access](#submission-access))\n"
parameters:
- $ref: '#/components/parameters/WorkflowID'
- name: submissionId
in: path
description: ID of workflow submission to retrieve
required: true
schema:
type: string
- name: transformName
in: query
description: Transform to apply to workflow for output. Transform must be configured and designated for for output. Available transforms may be listed via the /transforms endpoint
schema:
type: string
- name: includeRaw
in: query
description: Whether to include the untransformed raw submission data in addition to the transformed data. Raw submission data may contain [Cloud Storage Delivery URLs](#section/Cloud-Storage-Delivery).
schema:
type: boolean
- name: includeBase64
in: query
description: Whether to include base64 PDF data in addition to the PDF url (for "njk-pdf" transforms)
schema:
type: boolean
- name: resolveCloudStorageUrls
in: query
description: When transformName is specified, Cloud Storage URLs are already resolved to the original base64 value. When this flag is specified, resolve Cloud Storage URLs to base64 data inside "rawData", as well.
schema:
type: boolean
- $ref: '#/components/parameters/DataFields'
responses:
'200':
description: Submission
content:
application/json:
schema:
$ref: '#/components/schemas/RetrievedSubmissionResponse'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
delete:
tags:
- Submissions
summary: Delete Workflow Submission
operationId: deleteWorkflowSubmission
description: "Deletes a single workflow submission based on the ID supplied. Note that workflow submissions are soft-deleted (marked deleted, but not removed).\n### Authorization Required:\n - See Submission Access ([Submission Access](#submission-access))\n"
parameters:
- $ref: '#/components/parameters/WorkflowID'
- name: submissionId
in: path
description: ID of workflow submission to delete
required: true
schema:
type: string
- name: destroy
in: query
description: Whether to hard delete the submission from database. Value of 'destroy=true' will delete the submission. This option requires administrator privileges. Once deleted, the submission cannot be retrieved back.
schema:
type: boolean
default: false
responses:
'204':
description: Submission deleted
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
put:
x-unqork-service: true
tags:
- Submissions
summary: Update Workflow Submission
operationId: updateWorkflowSubmission
description: "This endpoint is available to \"Administrator\" users only. Updates a single workflow submission based on submission ID and, if passed, dataFilter and metadataFilter. This operation supports partial \"data\" updates, i.e. data that is sent in \"data\" may include some but not all of the submission data. Update of the owner/user is supported through \"userId\". Update of current status is supported through \"currentStatus\". Partial metadata updates are supported without including the entire metadata object. To increment a numeric data key (will also initialize), use \"incrementData\" To delete a data key, use \"unsetData\". To delete a metadata key, use \"unsetMetadata\". Workflow submission data must be provided as a JSON object.\n### Authorization Required:\n - See Submission Access ([Submission Access](#submission-access))\n"
parameters:
- name: workflowId
in: path
description: ID of workflow the submission belongs to
required: true
schema:
type: string
- name: submissionId
in: path
description: ID of workflow submission to update
required: true
schema:
type: string
- name: replaceData
in: query
description: Whether to completely replace the submission data with the object passed in "data".
schema:
type: boolean
default: false
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowUpdateSubmissionRequest'
responses:
'200':
description: Successfully updated workflow submission
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowUpdateSubmissionResponse'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
WorkflowUpdateSubmissionResponse:
type: object
properties:
id:
type: string
moduleId:
type: string
userId:
type: string
description: Submission owner
created:
type: string
format: date-time
modified:
type: string
format: date-time
deleted:
type: string
format: date-time
data:
type: object
description: Raw output data
properties:
rawData:
type: object
metadata:
type: object
validationErrors:
$ref: '#/components/schemas/ValidationErrors'
status:
type: object
description: History of all statuses and current status
properties:
all:
type: array
items:
type: object
properties:
key:
type: string
user:
type: string
time:
type: string
currentStatus:
type: array
items:
type: object
properties:
key:
type: string
user:
type: string
time:
type: string
UpdateSubmissionsRequest:
type: array
items:
type: object
properties:
id:
type: string
data:
type: object
description: Raw input data
dataFilter:
$ref: '#/components/schemas/DataFilter'
incrementData:
type: object
description: Object containing data keys that should be incremented, and by what number (e.g. `{"incrementData":{"key1":1,"key2":10}}`)
unsetData:
type: object
description: Object containing data keys that should be deleted (e.g. `{"unsetData":{"key1":"","key2":""}}`)
metadata:
$ref: '#/components/schemas/MetadataRequest'
metadataFilter:
$ref: '#/components/schemas/MetadataFilter'
unsetMetadata:
type: object
description: Object containing metadata keys that should be deleted (e.g. `{"unsetMetadata":{"key.one":"","key.two":""}}`)
MetadataFilter:
description: "Filter condition against submission \"metadata\" field. Value must be a MongoDB query condition (see Examples, below). MongoDB [dot notation](https://docs.mongodb.com/manual/core/document/#dot-notation) is supported for keys.\n\nNOTE: MongoDB selectors that can be nested inside queries (such as [Comparison](https://docs.mongodb.com/manual/reference/operator/query/#comparison) and [Element](https://docs.mongodb.com/manual/reference/operator/query/#element) Selectors, e.g. `$eq`, `$in`, `$exists`) are supported. The following [Logical](https://docs.mongodb.com/manual/reference/operator/query/#logical) Selectors are also supported: `$and`, `$or`, `$nor`\n\nExamples:\n- `metadataFilter: {\"checkpoints.complete\": 1234}`\n- `metadataFilter: {\"checkpoints.complete\": {\"$exists\": true}, \"checkpoints.processed\": {\"$exists\": false}}`\n\n - Will return submissions where both `metadata.checkpoints.complete` exists AND `metadata.checkpoints.processed` does not exist\n"
type: object
Error:
type: object
description: Error
required:
- code
- message
properties:
code:
description: HTTP status code
type: integer
format: int32
enum:
- 400
- 401
- 403
- 404
- 412
- 500
message:
description: Error message
type: string
DataFilter:
description: "Filter condition against submission \"data\" field. Value must be a MongoDB query condition (see Examples, below).\n\nNOTE: MongoDB selectors that can be nested inside queries (such as [Comparison](https://docs.mongodb.com/manual/reference/operator/query/#comparison) and [Element](https://docs.mongodb.com/manual/reference/operator/query/#element) Selectors, e.g. `$eq`, `$in`, `$exists`) are supported. The following [Logical](https://docs.mongodb.com/manual/reference/operator/query/#logical) Selectors are also supported: `$and`, `$or`, `$nor`\n\nExamples:\n- `dataFilter: {\"age\": 30}`\n- `dataFilter: {\"age\": {\"$gt\": 30}, \"people.1.gender\": \"male\"}`\n\n - Will match submission where age > 30 and gender for the 2nd people element equals \"male\"\n"
type: object
SavedSubmissionResponse:
type: object
required:
- id
- moduleId
- created
- modified
properties:
id:
type: string
userId:
type: string
description: Submission owner
moduleId:
type: string
created:
type: string
format: date-time
modified:
type: string
format: date-time
deleted:
type: string
format: date-time
data:
type: object
description: Raw output data
properties:
rawData:
type: object
metadata:
type: object
validationErrors:
$ref: '#/components/schemas/ValidationErrors'
RetrievedSubmissionResponse:
type: object
required:
- id
- moduleId
- created
- modified
- data
properties:
id:
type: string
userId:
type: string
description: Submission owner
moduleId:
type: string
created:
type: string
format: date-time
modified:
type: string
format: date-time
deleted:
type: string
format: date-time
data:
type: object
description: Transformed output data
properties:
format:
type: string
enum:
- json
- xml
- pdf
jsonData:
type: object
xmlData:
type: string
pdfUrl:
type: string
format: url
pdfData:
type: string
rawData:
type: object
metadata:
type: object
validationErrors:
$ref: '#/components/schemas/ValidationErrors'
NewSubmissionRequest:
type: object
required:
- data
properties:
userId:
type: string
description: Submission owner
data:
type: object
description: Raw input data
metadata:
$ref: '#/components/schemas/MetadataRequest'
WorkflowUpdateSubmissionRequest:
type: object
properties:
userId:
type: string
description: Submission owner
data:
type: object
description: Raw input data
dataFilter:
$ref: '#/components/schemas/DataFilter'
incrementData:
type: object
description: Object containing data keys that should be incremented, and by what number (e.g. `{"incrementData":{"key1":1,"key2":10}}`)
unsetData:
type: object
description: Object containing data keys that should be deleted (e.g. `{"unsetData":{"key1":"","key2":""}}`)
metadata:
$ref: '#/components/schemas/MetadataRequest'
metadataFilter:
$ref: '#/components/schemas/MetadataFilter'
unsetMetadata:
type: object
description: Object containing metadata keys that should be deleted (e.g. `{"unsetMetadata":{"key.one":"","key.two":""}}`)
currentStatus:
type: string
description: Most recently set status message for the submission
RetrievedSubmissionMergeResponse:
type: object
required:
- id
- form
- created
- modified
- data
properties:
id:
type: string
owner:
type: string
description: Submission owner
form:
type: string
created:
type: string
format: date-time
modified:
type: string
format: date-time
deleted:
type: string
format: date-time
isRevision:
type: boolean
formArchive:
type: string
description: The form version the revision was saved under
data:
type: object
description: Transformed output data
properties:
format:
type: string
enum:
- json
- xml
- pdf
jsonData:
type: object
xmlData:
type: string
pdfUrl:
type: string
format: url
pdfData:
type: string
rawData:
type: object
conflicts:
type: array
items:
example:
- feildA
- feildB
validationErrors:
$ref: '#/components/schemas/ValidationErrors'
MetadataRequest:
type: object
description: 'Object containing key-value pairs. To set nested values, this must be an object like `{"statuses.complete": "yes", "statuses.processed": "no"}`, which is MongoDB [dot notation](https://docs.mongodb.com/manual/core/document/#dot-notation).'
UpdatedSubmissionRequest:
type: object
properties:
userId:
type: string
description: Submission owner (can be updated by "Administrator" users only)
data:
type: object
description: Raw input data
dataFilter:
$ref: '#/components/schemas/DataFilter'
incrementData:
type: object
description: Object containing data keys that should be incremented, and by what number (e.g. `{"incrementData":{"key1":1,"key2":10}}`)
unsetData:
type: object
description: Object containing data keys that should be deleted (e.g. `{"unsetData":{"key1":"","key2":""}}`)
metadata:
$ref: '#/components/schemas/MetadataRequest'
metadataFilter:
$ref: '#/components/schemas/MetadataFilter'
unsetMetadata:
type: object
description: Object containing metadata keys that should be deleted (e.g. `{"unsetMetadata":{"key.one":"","key.two":""}}`)
ValidationErrors:
type: array
items:
type: object
properties:
id:
type: string
path:
type: string
label:
type: string
parent:
type: string
message:
type: string
UpdatedSubmissionsResponse:
type: array
items:
type: object
properties:
id:
type: string
status:
type: integer
message:
type: string
description: Failure message
parameters:
MetadataFilterString:
name: metadataFilter
in: query
description: "Filter condition against submission \"metadata\" field. Value must be a stringified MongoDB query condition (see Examples, below). MongoDB [dot notation](https://docs.mongodb.com/manual/core/document/#dot-notation) is supported for keys.\n\nNOTE: MongoDB selectors that can be nested inside queries (such as [Comparison](https://docs.mongodb.com/manual/reference/operator/query/#comparison) and [Element](https://docs.mongodb.com/manual/reference/operator/query/#element) Selectors, e.g. `$eq`, `$in`, `$exists`) are supported. The following [Logical](https://docs.mongodb.com/manual/reference/operator/query/#logical) Selectors are also supported: `$and`, `$or`, `$nor`\n\nExamples:\n- `metadataFilter: {\"checkpoints.complete\": 1234}`\n- `metadataFilter: {\"checkpoints.complete\": {\"$exists\": true}, \"checkpoints.processed\": {\"$exists\": false}}`\n\n - Will return submissions where both `metadata.checkpoints.complete` exists AND `metadata.checkpoints.processed` does not exist\n"
schema:
type: string
ModuleID:
name: moduleId
in: path
description: Unique module ID
required: true
schema:
type: string
Limit:
name: limit
in: query
description: Maximum number of results to return (default 50, maximum 50)
required: false
schema:
type: integer
format: int32
default: 50
maximum: 50
Offset:
name: offset
in: query
description: Number of results to skip before selecting results. Offset is zero based.
required: false
schema:
type: integer
format: int32
default: 0
WorkflowID:
name: workflowId
in: path
description: Unique workflow ID
required: true
schema:
type: string
DataFields:
name: dataFields
in: query
description: 'Comma-separated list of dot-notation `data` fields to retrieve; for example, `&dataFields=field1,also.field2` will retrieve `{"data":{"field1":"v1","also":{"field2":"v2"}}}`. Do not include "data" in front of each field. All other submission fields will always be retrieved.
'
schema:
type: string
SubmissionSortBy:
name: sortBy
in: query
description: Field to sort by (currently supported - `"created"`, `"modified"`)
required: false
schema:
type: string
IncludeDeleted:
name: includeDeleted
in: query
description: Whether to include deleted objects in response
required: false
schema:
type: boolean
default: false
SubmissionSortOrder:
name: sortOrder
in: query
description: Order of sort, if `sortBy` is specified. One of [`1` (ascending),`-1` (descending)]
required: false
schema:
type: integer
enum:
- 1
- -1
default: 1
securitySchemes:
OAuth2:
description: "The Unqork API implements the [OAuth 2.0 Client Credentials Grant](https://datatracker.ietf.org/doc/html/rfc6749#section-1.3.4) and the [OAuth 2.0 Password Grant](https://tools.ietf.org/html/rfc6749#section-1.3.3). Access via OAuth2 Client Credentials Grant can be utilized by creating Client Credentials through the API Access Management Administration page. Access via OAuth2 Password Grant can be enabled for all users in Environment Administration. Once OAuth2 Password Grant is enabled, all Unqork users can use their Unqork username/password to retrieve an access token.\n\nIn order to utilize any of the API resources, you must first retrieve an access token by POSTing your credentials to the access token URL, e.g. using `curl`:\n```\n $ curl -u '{clientId}:{clientSecret}' -X POST --basic https://xyzfinancial.unqork.io/api/1.0/oauth2/access_token -d \"grant_type=client_credentials\"\n```\nOr:\n```\n $ curl -X POST https://xyzfinancial.unqork.io/api/1.0/oauth2/access_token -d \"grant_type=password&username={username}&password={password}\"\n```\nThis returns an \"access_token\", which you would then retain and use in any subsequent resource requests. **Access tokens expire after one hour, at which point you must retrieve a new one.** The access token should be included in a request header:\n```\n $ curl -H \"Authorization: Bearer {access_token}\" https://xyzfinancial.unqork.io/api/1.0/{endpoint}\n```\n"
type: oauth2
flows:
clientCredentials:
tokenUrl: https://xyzfinancial.unqork.io/api/1.0/oauth2/access_token
scopes:
none: N/A
password:
tokenUrl: https://xyzfinancial.unqork.io/api/1.0/oauth2/access_token
scopes:
none: N/A