/* 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*:
- CertificateNotFound
- DocumentNotFound
- FolderNotFound
- CpfMismatch
- CpfNotExpected
- InvalidFlowAction
- DocumentInvalidKey
*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:
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 { FoldersFolderCreateRequest } from '../models';
import { FoldersFolderDeleteRequest } from '../models';
import { FoldersFolderInfoModel } from '../models';
import { FoldersFolderOrganizationModel } from '../models';
import { PaginatedSearchResponseFoldersFolderInfoModel } from '../models';
import { PaginationOrders } from '../models';
/**
* FoldersApi - axios parameter creator
* @export
*/
export const FoldersApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* The Q parameter allows you to filter by folder name.
* @summary Retrieves all folders paginating the response
* @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 {boolean} [filterByParent] if true filters by the parentId parameter
* @param {string} [parentId] Id of the parent folder
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiFoldersGet: async (Q?: string, limit?: number, offset?: number, order?: PaginationOrders, filterByParent?: boolean, parentId?: string, options: AxiosRequestConfig = {}): Promise => {
const localVarPath = `/api/folders`;
// 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 (Q !== undefined) {
localVarQueryParameter['Q'] = Q;
}
if (limit !== undefined) {
localVarQueryParameter['Limit'] = limit;
}
if (offset !== undefined) {
localVarQueryParameter['Offset'] = offset;
}
if (order !== undefined) {
localVarQueryParameter['Order'] = order;
}
if (filterByParent !== undefined) {
localVarQueryParameter['filterByParent'] = filterByParent;
}
if (parentId !== undefined) {
localVarQueryParameter['parentId'] = parentId;
}
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 folder.
* @param {string} id Id of the folder to be deleted
* @param {FoldersFolderDeleteRequest} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiFoldersIdDeletePost: async (id: string, body?: FoldersFolderDeleteRequest, 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 apiFoldersIdDeletePost.');
}
const localVarPath = `/api/folders/{id}/delete`
.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 folder's info.
* @param {string} id Folder id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiFoldersIdGet: 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 apiFoldersIdGet.');
}
const localVarPath = `/api/folders/{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,
};
},
/**
*
* @summary Creates a folder.
* @param {FoldersFolderCreateRequest} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiFoldersPost: async (body?: FoldersFolderCreateRequest, options: AxiosRequestConfig = {}): Promise => {
const localVarPath = `/api/folders`;
// 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,
};
},
}
};
/**
* FoldersApi - functional programming interface
* @export
*/
export const FoldersApiFp = function(configuration?: Configuration) {
return {
/**
* The Q parameter allows you to filter by folder name.
* @summary Retrieves all folders paginating the response
* @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 {boolean} [filterByParent] if true filters by the parentId parameter
* @param {string} [parentId] Id of the parent folder
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiFoldersGet(Q?: string, limit?: number, offset?: number, order?: PaginationOrders, filterByParent?: boolean, parentId?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> {
const localVarAxiosArgs = await FoldersApiAxiosParamCreator(configuration).apiFoldersGet(Q, limit, offset, order, filterByParent, parentId, 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 folder.
* @param {string} id Id of the folder to be deleted
* @param {FoldersFolderDeleteRequest} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiFoldersIdDeletePost(id: string, body?: FoldersFolderDeleteRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> {
const localVarAxiosArgs = await FoldersApiAxiosParamCreator(configuration).apiFoldersIdDeletePost(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 folder's info.
* @param {string} id Folder id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiFoldersIdGet(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> {
const localVarAxiosArgs = await FoldersApiAxiosParamCreator(configuration).apiFoldersIdGet(id, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary Creates a folder.
* @param {FoldersFolderCreateRequest} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiFoldersPost(body?: FoldersFolderCreateRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> {
const localVarAxiosArgs = await FoldersApiAxiosParamCreator(configuration).apiFoldersPost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
}
};
/**
* FoldersApi - factory interface
* @export
*/
export const FoldersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
return {
/**
* The Q parameter allows you to filter by folder name.
* @summary Retrieves all folders paginating the response
* @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 {boolean} [filterByParent] if true filters by the parentId parameter
* @param {string} [parentId] Id of the parent folder
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiFoldersGet(Q?: string, limit?: number, offset?: number, order?: PaginationOrders, filterByParent?: boolean, parentId?: string, options?: AxiosRequestConfig): Promise> {
return FoldersApiFp(configuration).apiFoldersGet(Q, limit, offset, order, filterByParent, parentId, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Deletes a folder.
* @param {string} id Id of the folder to be deleted
* @param {FoldersFolderDeleteRequest} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiFoldersIdDeletePost(id: string, body?: FoldersFolderDeleteRequest, options?: AxiosRequestConfig): Promise> {
return FoldersApiFp(configuration).apiFoldersIdDeletePost(id, body, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Retrieves the folder's info.
* @param {string} id Folder id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiFoldersIdGet(id: string, options?: AxiosRequestConfig): Promise> {
return FoldersApiFp(configuration).apiFoldersIdGet(id, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Creates a folder.
* @param {FoldersFolderCreateRequest} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiFoldersPost(body?: FoldersFolderCreateRequest, options?: AxiosRequestConfig): Promise> {
return FoldersApiFp(configuration).apiFoldersPost(body, options).then((request) => request(axios, basePath));
},
};
};
/**
* FoldersApi - object-oriented interface
* @export
* @class FoldersApi
* @extends {BaseAPI}
*/
export class FoldersApi extends BaseAPI {
/**
* The Q parameter allows you to filter by folder name.
* @summary Retrieves all folders paginating the response
* @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 {boolean} [filterByParent] if true filters by the parentId parameter
* @param {string} [parentId] Id of the parent folder
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FoldersApi
*/
public async apiFoldersGet(Q?: string, limit?: number, offset?: number, order?: PaginationOrders, filterByParent?: boolean, parentId?: string, options?: AxiosRequestConfig) : Promise> {
return FoldersApiFp(this.configuration).apiFoldersGet(Q, limit, offset, order, filterByParent, parentId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Deletes a folder.
* @param {string} id Id of the folder to be deleted
* @param {FoldersFolderDeleteRequest} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FoldersApi
*/
public async apiFoldersIdDeletePost(id: string, body?: FoldersFolderDeleteRequest, options?: AxiosRequestConfig) : Promise> {
return FoldersApiFp(this.configuration).apiFoldersIdDeletePost(id, body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Retrieves the folder's info.
* @param {string} id Folder id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FoldersApi
*/
public async apiFoldersIdGet(id: string, options?: AxiosRequestConfig) : Promise> {
return FoldersApiFp(this.configuration).apiFoldersIdGet(id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Creates a folder.
* @param {FoldersFolderCreateRequest} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FoldersApi
*/
public async apiFoldersPost(body?: FoldersFolderCreateRequest, options?: AxiosRequestConfig) : Promise> {
return FoldersApiFp(this.configuration).apiFoldersPost(body, options).then((request) => request(this.axios, this.basePath));
}
}