1.0.0 • Published 5 years ago

rackspace-email-api-wrapper v1.0.0

Weekly downloads
15
License
MIT
Repository
github
Last release
5 years ago

Rackspace Email API Wrapper

npm pack age

Version Build Status

Maintainability Test Coverage Greenkeeper badge

Weekly Downloads Monthly Downloads Yearly Downloads

Issues Pull Requests

Dependencies Dev Dependencies

Rackspace Email API Wrapper is a wrapper for making calls to Rackspace's Email API

Rackspace Documentation

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

1.0.0

5 years ago

0.0.1

6 years ago