2.6.2 • Published 3 years ago

mozambique-api-wrapper v2.6.2

Weekly downloads
21
License
MIT
Repository
github
Last release
3 years ago

Mozambique Here API Wrapper

A simple wrapper to use the Mozambique Here API. Please refer to the API docs to undestand the inputs and expected results.

Please refer to DOCS.md to see a simple documentation for the NPM package

How to get an auth key

Request it at the start of the documentation

Installation

Install the package

$ cd /path/to/app
$ npm install --save mozambique-api-wrapper

Usage

// Require Wrapper Library
const MozambiqueAPI = require("mozambique-api-wrapper");

// Create Client instance by passing in API key and an optional parameter to choose which API version to use (default will always be the latest version, currently 5)
let mozambiqueClient = new MozambiqueAPI("<API_KEY>", 5);

// Search Player by name
mozambiqueClient
  .search({
    platform: "X1",
    player: "acidtib",
  })
  .then(function (result) {
    console.log(result);
  })
  .catch(function (e) {
    console.log(e);
  });

// Search Player by UID
mozambiqueClient
  .search({
    platform: "X1",
    uid: "2535428181264092",
  })
  .then(function (result) {
    console.log(result);
  })
  .catch(function (e) {
    console.log(e);
  });

// Get News
mozambiqueClient
  .news()
  .then(function (result) {
    console.log(result);
  })
  .catch(function (e) {
    console.log(e);
  });

// Get server status
mozambiqueClient
  .server()
  .then(function (result) {
    console.log(result);
  })
  .catch(function (e) {
    console.log(e);
  });

// Get the Match History
mozambiqueClient
  .history("get", {
    platform: "X1",
    player: "acidtib",
  })
  .then(function (result) {
    console.log(result);
  })
  .catch(function (e) {
    console.log(e);
  });

// Get the map rotation
mozambiqueClient
  .mapRotation()
  .then(function (result) {
    console.log(result);
  })
  .catch(function (e) {
    console.log(e);
  });

// Search a Origin user
mozambiqueClient
  .origin(
    {
      platform: "X1",
      player: "acidtib",
    },
    false
  )
  .then(function (result) {
    console.log(result);
  })
  .catch(function (e) {
    console.log(e);
  });

// Get apexlegendsstatus.com announcements
mozambiqueClient
  .announcements()
  .then(function (result) {
    console.log(result);
  })
  .catch(function (e) {
    console.log(e);
  });

// Get the UID using the player name
mozambiqueClient
  .nameToUID({
    platform: "X1",
    player: "acidtib",
  })
  .then(function (result) {
    console.log(result);
  })
  .catch(function (e) {
    console.log(e);
  });
2.6.2

3 years ago

2.6.1

3 years ago

2.6.0

3 years ago

2.5.0

3 years ago

2.3.0

3 years ago

2.4.1

3 years ago

2.4.0

3 years ago

2.2.0

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.0.0

3 years ago

1.3.0

3 years ago

1.3.0-beta.1

4 years ago

1.3.0-beta.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago