2.0.1 • Published 3 years ago

originstamp-client-javascript v2.0.1

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

OriginStamp JavaScript Client

Build Status

npm.io

A JavaScript implementation of the OriginStamp API. For endpoint documentation see OriginStamp Documentation.

For more information, please visit https://originstamp.com.

Installation

npm

Install it via:

npm install originstamp-client-javascript --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 OriginStamp = require('originstamp-client-javascript');

var api = new OriginStamp.APIKeyApi()

var authorization = "authorization_example"; // {String} A valid API key is essential for authorization to handle the request.


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

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
OriginStamp.APIKeyApigetApiKeyUsageGET /v3/api_key/usageUsage
OriginStamp.BulkApicreateBulkTimestampPOST /v4/timestamp/bulk/createBulk Submission
OriginStamp.BulkApigetSeedStatusGET /v4/timestamp/status/seed/{seed_id}Seed Status
OriginStamp.ProofApigetProofPOST /v3/timestamp/proof/urlProof
OriginStamp.SchedulerApigetActiveCurrenciesGET /v3/currencies/getGet active currencies
OriginStamp.TimestampApicreateTimestampPOST /v4/timestamp/createSubmission
OriginStamp.TimestampApigetHashStatusGET /v4/timestamp/{hash_string}Status
OriginStamp.TimestampApigetSeedStatusGET /v4/timestamp/status/seed/{seed_id}Seed Status
OriginStamp.WebhookApigetWebhookStatusPOST /v3/webhook/informationWebhook
OriginStamp.WebhookApiregisterWebhookNotificationPOST /v3/webhook/registerWebhook
OriginStamp.WebhookApitriggerTimestampWebhookPOST /v3/webhook/startDev

Documentation for Models

Documentation for Authorization

API Key Authorization

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

Author

mail@originstamp.com