1.0.0 • Published 6 years ago

@mubicon/api-ar v1.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

@mubicon/api-ar

@mubicon/api-ar - JavaScript client for Mubicon Cloud
Api description made with Swagger, Swashbuckle and Manual API versioning.
This SDK is automatically generated by the Autorest:

  • API version: 1
  • Package version: 1

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install @mubicon/api-ar --save

Example

const Mubicon = require('@mubicon/api-ar');
const msRest = require('ms-rest');

const basePath = "http://cloud.mubicon.ru/api/v1";

let api = new Mubicon(new msRest.TokenCredentials("NONE"), basePath);

const login = "admin";
const password = "SOMEPASSWORD";

const opts = new api.models.CredentialsViewModel();
opts.login = login;
opts.password = password;

api.postSessionLogin({
    model: opts
}).then((data) => {
    const credentials = new msRest.TokenCredentials(data.authToken);
    api = new Mubicon(credentials, basePath);
    
    api.getTracks().then((trackData) => {
        console.log('Tracks API called successfully.');
        trackData.forEach((track, i) => {
            console.log(track); 
        }) 
    }).catch((err) => {
        console.error(err);
    });
}).catch((error) => {
    console.error(error);
});

Documentation for Authorization

Bearer

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

License

Copyright 2018 Mubicon Ltd. and all contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.