lilt-node

Lilt API Binding for Javascript

View the Project on GitHub lilt/lilt-node

LiltNode.WorkflowsApi

All URIs are relative to https://lilt.com/2

Method HTTP request Description
advanceWorkflowStage POST /document/{documentId}/task/{taskId}/advance Advance workflow to the next stage
getDocumentWorkflow GET /workflows/document/{documentId} Retrieve document Workflow metadata
getWorkflowTemplates GET /workflows/templates Retrieve workflow templates
rejectWorkflowStage POST /document/{documentId}/task/{taskId}/reject Move workflow to the previous stage
setDocumentStage PUT /workflows/{documentId}/stage Set Workflow stage for a document

advanceWorkflowStage

NextWorkflowTask advanceWorkflowStage(documentId, taskId)

Advance workflow to the next stage

Advance a workflow to the next stage and mark current workflow task as complete. Example CURL: ``` curl –X –request POST 'https://lilt.com/2/workflows/document/{documentId}/task/{taskId}/advance?key=API_KEY' ```

Example

import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';

let apiInstance = new LiltNode.WorkflowsApi();
let documentId = 56; // Number | A document id.
let taskId = 56; // Number | The task id of the current workflow stage.
apiInstance.advanceWorkflowStage(documentId, taskId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
documentId Number A document id.  
taskId Number The task id of the current workflow stage.  

Return type

NextWorkflowTask

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

getDocumentWorkflow

DocumentWorkflow getDocumentWorkflow(documentId)

Retrieve document Workflow metadata

Get Workflow metadata related to a document. This is useful for gathering information about the current Workflow stage of a document. Example CURL: ``` curl –X –request GET 'https://lilt.com/2/workflows/document/{documentId}?key=API_KEY' ```

Example

import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';

let apiInstance = new LiltNode.WorkflowsApi();
let documentId = 56; // Number | A document id.
apiInstance.getDocumentWorkflow(documentId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
documentId Number A document id.  

Return type

DocumentWorkflow

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

getWorkflowTemplates

[WorkflowTemplate] getWorkflowTemplates()

Retrieve workflow templates

Get all the possible Workflow Templates owned by the team. Useful for retrieving the ids corresponding to each workflow tables, and passing them to subsequent requests, for example, creating a new Job with a specific Workflow. Example CURL: ``` curl –X –request GET 'https://lilt.com/2/workflows/templates?key=API_KEY' ```

Example

import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';

let apiInstance = new LiltNode.WorkflowsApi();
apiInstance.getWorkflowTemplates().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

[WorkflowTemplate]

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

rejectWorkflowStage

NextWorkflowTask rejectWorkflowStage(documentId, taskId)

Move workflow to the previous stage

Move a workflow to the previous stage and mark current workflow task as rejected. Example CURL: ``` curl –X –request POST 'https://lilt.com/2/workflows/document/{documentId}/task/{taskId}/reject?key=API_KEY' ```

Example

import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';

let apiInstance = new LiltNode.WorkflowsApi();
let documentId = 56; // Number | A document id.
let taskId = 56; // Number | The task id of the current workflow stage.
apiInstance.rejectWorkflowStage(documentId, taskId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
documentId Number A document id.  
taskId Number The task id of the current workflow stage.  

Return type

NextWorkflowTask

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

setDocumentStage

NextWorkflowTask setDocumentStage(documentId, opts)

Set Workflow stage for a document

Set the Workflow stage for a document. You can find the stage information required for this request from the \"Retrieve document Workflow metadata\" endpoint. Example CURL: ``` curl –X –request PUT 'https://lilt.com/2/workflows/document/{documentId}/stage?key=API_KEY' \ –header 'Content-Type: application/json' \ –data-raw '{ \"workflowStageId\": {workflowStageId} }' ```

Example

import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';

let apiInstance = new LiltNode.WorkflowsApi();
let documentId = 56; // Number | A document id.
let opts = {
  'workflowStageId': new LiltNode.SetDocumentStageRequest() // SetDocumentStageRequest | 
};
apiInstance.setDocumentStage(documentId, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
documentId Number A document id.  
workflowStageId SetDocumentStageRequest   [optional]

Return type

NextWorkflowTask

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers