/* 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 { ErrorModel } from '../models'; import { FileModel } from '../models'; import { UploadsUploadBytesModel } from '../models'; import { UploadsUploadBytesRequest } from '../models'; /** * UploadApi - axios parameter creator * @export */ export const UploadApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @summary Uploads a file by sending a JSON request with the bytes in Base 64 format. * @param {UploadsUploadBytesRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiUploadsBytesPost: async (body?: UploadsUploadBytesRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/uploads/bytes`; // 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, }; }, /** * The id returned by this API should be used as paremeter to other APIs. You may also use the location property to display a preview of the uploaded file. * @summary Uploads a file by sending a multipart/form-data request * @param {any} [file] * @param {*} [options] Override http request option. * @throws {RequiredError} */ apiUploadsPostForm: async (file?: any, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/uploads`; // 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; const localVarFormParams = new FormData(); // 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 (file !== undefined) { localVarFormParams.append('file', file as any); } localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; 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}; localVarRequestOptions.data = localVarFormParams; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, } }; /** * UploadApi - functional programming interface * @export */ export const UploadApiFp = function(configuration?: Configuration) { return { /** * * @summary Uploads a file by sending a JSON request with the bytes in Base 64 format. * @param {UploadsUploadBytesRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiUploadsBytesPost(body?: UploadsUploadBytesRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await UploadApiAxiosParamCreator(configuration).apiUploadsBytesPost(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * The id returned by this API should be used as paremeter to other APIs. You may also use the location property to display a preview of the uploaded file. * @summary Uploads a file by sending a multipart/form-data request * @param {any} [file] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiUploadsPostForm(file?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await UploadApiAxiosParamCreator(configuration).apiUploadsPostForm(file, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * UploadApi - factory interface * @export */ export const UploadApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * * @summary Uploads a file by sending a JSON request with the bytes in Base 64 format. * @param {UploadsUploadBytesRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiUploadsBytesPost(body?: UploadsUploadBytesRequest, options?: AxiosRequestConfig): Promise> { return UploadApiFp(configuration).apiUploadsBytesPost(body, options).then((request) => request(axios, basePath)); }, /** * The id returned by this API should be used as paremeter to other APIs. You may also use the location property to display a preview of the uploaded file. * @summary Uploads a file by sending a multipart/form-data request * @param {any} [file] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiUploadsPostForm(file?: any, options?: AxiosRequestConfig): Promise> { return UploadApiFp(configuration).apiUploadsPostForm(file, options).then((request) => request(axios, basePath)); }, }; }; /** * UploadApi - object-oriented interface * @export * @class UploadApi * @extends {BaseAPI} */ export class UploadApi extends BaseAPI { /** * * @summary Uploads a file by sending a JSON request with the bytes in Base 64 format. * @param {UploadsUploadBytesRequest} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UploadApi */ public async apiUploadsBytesPost(body?: UploadsUploadBytesRequest, options?: AxiosRequestConfig) : Promise> { return UploadApiFp(this.configuration).apiUploadsBytesPost(body, options).then((request) => request(this.axios, this.basePath)); } /** * The id returned by this API should be used as paremeter to other APIs. You may also use the location property to display a preview of the uploaded file. * @summary Uploads a file by sending a multipart/form-data request * @param {any} [file] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UploadApi */ public async apiUploadsPostForm(file?: any, options?: AxiosRequestConfig) : Promise> { return UploadApiFp(this.configuration).apiUploadsPostForm(file, options).then((request) => request(this.axios, this.basePath)); } }