mailinabox-api
JavaScript/TypeScript client SDK for the Mail-in-a-Box API.
Installing
npm install mailinabox-api --save
Usage
import {
AliasesApi,
Configuration,
ConfigurationParameters,
DnsApi,
MailUsersResponseFormat,
SslApi,
SystemApi,
UserApi,
UsersApi,
WebApi,
} from 'mailinabox-api';
const apiConfigParams: ConfigurationParameters = {
basePath: '/admin',
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD'
};
const apiConfig = new Configuration(apiConfigParams);
const aliasesApi = new AliasesApi(apiConfig);
const userApi = new UserApi(apiConfig);
const systemApi = new SystemApi(apiConfig);
const sslApi = new SslApi(apiConfig);
const dnsApi = new DnsApi(apiConfig);
const usersApi = new UsersApi(apiConfig);
const webApi = new WebApi(apiConfig);
const users = await usersApi.getMailUsers({
format: MailUsersResponseFormat.Json,
});
License
MIT License
Copyright (c) 2020 Richard Willis