/* tslint:disable */ /* eslint-disable */ /** * Dropsigner *

Authentication

In order to call this APIs, you will need an API key. Set the API key in the header X-Api-Key:

X-Api-Key: your-app|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

HTTP Codes

The APIs will return the following HTTP codes:

Code Description
200 (OK) Request processed successfully. The response is different for each API, please refer to the operation's documentation
400 (Bad Request) Syntax error. For instance, when a required field was not provided
401 (Unauthorized) API key not provided or invalid
403 (Forbidden) API key is valid, but the application has insufficient permissions to complete the requested operation
422 (Unprocessable Entity) API error. The response is as defined in ErrorModel

Error Codes

Some of the error codes returned in a 422 response are provided bellow*:

*The codes shown above are the main error codes. Nonetheless, this list is not comprehensive. New codes may be added anytime without previous warning.


Webhooks

It is recomended to subscribe to Webhook events instead of polling APIs. To do so, enable webhooks and register an URL that will receive a POST request whenever one of the events bellow occur.

All requests have the format described in Webhooks.WebhookModel. The data field varies according to the webhook event type:

Event type Description Payload
DocumentSigned Triggered when a document is signed. Webhooks.DocumentSignedModel
DocumentApproved Triggered when a document is approved. Webhooks.DocumentApprovedModel
DocumentRefused Triggered when a document is refused. Webhooks.DocumentRefusedModel
DocumentConcluded Triggered when the flow of a document is concluded. Webhooks.DocumentConcludedModel
DocumentCanceled Triggered when the document is canceled. Webhooks.DocumentCanceledModel
DocumentExpired (v1.33.0) Triggered when the document is expired. Webhooks.DocumentExpiredModel
DocumentsCreated (v1.50.0) Triggered when one or more documents are created. Webhooks.DocumentsCreatedModel
DocumentsDeleted (v1.78.0) Triggered when one or more documents are deleted. Webhooks.DocumentsDeletedModel

To register your application URL and enable Webhooks, access the integrations section in your organization's details page.

* * OpenAPI spec version: 2.6.0 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; import { BatchItemResultModel } from '../models'; import { DocumentDownloadTypes } from '../models'; import { DocumentFilterStatus } from '../models'; import { DocumentQueryTypes } from '../models'; import { DocumentTicketType } from '../models'; import { DocumentTypes } from '../models'; import { DocumentsActionUrlRequest } from '../models'; import { DocumentsActionUrlResponse } from '../models'; import { DocumentsCancelDocumentRequest } from '../models'; import { DocumentsCreateDocumentRequest } from '../models'; import { DocumentsCreateDocumentResult } from '../models'; import { DocumentsDocumentAddVersionRequest } from '../models'; import { DocumentsDocumentContentModel } from '../models'; import { DocumentsDocumentFlowEditRequest } from '../models'; import { DocumentsDocumentModel } from '../models'; import { DocumentsDocumentNotifiedEmailsEditRequest } from '../models'; import { DocumentsDocumentSignaturesInfoModel } from '../models'; import { DocumentsEnvelopeAddVersionRequest } from '../models'; import { DocumentsMoveDocumentBatchRequest } from '../models'; import { DocumentsMoveDocumentRequest } from '../models'; import { ErrorModel } from '../models'; import { FlowActionsDocumentFlowEditResponse } from '../models'; import { FolderType } from '../models'; import { PaginatedSearchResponseDocumentsDocumentListModel } from '../models'; import { PaginationOrders } from '../models'; import { ParticipantQueryTypes } from '../models'; import { RefusalRefusalRequest } from '../models'; import { SignatureSignaturesInfoRequest } from '../models'; import { SignerModel } from '../models'; import { TicketModel } from '../models'; /** * DocumentsApi - axios parameter creator * @export */ export const DocumentsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @summary Moves a batch of documents to a folder. * @param {DocumentsMoveDocumentBatchRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsBatchFolderPost: async (body?: DocumentsMoveDocumentBatchRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/documents/batch/folder`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * You may filter the documents by folder and document type. * @summary Retrieves the documents of the organization paginating the response. * @param {boolean} [isConcluded] (DEPRECATED) Please use \"Status\" parameter instead. Set to true to list concluded documents, false to list pending documents. * @param {DocumentFilterStatus} [status] Filters by document status. Will override the \"IsConcluded\" property. * @param {string} [folderId] * @param {FolderType} [folderType] * @param {DocumentTypes} [documentType] * @param {boolean} [filterByDocumentType] True if the documents should be filtered by type, use documentType to specify the document type. If you want to filter only documents without a type, set this parameter to true and the documentType to null. * @param {boolean} [filterByPendingSignature] True if documents should be filtered only for those that have FlowAction of the type Signer or SignRule * @param {DocumentQueryTypes} [queryType] * @param {string} [participantQ] Query to filter by participant * @param {ParticipantQueryTypes} [participantQueryType] * @param {string} [tags] Label/value pairs are separated by \"|\" (optional) and Tags separated by \",\". Only the first 10 pairs will be considered. To search by tag value only, do not use the \"|\". * @param {boolean} [isDeleted] Returns deleted documents that had the specified document status when deleted. * @param {string} [Q] Query to filter items. * @param {number} [limit] Number of items to return. * @param {number} [offset] The offset of the searched page (starting with 0). * @param {PaginationOrders} [order] * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsGet: async (isConcluded?: boolean, status?: DocumentFilterStatus, folderId?: string, folderType?: FolderType, documentType?: DocumentTypes, filterByDocumentType?: boolean, filterByPendingSignature?: boolean, queryType?: DocumentQueryTypes, participantQ?: string, participantQueryType?: ParticipantQueryTypes, tags?: string, isDeleted?: boolean, Q?: string, limit?: number, offset?: number, order?: PaginationOrders, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/documents`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } if (isConcluded !== undefined) { localVarQueryParameter['IsConcluded'] = isConcluded; } if (status !== undefined) { localVarQueryParameter['Status'] = status; } if (folderId !== undefined) { localVarQueryParameter['FolderId'] = folderId; } if (folderType !== undefined) { localVarQueryParameter['FolderType'] = folderType; } if (documentType !== undefined) { localVarQueryParameter['DocumentType'] = documentType; } if (filterByDocumentType !== undefined) { localVarQueryParameter['FilterByDocumentType'] = filterByDocumentType; } if (filterByPendingSignature !== undefined) { localVarQueryParameter['FilterByPendingSignature'] = filterByPendingSignature; } if (queryType !== undefined) { localVarQueryParameter['QueryType'] = queryType; } if (participantQ !== undefined) { localVarQueryParameter['ParticipantQ'] = participantQ; } if (participantQueryType !== undefined) { localVarQueryParameter['ParticipantQueryType'] = participantQueryType; } if (tags !== undefined) { localVarQueryParameter['Tags'] = tags; } if (isDeleted !== undefined) { localVarQueryParameter['IsDeleted'] = isDeleted; } if (Q !== undefined) { localVarQueryParameter['Q'] = Q; } if (limit !== undefined) { localVarQueryParameter['Limit'] = limit; } if (offset !== undefined) { localVarQueryParameter['Offset'] = offset; } if (order !== undefined) { localVarQueryParameter['Order'] = order; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * This API will return an URL that allows an user to sign or approve the document without having to wait to receive an email notification. If the document has multiple pending actions, this API will return the URL of the first pending action for the matched user. After the action has been completed, you may call this API again to retrieve the URL for the next action (if any). Please note that using the URL returned will be recorded in the evidences of the action as an Application Authentication. * @summary Retrieves an URL to redirect the user to the first pending action of the document. * @param {string} id Document Id * @param {DocumentsActionUrlRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsIdActionUrlPost: async (id: string, body?: DocumentsActionUrlRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiDocumentsIdActionUrlPost.'); } const localVarPath = `/api/documents/{id}/action-url` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * CAUTION: This action cannot be reverted. * @summary Cancels the document by providing a reason for the cancellation. * @param {string} id * @param {DocumentsCancelDocumentRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsIdCancellationPost: async (id: string, body?: DocumentsCancelDocumentRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiDocumentsIdCancellationPost.'); } const localVarPath = `/api/documents/{id}/cancellation` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Downloads a specific version type of the document encoding the bytes in Base 64 format. * @param {string} id Document id * @param {DocumentDownloadTypes} [type] The version type to download * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsIdContentB64Get: async (id: string, type?: DocumentDownloadTypes, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiDocumentsIdContentB64Get.'); } const localVarPath = `/api/documents/{id}/content-b64` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } if (type !== undefined) { localVarQueryParameter['type'] = type; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Downloads a specific version type of the document. * @param {string} id Document id * @param {DocumentDownloadTypes} [type] The version type to download * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsIdContentGet: async (id: string, type?: DocumentDownloadTypes, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiDocumentsIdContentGet.'); } const localVarPath = `/api/documents/{id}/content` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } if (type !== undefined) { localVarQueryParameter['type'] = type; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Deletes a specific document using it's id. * @param {string} id Document id * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsIdDelete: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiDocumentsIdDelete.'); } const localVarPath = `/api/documents/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * The flow of the document will be restarted. * @summary Adds a new version for an envelope. * @param {string} id * @param {DocumentsEnvelopeAddVersionRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsIdEnvelopeVersionsPost: async (id: string, body?: DocumentsEnvelopeAddVersionRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiDocumentsIdEnvelopeVersionsPost.'); } const localVarPath = `/api/documents/{id}/envelope/versions` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Updates the document's flow. * @param {string} id Id of the document * @param {DocumentsDocumentFlowEditRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsIdFlowPost: async (id: string, body?: DocumentsDocumentFlowEditRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiDocumentsIdFlowPost.'); } const localVarPath = `/api/documents/{id}/flow` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Moves a document to a folder. * @param {string} id * @param {DocumentsMoveDocumentRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsIdFolderPost: async (id: string, body?: DocumentsMoveDocumentRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiDocumentsIdFolderPost.'); } const localVarPath = `/api/documents/{id}/folder` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Retrieves the document's details. * @param {string} id Document id * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsIdGet: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiDocumentsIdGet.'); } const localVarPath = `/api/documents/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * The notified emails are the ones that will be notified after the document is concluded. * @summary Updates the document's notified emails * @param {string} id Id of the document * @param {DocumentsDocumentNotifiedEmailsEditRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsIdNotifiedEmailsPut: async (id: string, body?: DocumentsDocumentNotifiedEmailsEditRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiDocumentsIdNotifiedEmailsPut.'); } const localVarPath = `/api/documents/{id}/notified-emails` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * The document's flow will pause and can only be resumed by adding a new version of the document (see Add Version API). * @summary Refuses a document by providing a reason for the refusal. * @param {string} id * @param {RefusalRefusalRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsIdRefusalPost: async (id: string, body?: RefusalRefusalRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiDocumentsIdRefusalPost.'); } const localVarPath = `/api/documents/{id}/refusal` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * This will perform the same validations as verifying the document signatures using the verification code. * @summary Retrieves the details of the document's signatures. * @param {string} id The Id of the document * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsIdSignaturesDetailsGet: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiDocumentsIdSignaturesDetailsGet.'); } const localVarPath = `/api/documents/{id}/signatures-details` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * The URL does not require authentication and will be available for 1 hour.
  • Original: the original file provided when the document was created.
  • OriginalWithMarks: the original file with all marks added (for example when an user approves the document and includes its signature image).
  • PrinterFriendlyVersion: if the original document is PDF, the version with marks and a appended signature manifest, otherwise a PDF file with the signature manifest.
  • Signatures: if the original document is PDF, the signed PDF file, otherwise the .p7s file.
* @summary Generates a URL (ticket) to download a specific version type of the document. * @param {string} id Document id * @param {DocumentTicketType} [type] The version type to download * @param {boolean} [preview] If true, when downloading the document, the response will not include the name of the file (useful when embedding the document inside a web page for previewing) * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsIdTicketGet: async (id: string, type?: DocumentTicketType, preview?: boolean, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiDocumentsIdTicketGet.'); } const localVarPath = `/api/documents/{id}/ticket` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } if (type !== undefined) { localVarQueryParameter['type'] = type; } if (preview !== undefined) { localVarQueryParameter['preview'] = preview; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * The flow of the document will be restarted. If the document was created as an envelope, please use the Add Envelope Version API * @summary Adds a new version for the document. * @param {string} id * @param {DocumentsDocumentAddVersionRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsIdVersionsPost: async (id: string, body?: DocumentsDocumentAddVersionRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiDocumentsIdVersionsPost.'); } const localVarPath = `/api/documents/{id}/versions` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Validates each signature in a document using the verification code * @param {string} key The verification code presented in the document * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsKeysKeySignaturesGet: async (key: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'key' is not null or undefined if (key === null || key === undefined) { throw new RequiredError('key','Required parameter key was null or undefined when calling apiDocumentsKeysKeySignaturesGet.'); } const localVarPath = `/api/documents/keys/{key}/signatures` .replace(`{${"key"}}`, encodeURIComponent(String(key))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Before calling this API you need to upload the file(s) using the Upload API or the Upload Bytes API. When creating a big batch of documents, it is recommended to send multiple requests instead of one big request. For instance, if you want to create 100 documents, send 10 requests of 10 documents. In this case it is recommended to use the disablePendingActionNotifications option and, when all requests are finished, use the users/notify-pending API to notify participants. Returns a list of ids of each document created. * @summary Creates one or multiple documents. * @param {DocumentsCreateDocumentRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsPost: async (body?: DocumentsCreateDocumentRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/documents`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Before calling this API you need to upload the file using the Upload API or the Upload Bytes API. * @summary Validates each signature in the uploaded document * @param {SignatureSignaturesInfoRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiDocumentsValidateSignaturesPost: async (body?: SignatureSignaturesInfoRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/documents/validate-signatures`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKey required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-Api-Key") : await configuration.apiKey; localVarHeaderParameter["X-Api-Key"] = localVarApiKeyValue; } localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, } }; /** * DocumentsApi - functional programming interface * @export */ export const DocumentsApiFp = function(configuration?: Configuration) { return { /** * * @summary Moves a batch of documents to a folder. * @param {DocumentsMoveDocumentBatchRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsBatchFolderPost(body?: DocumentsMoveDocumentBatchRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsBatchFolderPost(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * You may filter the documents by folder and document type. * @summary Retrieves the documents of the organization paginating the response. * @param {boolean} [isConcluded] (DEPRECATED) Please use \"Status\" parameter instead. Set to true to list concluded documents, false to list pending documents. * @param {DocumentFilterStatus} [status] Filters by document status. Will override the \"IsConcluded\" property. * @param {string} [folderId] * @param {FolderType} [folderType] * @param {DocumentTypes} [documentType] * @param {boolean} [filterByDocumentType] True if the documents should be filtered by type, use documentType to specify the document type. If you want to filter only documents without a type, set this parameter to true and the documentType to null. * @param {boolean} [filterByPendingSignature] True if documents should be filtered only for those that have FlowAction of the type Signer or SignRule * @param {DocumentQueryTypes} [queryType] * @param {string} [participantQ] Query to filter by participant * @param {ParticipantQueryTypes} [participantQueryType] * @param {string} [tags] Label/value pairs are separated by \"|\" (optional) and Tags separated by \",\". Only the first 10 pairs will be considered. To search by tag value only, do not use the \"|\". * @param {boolean} [isDeleted] Returns deleted documents that had the specified document status when deleted. * @param {string} [Q] Query to filter items. * @param {number} [limit] Number of items to return. * @param {number} [offset] The offset of the searched page (starting with 0). * @param {PaginationOrders} [order] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsGet(isConcluded?: boolean, status?: DocumentFilterStatus, folderId?: string, folderType?: FolderType, documentType?: DocumentTypes, filterByDocumentType?: boolean, filterByPendingSignature?: boolean, queryType?: DocumentQueryTypes, participantQ?: string, participantQueryType?: ParticipantQueryTypes, tags?: string, isDeleted?: boolean, Q?: string, limit?: number, offset?: number, order?: PaginationOrders, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsGet(isConcluded, status, folderId, folderType, documentType, filterByDocumentType, filterByPendingSignature, queryType, participantQ, participantQueryType, tags, isDeleted, Q, limit, offset, order, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * This API will return an URL that allows an user to sign or approve the document without having to wait to receive an email notification. If the document has multiple pending actions, this API will return the URL of the first pending action for the matched user. After the action has been completed, you may call this API again to retrieve the URL for the next action (if any). Please note that using the URL returned will be recorded in the evidences of the action as an Application Authentication. * @summary Retrieves an URL to redirect the user to the first pending action of the document. * @param {string} id Document Id * @param {DocumentsActionUrlRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdActionUrlPost(id: string, body?: DocumentsActionUrlRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsIdActionUrlPost(id, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * CAUTION: This action cannot be reverted. * @summary Cancels the document by providing a reason for the cancellation. * @param {string} id * @param {DocumentsCancelDocumentRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdCancellationPost(id: string, body?: DocumentsCancelDocumentRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsIdCancellationPost(id, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Downloads a specific version type of the document encoding the bytes in Base 64 format. * @param {string} id Document id * @param {DocumentDownloadTypes} [type] The version type to download * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdContentB64Get(id: string, type?: DocumentDownloadTypes, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsIdContentB64Get(id, type, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Downloads a specific version type of the document. * @param {string} id Document id * @param {DocumentDownloadTypes} [type] The version type to download * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdContentGet(id: string, type?: DocumentDownloadTypes, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsIdContentGet(id, type, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Deletes a specific document using it's id. * @param {string} id Document id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdDelete(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsIdDelete(id, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * The flow of the document will be restarted. * @summary Adds a new version for an envelope. * @param {string} id * @param {DocumentsEnvelopeAddVersionRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdEnvelopeVersionsPost(id: string, body?: DocumentsEnvelopeAddVersionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsIdEnvelopeVersionsPost(id, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Updates the document's flow. * @param {string} id Id of the document * @param {DocumentsDocumentFlowEditRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdFlowPost(id: string, body?: DocumentsDocumentFlowEditRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsIdFlowPost(id, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Moves a document to a folder. * @param {string} id * @param {DocumentsMoveDocumentRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdFolderPost(id: string, body?: DocumentsMoveDocumentRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsIdFolderPost(id, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Retrieves the document's details. * @param {string} id Document id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdGet(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsIdGet(id, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * The notified emails are the ones that will be notified after the document is concluded. * @summary Updates the document's notified emails * @param {string} id Id of the document * @param {DocumentsDocumentNotifiedEmailsEditRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdNotifiedEmailsPut(id: string, body?: DocumentsDocumentNotifiedEmailsEditRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsIdNotifiedEmailsPut(id, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * The document's flow will pause and can only be resumed by adding a new version of the document (see Add Version API). * @summary Refuses a document by providing a reason for the refusal. * @param {string} id * @param {RefusalRefusalRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdRefusalPost(id: string, body?: RefusalRefusalRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsIdRefusalPost(id, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * This will perform the same validations as verifying the document signatures using the verification code. * @summary Retrieves the details of the document's signatures. * @param {string} id The Id of the document * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdSignaturesDetailsGet(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsIdSignaturesDetailsGet(id, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * The URL does not require authentication and will be available for 1 hour.
  • Original: the original file provided when the document was created.
  • OriginalWithMarks: the original file with all marks added (for example when an user approves the document and includes its signature image).
  • PrinterFriendlyVersion: if the original document is PDF, the version with marks and a appended signature manifest, otherwise a PDF file with the signature manifest.
  • Signatures: if the original document is PDF, the signed PDF file, otherwise the .p7s file.
* @summary Generates a URL (ticket) to download a specific version type of the document. * @param {string} id Document id * @param {DocumentTicketType} [type] The version type to download * @param {boolean} [preview] If true, when downloading the document, the response will not include the name of the file (useful when embedding the document inside a web page for previewing) * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdTicketGet(id: string, type?: DocumentTicketType, preview?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsIdTicketGet(id, type, preview, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * The flow of the document will be restarted. If the document was created as an envelope, please use the Add Envelope Version API * @summary Adds a new version for the document. * @param {string} id * @param {DocumentsDocumentAddVersionRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdVersionsPost(id: string, body?: DocumentsDocumentAddVersionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsIdVersionsPost(id, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Validates each signature in a document using the verification code * @param {string} key The verification code presented in the document * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsKeysKeySignaturesGet(key: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsKeysKeySignaturesGet(key, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Before calling this API you need to upload the file(s) using the Upload API or the Upload Bytes API. When creating a big batch of documents, it is recommended to send multiple requests instead of one big request. For instance, if you want to create 100 documents, send 10 requests of 10 documents. In this case it is recommended to use the disablePendingActionNotifications option and, when all requests are finished, use the users/notify-pending API to notify participants. Returns a list of ids of each document created. * @summary Creates one or multiple documents. * @param {DocumentsCreateDocumentRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsPost(body?: DocumentsCreateDocumentRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsPost(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Before calling this API you need to upload the file using the Upload API or the Upload Bytes API. * @summary Validates each signature in the uploaded document * @param {SignatureSignaturesInfoRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsValidateSignaturesPost(body?: SignatureSignaturesInfoRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>>> { const localVarAxiosArgs = await DocumentsApiAxiosParamCreator(configuration).apiDocumentsValidateSignaturesPost(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * DocumentsApi - factory interface * @export */ export const DocumentsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * * @summary Moves a batch of documents to a folder. * @param {DocumentsMoveDocumentBatchRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsBatchFolderPost(body?: DocumentsMoveDocumentBatchRequest, options?: AxiosRequestConfig): Promise>> { return DocumentsApiFp(configuration).apiDocumentsBatchFolderPost(body, options).then((request) => request(axios, basePath)); }, /** * You may filter the documents by folder and document type. * @summary Retrieves the documents of the organization paginating the response. * @param {boolean} [isConcluded] (DEPRECATED) Please use \"Status\" parameter instead. Set to true to list concluded documents, false to list pending documents. * @param {DocumentFilterStatus} [status] Filters by document status. Will override the \"IsConcluded\" property. * @param {string} [folderId] * @param {FolderType} [folderType] * @param {DocumentTypes} [documentType] * @param {boolean} [filterByDocumentType] True if the documents should be filtered by type, use documentType to specify the document type. If you want to filter only documents without a type, set this parameter to true and the documentType to null. * @param {boolean} [filterByPendingSignature] True if documents should be filtered only for those that have FlowAction of the type Signer or SignRule * @param {DocumentQueryTypes} [queryType] * @param {string} [participantQ] Query to filter by participant * @param {ParticipantQueryTypes} [participantQueryType] * @param {string} [tags] Label/value pairs are separated by \"|\" (optional) and Tags separated by \",\". Only the first 10 pairs will be considered. To search by tag value only, do not use the \"|\". * @param {boolean} [isDeleted] Returns deleted documents that had the specified document status when deleted. * @param {string} [Q] Query to filter items. * @param {number} [limit] Number of items to return. * @param {number} [offset] The offset of the searched page (starting with 0). * @param {PaginationOrders} [order] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsGet(isConcluded?: boolean, status?: DocumentFilterStatus, folderId?: string, folderType?: FolderType, documentType?: DocumentTypes, filterByDocumentType?: boolean, filterByPendingSignature?: boolean, queryType?: DocumentQueryTypes, participantQ?: string, participantQueryType?: ParticipantQueryTypes, tags?: string, isDeleted?: boolean, Q?: string, limit?: number, offset?: number, order?: PaginationOrders, options?: AxiosRequestConfig): Promise> { return DocumentsApiFp(configuration).apiDocumentsGet(isConcluded, status, folderId, folderType, documentType, filterByDocumentType, filterByPendingSignature, queryType, participantQ, participantQueryType, tags, isDeleted, Q, limit, offset, order, options).then((request) => request(axios, basePath)); }, /** * This API will return an URL that allows an user to sign or approve the document without having to wait to receive an email notification. If the document has multiple pending actions, this API will return the URL of the first pending action for the matched user. After the action has been completed, you may call this API again to retrieve the URL for the next action (if any). Please note that using the URL returned will be recorded in the evidences of the action as an Application Authentication. * @summary Retrieves an URL to redirect the user to the first pending action of the document. * @param {string} id Document Id * @param {DocumentsActionUrlRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdActionUrlPost(id: string, body?: DocumentsActionUrlRequest, options?: AxiosRequestConfig): Promise> { return DocumentsApiFp(configuration).apiDocumentsIdActionUrlPost(id, body, options).then((request) => request(axios, basePath)); }, /** * CAUTION: This action cannot be reverted. * @summary Cancels the document by providing a reason for the cancellation. * @param {string} id * @param {DocumentsCancelDocumentRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdCancellationPost(id: string, body?: DocumentsCancelDocumentRequest, options?: AxiosRequestConfig): Promise> { return DocumentsApiFp(configuration).apiDocumentsIdCancellationPost(id, body, options).then((request) => request(axios, basePath)); }, /** * * @summary Downloads a specific version type of the document encoding the bytes in Base 64 format. * @param {string} id Document id * @param {DocumentDownloadTypes} [type] The version type to download * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdContentB64Get(id: string, type?: DocumentDownloadTypes, options?: AxiosRequestConfig): Promise> { return DocumentsApiFp(configuration).apiDocumentsIdContentB64Get(id, type, options).then((request) => request(axios, basePath)); }, /** * * @summary Downloads a specific version type of the document. * @param {string} id Document id * @param {DocumentDownloadTypes} [type] The version type to download * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdContentGet(id: string, type?: DocumentDownloadTypes, options?: AxiosRequestConfig): Promise> { return DocumentsApiFp(configuration).apiDocumentsIdContentGet(id, type, options).then((request) => request(axios, basePath)); }, /** * * @summary Deletes a specific document using it's id. * @param {string} id Document id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdDelete(id: string, options?: AxiosRequestConfig): Promise> { return DocumentsApiFp(configuration).apiDocumentsIdDelete(id, options).then((request) => request(axios, basePath)); }, /** * The flow of the document will be restarted. * @summary Adds a new version for an envelope. * @param {string} id * @param {DocumentsEnvelopeAddVersionRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdEnvelopeVersionsPost(id: string, body?: DocumentsEnvelopeAddVersionRequest, options?: AxiosRequestConfig): Promise> { return DocumentsApiFp(configuration).apiDocumentsIdEnvelopeVersionsPost(id, body, options).then((request) => request(axios, basePath)); }, /** * * @summary Updates the document's flow. * @param {string} id Id of the document * @param {DocumentsDocumentFlowEditRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdFlowPost(id: string, body?: DocumentsDocumentFlowEditRequest, options?: AxiosRequestConfig): Promise> { return DocumentsApiFp(configuration).apiDocumentsIdFlowPost(id, body, options).then((request) => request(axios, basePath)); }, /** * * @summary Moves a document to a folder. * @param {string} id * @param {DocumentsMoveDocumentRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdFolderPost(id: string, body?: DocumentsMoveDocumentRequest, options?: AxiosRequestConfig): Promise> { return DocumentsApiFp(configuration).apiDocumentsIdFolderPost(id, body, options).then((request) => request(axios, basePath)); }, /** * * @summary Retrieves the document's details. * @param {string} id Document id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdGet(id: string, options?: AxiosRequestConfig): Promise> { return DocumentsApiFp(configuration).apiDocumentsIdGet(id, options).then((request) => request(axios, basePath)); }, /** * The notified emails are the ones that will be notified after the document is concluded. * @summary Updates the document's notified emails * @param {string} id Id of the document * @param {DocumentsDocumentNotifiedEmailsEditRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdNotifiedEmailsPut(id: string, body?: DocumentsDocumentNotifiedEmailsEditRequest, options?: AxiosRequestConfig): Promise> { return DocumentsApiFp(configuration).apiDocumentsIdNotifiedEmailsPut(id, body, options).then((request) => request(axios, basePath)); }, /** * The document's flow will pause and can only be resumed by adding a new version of the document (see Add Version API). * @summary Refuses a document by providing a reason for the refusal. * @param {string} id * @param {RefusalRefusalRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdRefusalPost(id: string, body?: RefusalRefusalRequest, options?: AxiosRequestConfig): Promise> { return DocumentsApiFp(configuration).apiDocumentsIdRefusalPost(id, body, options).then((request) => request(axios, basePath)); }, /** * This will perform the same validations as verifying the document signatures using the verification code. * @summary Retrieves the details of the document's signatures. * @param {string} id The Id of the document * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdSignaturesDetailsGet(id: string, options?: AxiosRequestConfig): Promise> { return DocumentsApiFp(configuration).apiDocumentsIdSignaturesDetailsGet(id, options).then((request) => request(axios, basePath)); }, /** * The URL does not require authentication and will be available for 1 hour.
  • Original: the original file provided when the document was created.
  • OriginalWithMarks: the original file with all marks added (for example when an user approves the document and includes its signature image).
  • PrinterFriendlyVersion: if the original document is PDF, the version with marks and a appended signature manifest, otherwise a PDF file with the signature manifest.
  • Signatures: if the original document is PDF, the signed PDF file, otherwise the .p7s file.
* @summary Generates a URL (ticket) to download a specific version type of the document. * @param {string} id Document id * @param {DocumentTicketType} [type] The version type to download * @param {boolean} [preview] If true, when downloading the document, the response will not include the name of the file (useful when embedding the document inside a web page for previewing) * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdTicketGet(id: string, type?: DocumentTicketType, preview?: boolean, options?: AxiosRequestConfig): Promise> { return DocumentsApiFp(configuration).apiDocumentsIdTicketGet(id, type, preview, options).then((request) => request(axios, basePath)); }, /** * The flow of the document will be restarted. If the document was created as an envelope, please use the Add Envelope Version API * @summary Adds a new version for the document. * @param {string} id * @param {DocumentsDocumentAddVersionRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsIdVersionsPost(id: string, body?: DocumentsDocumentAddVersionRequest, options?: AxiosRequestConfig): Promise> { return DocumentsApiFp(configuration).apiDocumentsIdVersionsPost(id, body, options).then((request) => request(axios, basePath)); }, /** * * @summary Validates each signature in a document using the verification code * @param {string} key The verification code presented in the document * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsKeysKeySignaturesGet(key: string, options?: AxiosRequestConfig): Promise> { return DocumentsApiFp(configuration).apiDocumentsKeysKeySignaturesGet(key, options).then((request) => request(axios, basePath)); }, /** * Before calling this API you need to upload the file(s) using the Upload API or the Upload Bytes API. When creating a big batch of documents, it is recommended to send multiple requests instead of one big request. For instance, if you want to create 100 documents, send 10 requests of 10 documents. In this case it is recommended to use the disablePendingActionNotifications option and, when all requests are finished, use the users/notify-pending API to notify participants. Returns a list of ids of each document created. * @summary Creates one or multiple documents. * @param {DocumentsCreateDocumentRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsPost(body?: DocumentsCreateDocumentRequest, options?: AxiosRequestConfig): Promise>> { return DocumentsApiFp(configuration).apiDocumentsPost(body, options).then((request) => request(axios, basePath)); }, /** * Before calling this API you need to upload the file using the Upload API or the Upload Bytes API. * @summary Validates each signature in the uploaded document * @param {SignatureSignaturesInfoRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiDocumentsValidateSignaturesPost(body?: SignatureSignaturesInfoRequest, options?: AxiosRequestConfig): Promise>> { return DocumentsApiFp(configuration).apiDocumentsValidateSignaturesPost(body, options).then((request) => request(axios, basePath)); }, }; }; /** * DocumentsApi - object-oriented interface * @export * @class DocumentsApi * @extends {BaseAPI} */ export class DocumentsApi extends BaseAPI { /** * * @summary Moves a batch of documents to a folder. * @param {DocumentsMoveDocumentBatchRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsBatchFolderPost(body?: DocumentsMoveDocumentBatchRequest, options?: AxiosRequestConfig) : Promise>> { return DocumentsApiFp(this.configuration).apiDocumentsBatchFolderPost(body, options).then((request) => request(this.axios, this.basePath)); } /** * You may filter the documents by folder and document type. * @summary Retrieves the documents of the organization paginating the response. * @param {boolean} [isConcluded] (DEPRECATED) Please use \"Status\" parameter instead. Set to true to list concluded documents, false to list pending documents. * @param {DocumentFilterStatus} [status] Filters by document status. Will override the \"IsConcluded\" property. * @param {string} [folderId] * @param {FolderType} [folderType] * @param {DocumentTypes} [documentType] * @param {boolean} [filterByDocumentType] True if the documents should be filtered by type, use documentType to specify the document type. If you want to filter only documents without a type, set this parameter to true and the documentType to null. * @param {boolean} [filterByPendingSignature] True if documents should be filtered only for those that have FlowAction of the type Signer or SignRule * @param {DocumentQueryTypes} [queryType] * @param {string} [participantQ] Query to filter by participant * @param {ParticipantQueryTypes} [participantQueryType] * @param {string} [tags] Label/value pairs are separated by \"|\" (optional) and Tags separated by \",\". Only the first 10 pairs will be considered. To search by tag value only, do not use the \"|\". * @param {boolean} [isDeleted] Returns deleted documents that had the specified document status when deleted. * @param {string} [Q] Query to filter items. * @param {number} [limit] Number of items to return. * @param {number} [offset] The offset of the searched page (starting with 0). * @param {PaginationOrders} [order] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsGet(isConcluded?: boolean, status?: DocumentFilterStatus, folderId?: string, folderType?: FolderType, documentType?: DocumentTypes, filterByDocumentType?: boolean, filterByPendingSignature?: boolean, queryType?: DocumentQueryTypes, participantQ?: string, participantQueryType?: ParticipantQueryTypes, tags?: string, isDeleted?: boolean, Q?: string, limit?: number, offset?: number, order?: PaginationOrders, options?: AxiosRequestConfig) : Promise> { return DocumentsApiFp(this.configuration).apiDocumentsGet(isConcluded, status, folderId, folderType, documentType, filterByDocumentType, filterByPendingSignature, queryType, participantQ, participantQueryType, tags, isDeleted, Q, limit, offset, order, options).then((request) => request(this.axios, this.basePath)); } /** * This API will return an URL that allows an user to sign or approve the document without having to wait to receive an email notification. If the document has multiple pending actions, this API will return the URL of the first pending action for the matched user. After the action has been completed, you may call this API again to retrieve the URL for the next action (if any). Please note that using the URL returned will be recorded in the evidences of the action as an Application Authentication. * @summary Retrieves an URL to redirect the user to the first pending action of the document. * @param {string} id Document Id * @param {DocumentsActionUrlRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsIdActionUrlPost(id: string, body?: DocumentsActionUrlRequest, options?: AxiosRequestConfig) : Promise> { return DocumentsApiFp(this.configuration).apiDocumentsIdActionUrlPost(id, body, options).then((request) => request(this.axios, this.basePath)); } /** * CAUTION: This action cannot be reverted. * @summary Cancels the document by providing a reason for the cancellation. * @param {string} id * @param {DocumentsCancelDocumentRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsIdCancellationPost(id: string, body?: DocumentsCancelDocumentRequest, options?: AxiosRequestConfig) : Promise> { return DocumentsApiFp(this.configuration).apiDocumentsIdCancellationPost(id, body, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Downloads a specific version type of the document encoding the bytes in Base 64 format. * @param {string} id Document id * @param {DocumentDownloadTypes} [type] The version type to download * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsIdContentB64Get(id: string, type?: DocumentDownloadTypes, options?: AxiosRequestConfig) : Promise> { return DocumentsApiFp(this.configuration).apiDocumentsIdContentB64Get(id, type, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Downloads a specific version type of the document. * @param {string} id Document id * @param {DocumentDownloadTypes} [type] The version type to download * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsIdContentGet(id: string, type?: DocumentDownloadTypes, options?: AxiosRequestConfig) : Promise> { return DocumentsApiFp(this.configuration).apiDocumentsIdContentGet(id, type, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Deletes a specific document using it's id. * @param {string} id Document id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsIdDelete(id: string, options?: AxiosRequestConfig) : Promise> { return DocumentsApiFp(this.configuration).apiDocumentsIdDelete(id, options).then((request) => request(this.axios, this.basePath)); } /** * The flow of the document will be restarted. * @summary Adds a new version for an envelope. * @param {string} id * @param {DocumentsEnvelopeAddVersionRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsIdEnvelopeVersionsPost(id: string, body?: DocumentsEnvelopeAddVersionRequest, options?: AxiosRequestConfig) : Promise> { return DocumentsApiFp(this.configuration).apiDocumentsIdEnvelopeVersionsPost(id, body, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Updates the document's flow. * @param {string} id Id of the document * @param {DocumentsDocumentFlowEditRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsIdFlowPost(id: string, body?: DocumentsDocumentFlowEditRequest, options?: AxiosRequestConfig) : Promise> { return DocumentsApiFp(this.configuration).apiDocumentsIdFlowPost(id, body, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Moves a document to a folder. * @param {string} id * @param {DocumentsMoveDocumentRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsIdFolderPost(id: string, body?: DocumentsMoveDocumentRequest, options?: AxiosRequestConfig) : Promise> { return DocumentsApiFp(this.configuration).apiDocumentsIdFolderPost(id, body, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Retrieves the document's details. * @param {string} id Document id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsIdGet(id: string, options?: AxiosRequestConfig) : Promise> { return DocumentsApiFp(this.configuration).apiDocumentsIdGet(id, options).then((request) => request(this.axios, this.basePath)); } /** * The notified emails are the ones that will be notified after the document is concluded. * @summary Updates the document's notified emails * @param {string} id Id of the document * @param {DocumentsDocumentNotifiedEmailsEditRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsIdNotifiedEmailsPut(id: string, body?: DocumentsDocumentNotifiedEmailsEditRequest, options?: AxiosRequestConfig) : Promise> { return DocumentsApiFp(this.configuration).apiDocumentsIdNotifiedEmailsPut(id, body, options).then((request) => request(this.axios, this.basePath)); } /** * The document's flow will pause and can only be resumed by adding a new version of the document (see Add Version API). * @summary Refuses a document by providing a reason for the refusal. * @param {string} id * @param {RefusalRefusalRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsIdRefusalPost(id: string, body?: RefusalRefusalRequest, options?: AxiosRequestConfig) : Promise> { return DocumentsApiFp(this.configuration).apiDocumentsIdRefusalPost(id, body, options).then((request) => request(this.axios, this.basePath)); } /** * This will perform the same validations as verifying the document signatures using the verification code. * @summary Retrieves the details of the document's signatures. * @param {string} id The Id of the document * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsIdSignaturesDetailsGet(id: string, options?: AxiosRequestConfig) : Promise> { return DocumentsApiFp(this.configuration).apiDocumentsIdSignaturesDetailsGet(id, options).then((request) => request(this.axios, this.basePath)); } /** * The URL does not require authentication and will be available for 1 hour.
  • Original: the original file provided when the document was created.
  • OriginalWithMarks: the original file with all marks added (for example when an user approves the document and includes its signature image).
  • PrinterFriendlyVersion: if the original document is PDF, the version with marks and a appended signature manifest, otherwise a PDF file with the signature manifest.
  • Signatures: if the original document is PDF, the signed PDF file, otherwise the .p7s file.
* @summary Generates a URL (ticket) to download a specific version type of the document. * @param {string} id Document id * @param {DocumentTicketType} [type] The version type to download * @param {boolean} [preview] If true, when downloading the document, the response will not include the name of the file (useful when embedding the document inside a web page for previewing) * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsIdTicketGet(id: string, type?: DocumentTicketType, preview?: boolean, options?: AxiosRequestConfig) : Promise> { return DocumentsApiFp(this.configuration).apiDocumentsIdTicketGet(id, type, preview, options).then((request) => request(this.axios, this.basePath)); } /** * The flow of the document will be restarted. If the document was created as an envelope, please use the Add Envelope Version API * @summary Adds a new version for the document. * @param {string} id * @param {DocumentsDocumentAddVersionRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsIdVersionsPost(id: string, body?: DocumentsDocumentAddVersionRequest, options?: AxiosRequestConfig) : Promise> { return DocumentsApiFp(this.configuration).apiDocumentsIdVersionsPost(id, body, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Validates each signature in a document using the verification code * @param {string} key The verification code presented in the document * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsKeysKeySignaturesGet(key: string, options?: AxiosRequestConfig) : Promise> { return DocumentsApiFp(this.configuration).apiDocumentsKeysKeySignaturesGet(key, options).then((request) => request(this.axios, this.basePath)); } /** * Before calling this API you need to upload the file(s) using the Upload API or the Upload Bytes API. When creating a big batch of documents, it is recommended to send multiple requests instead of one big request. For instance, if you want to create 100 documents, send 10 requests of 10 documents. In this case it is recommended to use the disablePendingActionNotifications option and, when all requests are finished, use the users/notify-pending API to notify participants. Returns a list of ids of each document created. * @summary Creates one or multiple documents. * @param {DocumentsCreateDocumentRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsPost(body?: DocumentsCreateDocumentRequest, options?: AxiosRequestConfig) : Promise>> { return DocumentsApiFp(this.configuration).apiDocumentsPost(body, options).then((request) => request(this.axios, this.basePath)); } /** * Before calling this API you need to upload the file using the Upload API or the Upload Bytes API. * @summary Validates each signature in the uploaded document * @param {SignatureSignaturesInfoRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DocumentsApi */ public async apiDocumentsValidateSignaturesPost(body?: SignatureSignaturesInfoRequest, options?: AxiosRequestConfig) : Promise>> { return DocumentsApiFp(this.configuration).apiDocumentsValidateSignaturesPost(body, options).then((request) => request(this.axios, this.basePath)); } }