1.0.9 • Published 3 years ago

stitchcredit-direct-api v1.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

stitchcredit-direct-api

StitchCreditApi - JavaScript client for stitchcredit-direct-api This SDK is automatically generated by the OpenAPI Generator project:

Installation

For Node.js

npm

npm install stitchcredit-direct-api --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

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

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

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 StitchCreditApi = require('stitchcredit-direct-api');


 const loginPayload = {
        apikey: {{API_KEY}},
        secret: {{SECRET},
        env: {{ENV}}
      };


// This will initialize SDK and configure Bearer (JWT) access token for authorization: accessToken
const directApi = new StitchCreditApi.DirectControllerApi();
const response = await directApi.login(loginPayload);

/* 
Call StitchCredit Direct API's methods
  1. Example - get user info
  2. Example - register user
*/

// get user info
const userId = {{USER_ID}};
const response = await directApi.getUser(userId);

//register user
const { DirectUserRegReqDTO } = require('stitchcredit-direct-api');

const registerUserReq = new DirectUserRegReqDTO({{EMAIL}}, {{F_NAME}}, {{L_NAME}}); 
const response = await directApi.register(registerUserReq);

//following syntax can be used too
  directApi.register(registerUserReq).then(function() {
    console.log('Do something with response: ', response);
  }, function(error) {
    console.error(error);
  });

Documentation for API Endpoints

All URIs are relative to {{BASE_URL}}/api

ClassMethodHTTP requestDescription
StitchCreditApi.DirectControllerApichangeEmailPOST /direct/change-email/{id}
StitchCreditApi.DirectControllerApichangeHostPOST /direct/change-host/{id}
StitchCreditApi.DirectControllerApichangeMobilePOST /direct/change-mobile/{id}
StitchCreditApi.DirectControllerApicloseAccountPOST /direct/close-account/{id}
StitchCreditApi.DirectControllerApiefxAlertGET /direct/efx-alert/{id}
StitchCreditApi.DirectControllerApiefxConfigGET /direct/efx-config/{id}
StitchCreditApi.DirectControllerApiefxLatestEFXScoreGET /direct/efx-latest-efx-score/{id}
StitchCreditApi.DirectControllerApiefxLatestReportGET /direct/efx-latest-report/{id}
StitchCreditApi.DirectControllerApiefxLatestReportSummaryGET /direct/efx-latest-report/{id}/summary
StitchCreditApi.DirectControllerApiefxLatestScoresGET /direct/efx-latest-scores/{id}
StitchCreditApi.DirectControllerApiefxScoreHistoryGET /direct/efx-score-history/{id}
StitchCreditApi.DirectControllerApiefxScoresGET /direct/efx-scores/{id}
StitchCreditApi.DirectControllerApigetEfxAlertsGET /direct/efx-alerts/{id}
StitchCreditApi.DirectControllerApigetUserGET /direct/user/{id}
StitchCreditApi.DirectControllerApiloginPOST /direct/login
StitchCreditApi.DirectControllerApipreauthTokenGET /direct/preauth-token/{id}
StitchCreditApi.DirectControllerApirefreshTokenGET /direct/refresh-token
StitchCreditApi.DirectControllerApiregisterPOST /direct/user-reg
StitchCreditApi.DirectControllerApiregisterOldPOST /direct/register
StitchCreditApi.DirectControllerApiupdateRefreshPOST /direct/update-refresh/{id}
StitchCreditApi.DirectControllerApiuserTokenOldGET /direct/user-token/{id}

Documentation for Models

Documentation for Authorization

accessToken

  • Type: Bearer authentication (JWT)
1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago