1.0.1 • Published 5 years ago

poi_apis v1.0.1

Weekly downloads
-
License
Unlicense
Repository
-
Last release
5 years ago

proof_of_insurance_apis

ProofOfInsuranceApis - JavaScript client for proof_of_insurance_apis

Overview Marsh API's - Certificate of Insurance are RESTful API's. The requests and responses are formated acording to the JSON API specification. These API's provide the capability to 1. Issue Certificates to existing holders 2. Re-Issue Certificates to existing holders 3. Get a report of Issued Certificates 4. Maintain Holder information # Authentication Authentication for the BlockChain COI API is based on the security token. Marsh currently supports grant types of client_credentials and refresh_token. See POST /oauth/token for details on the request and response formats.

This SDK is automatically generated by the Swagger Codegen project:

  • API version: v0.1
  • Package version: v0.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 proof_of_insurance_apis --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 proof_of_insurance_apis from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('proof_of_insurance_apis') 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/proof_of_insurance_apis then install it via:

    npm install YOUR_USERNAME/proof_of_insurance_apis --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 ProofOfInsuranceApis = require('proof_of_insurance_apis');

var defaultClient = ProofOfInsuranceApis.ApiClient.instance;

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

var api = new ProofOfInsuranceApis.CertificatesApi()

var certificateId = 8.14; // {Number} 

var opts = { 
  'clientId': 8.14, // {Number} Client Id
  'authorization': "authorization_example", // {String} Bearer $USER_TOKEN
  'contentType': "contentType_example" // {String} application/json
};

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

Documentation for API Endpoints

All URIs are relative to https://api.m2digitalbroker.com/proxy/certificates/v1

ClassMethodHTTP requestDescription
ProofOfInsuranceApis.CertificatesApiclientsCertificatesCertificateIdRecipientsGetGET /clients/certificates/{certificate-id}/recipientsreturns back the recipient list - at certificate + template + client level
ProofOfInsuranceApis.CertificatesApiclientsCertificatesCertificateIdRecipientsPostPOST /clients/certificates/{certificate-id}/recipientsreturns back the recipient list - at certificate + template + client level
ProofOfInsuranceApis.CertificatesApiclientsCertificatesGetGET /clients/certificatesGet Certificates
ProofOfInsuranceApis.ClientsApiclientsGetGET /clientsGet role & privileges for the clients that are authorized for the the given user
ProofOfInsuranceApis.ClientsApiclientsPoitypesGetGET /clients/poitypesGet User Details
ProofOfInsuranceApis.HoldersApiclientsHoldersGetGET /clients/holdersGet Holders
ProofOfInsuranceApis.HoldersApiclientsHoldersPostPOST /clients/holdersAdd a new Holder
ProofOfInsuranceApis.HoldersApiclientsHoldersPutPUT /clients/holdersUpdate Holders
ProofOfInsuranceApis.InsuredApiclientsInsuredGetGET /clients/insuredGet Holders
ProofOfInsuranceApis.TemplatesApiclientsTemplatesGetGET /clients/templatesGet User Details

Documentation for Models

Documentation for Authorization

JWT

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