2.0.1 • Published 4 years ago

betaface_api_20 v2.0.1

Weekly downloads
7
License
ISC
Repository
github
Last release
4 years ago

betaface_api_20

BetafaceApi20 - JavaScript client for betaface_api_20 Betaface face recognition API. This SDK is automatically generated by the Swagger Codegen project:

  • API version: 2.0
  • Package version: 2.0
  • 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 betaface_api_20 --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 betaface_api_20 from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

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

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

var api = new BetafaceApi20.AdminApi()

var apiKey = "apiKey_example"; // {String} your API key or d45fd466-51e2-4701-8da8-04351c872236

var apiSecret = "apiSecret_example"; // {String} your API secret. It is not recommended to expose your application secret at client side.


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

Documentation for API Endpoints

All URIs are relative to https://www.betafaceapi.com/api

ClassMethodHTTP requestDescription
BetafaceApi20.AdminApiv2AdminUsageGetGET /v2/admin/usageget API usage information. (Administrative endpoint - API secret required)
BetafaceApi20.FaceApiv2FaceCroppedGetGET /v2/face/croppedgets a single cropped face information including cropped face image.
BetafaceApi20.FaceApiv2FaceGetGET /v2/facegets a single face information.
BetafaceApi20.MediaApiv2MediaFilePostPOST /v2/media/fileupload media file using multipart/form-data
BetafaceApi20.MediaApiv2MediaGetGET /v2/mediagets a media information.
BetafaceApi20.MediaApiv2MediaHashGetGET /v2/media/hashgets a media information using SHA256 hash of media file.
BetafaceApi20.MediaApiv2MediaPostPOST /v2/mediaupload media file using file uri or file content as base64 encoded string
BetafaceApi20.PersonApiv2PersonGetGET /v2/personlists all persons and their faces identifiers sorted by namespace and person name alphabetically. (Administrative endpoint - API secret required)
BetafaceApi20.PersonApiv2PersonPostPOST /v2/personsets or overwrites person id for each specified face.
BetafaceApi20.RecognizeApiv2RecognizeGetGET /v2/recognizegets a faces recognition result.
BetafaceApi20.RecognizeApiv2RecognizePostPOST /v2/recognizeinitiate recognition for one or more faces
BetafaceApi20.TransformApiv2TransformGetGET /v2/transformgets a faces transform result.
BetafaceApi20.TransformApiv2TransformPostPOST /v2/transforminitiate transform for one or more faces

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

2.0.1

4 years ago

2.0.0

4 years ago