poi_apis

_OverviewMarsh_APIs____Certificate_of_Insurance_are_RESTful_APIs__The_requests_and_responses_are_formated_acording_tothe__JSON_API_httpjsonapi_orgformat1_0_specification_These_APIs_provide_the_capability_to1__Issue_Certificates_to_existing_holders2__Re_Is

Usage no npm install needed!

<script type="module">
  import poiApis from 'https://cdn.skypack.dev/poi_apis';
</script>

README

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

Class Method HTTP request Description
ProofOfInsuranceApis.CertificatesApi clientsCertificatesCertificateIdRecipientsGet GET /clients/certificates/{certificate-id}/recipients returns back the recipient list - at certificate + template + client level
ProofOfInsuranceApis.CertificatesApi clientsCertificatesCertificateIdRecipientsPost POST /clients/certificates/{certificate-id}/recipients returns back the recipient list - at certificate + template + client level
ProofOfInsuranceApis.CertificatesApi clientsCertificatesGet GET /clients/certificates Get Certificates
ProofOfInsuranceApis.ClientsApi clientsGet GET /clients Get role & privileges for the clients that are authorized for the the given user
ProofOfInsuranceApis.ClientsApi clientsPoitypesGet GET /clients/poitypes Get User Details
ProofOfInsuranceApis.HoldersApi clientsHoldersGet GET /clients/holders Get Holders
ProofOfInsuranceApis.HoldersApi clientsHoldersPost POST /clients/holders Add a new Holder
ProofOfInsuranceApis.HoldersApi clientsHoldersPut PUT /clients/holders Update Holders
ProofOfInsuranceApis.InsuredApi clientsInsuredGet GET /clients/insured Get Holders
ProofOfInsuranceApis.TemplatesApi clientsTemplatesGet GET /clients/templates Get User Details

Documentation for Models

Documentation for Authorization

JWT

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