0.0.2 • Published 6 years ago

routetrader_sms v0.0.2

Weekly downloads
3
License
Unlicense
Repository
-
Last release
6 years ago

routetrader_sms

routetradersms - JavaScript client for routetrader_sms

  • API version: 0.0.1
  • Package version: 0.0.1
  • Build package: io.swagger.codegen.languages.JavascriptClientCodegen

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 routetrader_sms --save

git

If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/routetrader_sms then install it via:

    npm install YOUR_USERNAME/routetrader_sms --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var routetradersms = require('routetrader_sms');

var defaultClient = routetradersms.ApiClient.instance;

// Configure HTTP basic authorization: Default
var Default = defaultClient.authentications['Default'];
Default.username = 'YOUR USERNAME'
Default.password = 'YOUR PASSWORD'

var api = new routetradersms.AuthenticateApi()

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createToken(callback);

Documentation for API Endpoints

All URIs are relative to https://api.routetrader.co.uk:8443

ClassMethodHTTP requestDescription
routetradersms.AuthenticateApicreateTokenPOST /authenticateoAuth access token
routetradersms.PriceApigetPriceListGET /price
routetradersms.SendApisendSmsPOST /send

Documentation for Models

Documentation for Authorization

ApiKeyAuth

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

Default

  • Type: HTTP basic authentication

oAuth

  • Type: OAuth
  • Flow: password
  • Authorization URL:
  • Scopes:
    • send: send sms