ApiNaturaAuth - JavaScript client for api_natura_auth Api Natura Auth This SDK is automatically generated by the Swagger Codegen project:
- API version: 1.0
- Package version: 1.0
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen
For Node.js
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install api_natura_auth --save
If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/api_natura_auth then install it via:
npm install YOUR_USERNAME/api_natura_auth --save
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.
Please follow the installation instruction and execute the following JS code:
var ApiNaturaAuth = require('api_natura_auth');
var api = new ApiNaturaAuth.OAuthApi()
var contentType = "contentType_example"; // {String} Fixed 'application/json'
var authorization = 56; // {Number} Authorization code generated in the format 'Basic +code' with code in base64 codification.
var clientId = 789; // {Number} Client Id.
var tokenInformation = new ApiNaturaAuth.Information(); // {Information} Informations required for token generation.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.generateAccessToken(contentType, authorization, clientId, tokenInformation, callback);
All URIs are relative to https://hml.natura.sensedia.com/api-token/v1
Class | Method | HTTP request | Description |
---|---|---|---|
ApiNaturaAuth.OAuthApi | generateAccessToken | POST /oauth/access-token | Creates an Access-Token |
All endpoints do not require authorization.