Skip to content

BuiltByBit/api-wrapper-codegen-js

Repository files navigation

built_by_bit_api

BuiltByBitApi - JavaScript client for built_by_bit_api All operations not tagged 'free' require an active Ultimate subscription or invite-only permissions.

V2 documentation: https://builtbybit.com/wiki/api-v2/ \ OAuth2 documentation: https://builtbybit.com/wiki/oauth2/ This SDK is automatically generated by the OpenAPI Generator project:

  • API version: v2
  • Package version: v2
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen For more information, please visit https://builtbybit.com/ticket

Installation

npm

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

Then install it via:

npm install built_by_bit_api --save

Finally, you need to build the module:

npm run build
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

To use the link you just defined in your project, switch to the directory you want to use your built_by_bit_api from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/BuiltByBit/api-wrapper-codegen-js then install it via:

    npm install BuiltByBit/api-wrapper-codegen-js --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 BuiltByBitApi = require('built_by_bit_api');

var defaultClient = BuiltByBitApi.ApiClient.instance;
// Configure API key authorization: token
var token = defaultClient.authentications['token'];
token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//token.apiKeyPrefix['Authorization'] = "Token"

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

Documentation for API Endpoints

All URIs are relative to https://api.builtbybit.com

Class Method HTTP request Description
BuiltByBitApi.GlobalApi getV2Analytics GET /v2/analytics Fetch a list of analytics definitions
BuiltByBitApi.GlobalApi getV2AnalyticsGraph GET /v2/analytics/graph Fetch analytics graph data
BuiltByBitApi.GlobalApi getV2AnalyticsSingle GET /v2/analytics/single Fetch a single analytics value
BuiltByBitApi.GlobalApi getV2Events GET /v2/events Fetch a list of pending events
BuiltByBitApi.GlobalApi postV2EventsComplete POST /v2/events/complete Mark events as complete
BuiltByBitApi.Oauth2Api getOauth2Token POST /oauth2/token Request an access token using an existing grant
BuiltByBitApi.Oauth2Api getOauth2TokenRevoke POST /oauth2/token/revoke Revoke an existing access or refresh token
BuiltByBitApi.ResourcesCreatorApi postV2ResourcesCreatorUpdate POST /v2/resources/creator/update Post a resource update
BuiltByBitApi.ResourcesDiscoveryApi getResourcesDiscoverCategories GET /v2/resources/discover/categories Fetch a list of categories
BuiltByBitApi.ResourcesDiscoveryApi getResourcesDiscoverResources GET /v2/resources/discover/resources Fetch a list of resources
BuiltByBitApi.ResourcesDiscoveryApi getV2ResourcesDiscoverCartView GET /v2/resources/discover/cart/view View the user's cart items
BuiltByBitApi.ResourcesDiscoveryApi getV2ResourcesDiscoverLicenses GET /v2/resources/discover/licenses Fetch a list of the user's licenses
BuiltByBitApi.ResourcesDiscoveryApi postV2ResourcesDiscoverCartAdd POST /v2/resources/discover/cart/add Add items to a user's cart
BuiltByBitApi.ResourcesDiscoveryApi postV2ResourcesDiscoverCartCheckout POST /v2/resources/discover/cart/checkout Initiate a checkout of a user's cart
BuiltByBitApi.ResourcesDiscoveryApi postV2ResourcesDiscoverCartCouponAdd POST /v2/resources/discover/cart/coupon/add Add a coupon to the user's cart
BuiltByBitApi.ResourcesDiscoveryApi postV2ResourcesDiscoverCartCouponRemove POST /v2/resources/discover/cart/coupon/remove Remove a coupon from the user's cart
BuiltByBitApi.ResourcesDiscoveryApi postV2ResourcesDiscoverCartRemove POST /v2/resources/discover/cart/remove Remove an item from the user's cart

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

token

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

oauth2

About

A NodeJS API wrapper code-generated from our OpenAPI specification.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors