1.0.0 • Published 5 years ago
rackspace-email-api-wrapper v1.0.0
Rackspace Email API Wrapper
Rackspace Email API Wrapper is a wrapper for making calls to Rackspace's Email API
Installation
yarn install rackspace-email-api-wrapper
Getting Started
const rackspace = require('rackspace-email-api-wrapper');
rackspace.init(YOUR_USER_KEY, YOUR_SECRET_KEY);
const getCustomer = async () => {
const response = await rackspace.api('GET', `/customers?startswith=UserName`);
console.log(response);
// OR
rackspace.api('GET', `/customers?startswith=UserName`).then((response) => {
console.log(repsonse);
});
};
const createCustomer = async () => {
const response = await rackspace.api('POST', '/customers', {
name: 'UserName',
});
console.log(response);
// OR
rackspace
.api('POST', '/customers', {
name: 'UserName',
})
.then((response) => {
console.log(repsonse);
});
};
API
init - init(key, secret)
The init method sets the key and secret used for authenticating the API calls
api - api(method, url, payload)
The api method creates a signed request and parses the response. It returns a promise that can be awaited if you are using asycn / await