mkm-api

2.1.0 • Public • Published

MKM API Client

This is a simple node JS client for MKM API.

You first need to request your keys and tokens from magiccardmarket.eu .

Installation

npm install mkm-api

Usage

const MkmApiClient = require('mkm-api');
const Client = new MkMApiClient('<app_key>', '<secret_key>');
 
Client.get('/ws/v2.0/products/find', {search: 'something to search'}).then(res=> {
    console.log(res.response);
}).catch(e => {
    // oops..
});
 

The Client only accepts .get and .post methods for now. But you can use:

Client.request('PUT', '/ws/v2.0/products/find', {search: 'something to search'});

To use any method.

If you need access tokens for 3d party apps, you can use the method:

Client.setAccessTokens(<access_token>, <access_token_secret>);

Full usage

.request

The full method is defined as:

Client.request = function(method, path, data, headers, tokens);

Meaning that you can set your own headers and tokens.

Note that if you set tokens in this request (or in .get and .post methods), they will override those set by setAccessTokens.

Readme

Keywords

none

Package Sidebar

Install

npm i mkm-api

Weekly Downloads

1

Version

2.1.0

License

ISC

Unpacked Size

8.7 kB

Total Files

5

Last publish

Collaborators

  • jsmrcaga