Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Latest commit

 

History

History
85 lines (61 loc) · 2.42 KB

README.md

File metadata and controls

85 lines (61 loc) · 2.42 KB

mashery

Client for Mashery API

Build Status

Getting Started

Install the module with: npm install mashery

// Load and configure the module
var mashery = require('mashery').configure({
	url: 'https://api.mashery.com/v2/json-rpc/000',
	key: 'xxxxxxxxxxxxxxxxxxxxxxxx',
	secret: 'xxxxxxxxxx'
});

// Prepare the request
var parameters = {
	service_key: 'xxxxxxxxxxxxxxxxxxxxxxxx',
	client: {
		client_id: 'xxxxxxxxxxxxxxxxxxxxxxxx',
		client_secret: 'xxxxxxxxxxxxxxxxxxxxxxxx'
	},
	token_data: {
		grant_type: 'client_credentials'
	}
};

// Call the API (this example creates an OAuth token)
mashery('oauth2.createAccessToken', parameters, function (error, response, body) {
	if (error) {
		console.log(error);
	} else {
		console.log(body);
	}
});

Release History

This module is semantically versioned: http://semver.org

Version 0.1.0 2013-01-06

  • Initial release

Contributing

Before writing code, we suggest you search for issues or create a new one to confirm where your contribution fits into our roadmap.

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Acknowledgements

We are grateful to the following maintainers, contributors, and sponsors of the technologies used by this module.

  • Node.js

  • Request (De facto HTTP request module for Node)

  • grunt (Build tool for JavaScript projects)

##Authors

Adam Alexander

Copyright and license

Copyright (c) 2013 ExactTarget

Licensed under the MIT License (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the COPYING file.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.