barong_sdk v1.8.29
barong_sdk
BarongSdk - JavaScript client for barong_sdk API for barong OAuth server This SDK is automatically generated by the Swagger Codegen project:
- API version: 1.8.29
- Package version: 1.8.29
- 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 barong_sdk --save
Local development
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing
into the directory containing package.json
(and this README). Let's call this JAVASCRIPT_CLIENT_DIR
. Then run:
npm install
Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR
:
npm link
Finally, switch to the directory you want to use your barong_sdk from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
You should now be able to require('barong_sdk')
in javascript files from the directory you ran the last
command above from.
git
If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/barong_sdk then install it via:
npm install YOUR_USERNAME/barong_sdk --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, that's to say your javascript file where you actually
use this library):
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 BarongSdk = require('barong_sdk');
var defaultClient = BarongSdk.ApiClient.instance;
// Configure API key authorization: BearerToken
var BearerToken = defaultClient.authentications['BearerToken'];
BearerToken.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//BearerToken.apiKeyPrefix['Authorization'] = "Token"
var api = new BarongSdk.AccountsApi()
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.getV1AccountsMe(callback);
Documentation for API Endpoints
All URIs are relative to https://account.oboltrade.com/api
Class | Method | HTTP request | Description |
---|---|---|---|
BarongSdk.AccountsApi | getV1AccountsMe | GET /v1/accounts/me | Return information about current resource owner |
BarongSdk.AccountsApi | postV1Accounts | POST /v1/accounts | Creates new account(no auth) |
BarongSdk.AccountsApi | postV1AccountsConfirm | POST /v1/accounts/confirm | Confirms an account(no auth) |
BarongSdk.AccountsApi | postV1AccountsSendConfirmationInstructions | POST /v1/accounts/send_confirmation_instructions | Send confirmations instructions |
BarongSdk.AccountsApi | postV1AccountsSendUnlockInstructions | POST /v1/accounts/send_unlock_instructions | Send unlock instructions |
BarongSdk.AccountsApi | postV1AccountsUnlock | POST /v1/accounts/unlock | Unlocks an account(no auth) |
BarongSdk.AccountsApi | putV1AccountsPassword | PUT /v1/accounts/password | Change account password |
BarongSdk.ApiKeysApi | deleteV1ApiKeysUid | DELETE /v1/api_keys/{uid} | Delete an api key |
BarongSdk.ApiKeysApi | getV1ApiKeys | GET /v1/api_keys | List all api keys for current account. |
BarongSdk.ApiKeysApi | getV1ApiKeysUid | GET /v1/api_keys/{uid} | Return an api key by uid |
BarongSdk.ApiKeysApi | patchV1ApiKeysUid | PATCH /v1/api_keys/{uid} | Updates an api key |
BarongSdk.ApiKeysApi | postV1ApiKeys | POST /v1/api_keys | Create an api key |
BarongSdk.DocumentsApi | getV1Documents | GET /v1/documents | Return current user documents list |
BarongSdk.DocumentsApi | postV1Documents | POST /v1/documents | Upload a new document for current user |
BarongSdk.LabelsApi | deleteV1LabelsKey | DELETE /v1/labels/{key} | Delete a label with 'public' scope. |
BarongSdk.LabelsApi | getV1Labels | GET /v1/labels | List all labels for current account. |
BarongSdk.LabelsApi | getV1LabelsKey | GET /v1/labels/{key} | Return a label by key. |
BarongSdk.LabelsApi | patchV1LabelsKey | PATCH /v1/labels/{key} | Update a label with 'public' scope. |
BarongSdk.LabelsApi | postV1Labels | POST /v1/labels | Create a label with 'public' scope. |
BarongSdk.PhonesApi | postV1Phones | POST /v1/phones | Add new phone |
BarongSdk.PhonesApi | postV1PhonesSendCode | POST /v1/phones/send_code | Resend activation code |
BarongSdk.PhonesApi | postV1PhonesVerify | POST /v1/phones/verify | Verify a phone |
BarongSdk.ProfilesApi | getV1ProfilesMe | GET /v1/profiles/me | Return profile of current resource owner |
BarongSdk.ProfilesApi | postV1Profiles | POST /v1/profiles | Create a profile for current_account |
BarongSdk.SecurityApi | postV1SecurityEnable2fa | POST /v1/security/enable_2fa | Enable 2FA |
BarongSdk.SecurityApi | postV1SecurityGenerateQrcode | POST /v1/security/generate_qrcode | Generate qr code for 2FA |
BarongSdk.SecurityApi | postV1SecurityRenew | POST /v1/security/renew | Renews JWT if current JWT is valid |
BarongSdk.SecurityApi | postV1SecurityResetPassword | POST /v1/security/reset_password | Send reset password instructions(no auth) |
BarongSdk.SecurityApi | postV1SecurityVerifyApiKey | POST /v1/security/verify_api_key | Verify API key |
BarongSdk.SecurityApi | postV1SecurityVerifyCode | POST /v1/security/verify_code | Verify 2FA code |
BarongSdk.SecurityApi | putV1SecurityResetPassword | PUT /v1/security/reset_password | Sets new account password(no auth) |
BarongSdk.SessionsApi | postV1Sessions | POST /v1/sessions | Start a new session |
BarongSdk.SessionsApi | postV1SessionsGenerateJwt | POST /v1/sessions/generate_jwt | Validates client jwt and generates peatio session jwt |
Documentation for Models
Documentation for Authorization
BearerToken
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
5 years ago