Download the PHP package infinitum/php-sdk without Composer
On this page you can find all versions of the php package infinitum/php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-sdk
Infinitum SDK for PHP
Installation
The Infinitum SDK can be installed via Composer.
Usage
API Initialization
To use the Inifnitum you need to provide the API Token
, the registered and licensed device identity
and the corresponding workspace
.
Setting the Access Token
To use the modules, you first must call the init()
method or set the access token via setAccessToken()
if you already have an access token persisted/stored.
Example:
Modules
To user modules, you must first fetch the module accessing the \Fyi\Infinitum\Infinitum
object
and then the methods are accessible (methods listed further on).
All API methods snippets show an example data
object and the expected response
structure.
There are 2 exceptions to be caught: \Fyi\Infinitum\Exceptions\InfinitumSDKException
and \Fyi\Infinitum\Exceptions\InfinitumAPIException
both explained [here]().
User
The User API object can be retrieved by calling it from the \Fyi\Infinitum\Infinitum
object
Register new User
The required parameters for registering a new user rely on the chosen Infinitum API configuration, like so, all SDK parameters are considered optional
.
Response:
There are also optional arrays (json string encoded) related to additional user information. Refer the [Infinitum API docs]() for more information.
Get User by Face
Fetch a user by providing a picture of the User's face.
Response:
Get User by Email address
Fetch a user by providing its email address.
Response:
Get all Users
Fetch a user by providing its email address.
Response:
Delete User
Delete a user by providing its unique ID.
Response:
Notify a User
Send a notification to a User.
The notification action is required due to being its primary identifier. Refer to the API docs for more information.
Device
The Device API object can be retrieved by calling it from the \Fyi\Infinitum\Infinitum
object
Register new Device
Register a new device in the Infinitum API.
There are also optional arrays (json string encoded) related to additional user information. Refer the Infinitum API docs for more information.
Register new Device User
Register a new association between a Device and a User.
The data provided can either contain the device_mac_address
or device_id
along with the user_email
or user_id
, in order to search for a device/user with those properties or directly reference their unique IDs.
Response:
License a Device
Update a device to either be licensed or revoke license to control access to the Infinitum API.
Response:
Validate a Device
Validate whether or not a device is able/licensed to access the Infinitum API, and retrieve its information.
Response:
Delete Device
Delete a device by providing its unique ID.
Response:
Auth
The Auth API object can be retrieved by calling it from the \Fyi\Infinitum\Infinitum
object
All Auth API requests have the same response:
Biometric Auth
Authenticate a user against the Infinitum API using its face properties. Along with the user photo, additional parameters can be provided to specify the device and method used in the request.
Login
Authenticate a user against the Infinitum API using regular login parameters: email
and password
.
Code
Authenticate a user against the Infinitum API using a unique code from to the user's possible codes.
CMS
The CMS API object can be retrieved by calling it from the \Fyi\Infinitum\Infinitum
object
Exceptions
Both exceptions extend the base PHP Exception
class so all related methods are available.
InfinitumAPIException
This exception is thrown when an API error occurrs either due to malformed requests, server errors or any other error related to the Infinitum API.
In addtition to the methods provided by the Exception
class, a getBody()
method is also available, to fetch the response body sent by the Infinitum API containing the error information (message, type and status code).`
Error body structure:
Usage example:
InfinitumSDKException
The SDK exception is thrown in case of any error during the execution of any SDK method, unrelated to the API calls. This exception is mostly used when parameters are missing before executing a request that requires any of those parameters. Example:
and can be caught as any exception:
The return value would be Missing Email parameter.
.
MissingTokenException
This exception has InfinitumSDKException
as a parent, but it is only used when the access token is missing, meaning that an init()
or setAccessToken()
call was never done.
It can be caught either by expecting the MissingTokenException
class itself or its parent InfinitumSDKException
.