betaface_api_20 v2.0.1
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
Class | Method | HTTP request | Description |
---|---|---|---|
BetafaceApi20.AdminApi | v2AdminUsageGet | GET /v2/admin/usage | get API usage information. (Administrative endpoint - API secret required) |
BetafaceApi20.FaceApi | v2FaceCroppedGet | GET /v2/face/cropped | gets a single cropped face information including cropped face image. |
BetafaceApi20.FaceApi | v2FaceGet | GET /v2/face | gets a single face information. |
BetafaceApi20.MediaApi | v2MediaFilePost | POST /v2/media/file | upload media file using multipart/form-data |
BetafaceApi20.MediaApi | v2MediaGet | GET /v2/media | gets a media information. |
BetafaceApi20.MediaApi | v2MediaHashGet | GET /v2/media/hash | gets a media information using SHA256 hash of media file. |
BetafaceApi20.MediaApi | v2MediaPost | POST /v2/media | upload media file using file uri or file content as base64 encoded string |
BetafaceApi20.PersonApi | v2PersonGet | GET /v2/person | lists all persons and their faces identifiers sorted by namespace and person name alphabetically. (Administrative endpoint - API secret required) |
BetafaceApi20.PersonApi | v2PersonPost | POST /v2/person | sets or overwrites person id for each specified face. |
BetafaceApi20.RecognizeApi | v2RecognizeGet | GET /v2/recognize | gets a faces recognition result. |
BetafaceApi20.RecognizeApi | v2RecognizePost | POST /v2/recognize | initiate recognition for one or more faces |
BetafaceApi20.TransformApi | v2TransformGet | GET /v2/transform | gets a faces transform result. |
BetafaceApi20.TransformApi | v2TransformPost | POST /v2/transform | initiate transform for one or more faces |
Documentation for Models
- BetafaceApi20.CroppedFace
- BetafaceApi20.Error
- BetafaceApi20.Face
- BetafaceApi20.Match
- BetafaceApi20.Media
- BetafaceApi20.MediaUpload
- BetafaceApi20.MediaUploadFile
- BetafaceApi20.MediaUploadResponse
- BetafaceApi20.NewFace
- BetafaceApi20.Person
- BetafaceApi20.Point
- BetafaceApi20.Recognize
- BetafaceApi20.RecognizeRequest
- BetafaceApi20.RecognizeResult
- BetafaceApi20.SetPerson
- BetafaceApi20.Tag
- BetafaceApi20.TagMedia
- BetafaceApi20.Transform
- BetafaceApi20.TransformRequest
- BetafaceApi20.Usage
- BetafaceApi20.UsageDaily
Documentation for Authorization
All endpoints do not require authorization.