Upload Web API
The Upload Web API is used for the asynchronous upload of different media samples that are associated with a token and can later be used for various biometric operations
When the API receives a sample, it automatically performs a quality-check. When the quality check succeeds, e.g. when exactly one face has been found in an image, the sample is placed in the BWS storage and associated with the token that has been used for the authorization of this API call.
Important Note: The upload might take a long time if the user has a slow internet connection! Therefore we highly recommend to consider the following when uploading images:
- Use a lossless compression algorithm for the image if possible.
- Use an aspect ratio of 3 : 4, i.e. we recommend to crop the captured images to be higher than wide as BWS internally works on 3 : 4 images. (Example: With a 640 x 480 camera, if you remove areas to the left and the right so that you get a 360 x 480 image, you reduce the upload size by nearly 50%.) Note that if you crop the image, ensure that the head of the person is within the cropped area.
|tag||An optional tag that describes some kind of demand or characteristics of the sample. For example: if a liveness detection with challenge-response shall be performed on a face or periocular sample, the expected head movement direction can be specified with this tag using one or more of the values |
|index||An optional index within a sequence of uploaded samples. If given it is only used to sort the uploaded samples in the order they are intended to be (important for challenge-response).|
|trait||Optionally overwrite of default trait-handling: images are associated with the |
Send this parameter in the request body.
Request Body Format
This API call requires BWS Token Authentication, i.e. you have to provide an HTTP authorization header using the authorization method Bearer (for compatibility issues you can also use the JWT identifier) and a previously issued BWS token, which can be requested using the Token Web API.
The Upload Web API returns an
UploadResult object generated by a call to the BWS quality check method. The returned object contains the flag Accepted that indicates whether the sample has passed the quality-check or not. If the sample has not been accepted an appropriate Error is reported depending on the trait of the uploaded sample, e.g.
MultipleFacesFound for face samples or
AudioSignalTooShort for voice samples. In any case some additional Warnings may be included in an array of Sample Error-codes as described in the quality check reference.
Response Body Format
Response HTTP Status Codes
Return values of API calls are standard HTTP status codes. With the success code (200) you receive the issued BWS token in the body text. With error codes a Message field within the body text describing the error is returned. The most commonly return codes are:
|200 OK||The response body contains the |
|400 Bad Request||Invalid sample data has been uploaded or the sample format is unsupported.|
|401 Unauthorized||No or an invalid authentication header has been specified. This call requires JWT Bearer Token Authentication. If a BWS token has been passed, this error typically indicates that the token has expired.|
|500 Internal Server Error||A server side exception occurred.|