Overview

Namespaces

  • Comprobo
    • Verify
      • Auth
      • Exceptions
      • HTTP

Classes

  • Api
  • Factory
  • State
  • User
  • Workflow
  • Overview
  • Namespace
  • Class

Class Api

Comprobo\Verify\Api is the public API for the Verify SDK. All public methods should be considered normal operation of the SDK.

It is possible to retrieve individual objects and make calls directly to different services although this should not be a requirement for normal usage.

USAGE:

$verify = Comprobo\Verify\Api::create(); $verify->authenticate($key, $secret);

...

Namespace: Comprobo\Verify
Located at Api.php
Methods summary
public static Comprobo\Verify\Api
# create( string $env = self::DEFAULT_ENV, array $config = [] )

Bootstrap the Verify API. Custom configuration options are currently not supported.

Bootstrap the Verify API. Custom configuration options are currently not supported.

Parameters

$env
'local', 'staging' or 'production'
$config
additional configuration options

Returns

Comprobo\Verify\Api
public
# __construct( Comprobo\Verify\Factory $factory )

Used by the factory itself. If you happen to need to instantiate the API this way then you can.

Used by the factory itself. If you happen to need to instantiate the API this way then you can.

Parameters

$factory
public string
# javascriptPath( )

Helper method to provide javascript asset location.

Helper method to provide javascript asset location.

Returns

string
path to JavaScript file for inclusion where Verify is to be used
public boolean
# authenticate( $key, $secret )

Use your application key and secret to set JWT token and organisation ID in the current API context

Use your application key and secret to set JWT token and organisation ID in the current API context

After this is called, you may continue to use the rest of the API methods provided here.

Parameters

$key
string
$secret
string

Returns

boolean
successful authentication
public string
# link( string $templateId, string $monitorableId, string $friendlyName, array $customFields = [] )

Clones the selected template to create an assignable Workflow instance. Any custom fields provided are persisted at this stage and may not be changed.

Clones the selected template to create an assignable Workflow instance. Any custom fields provided are persisted at this stage and may not be changed.

Parameters

$templateId
uuid4 template workflow ID as returned by the listTemplates call
$monitorableId
local ID for the monitorable resource. e.g. course ID or quiz ID.
$friendlyName
provide a friendly name that will appear for this in the reporting tools
$customFields

Any merge fields defined by the template can be set here. They cannot be changed once the monitoring task has been started for any user.

Returns

string
uuid4 the workflow ID
public array
# templates( )

List the available templates for monitoring, used for configuration

List the available templates for monitoring, used for configuration

Returns

array
available templates to clone
public array
# begin( string $userId, string $monitorableId )

Provides a user access token and internal IDs for booting the Verify JavaScript SDK.

Provides a user access token and internal IDs for booting the Verify JavaScript SDK.

Once this has been called against a linked template, that template cannot be modified but may be replaced by a new call to link

Parameters

$userId
your local user ID
$monitorableId
your local monitorable ID

Returns

array
relevant configuration to pass to the browser for beginning monitoring

See

self::link for where to set a monitorable ID
public array
# createUser( string $userId, string $firstName, string $lastName, string $email = null )

Create a user account to run the verify instance under.

Create a user account to run the verify instance under.

Normally this will be per-user of your system. *

Parameters

$userId
your local user ID
$firstName
The user's first name, used for reporting data
$lastName
The user's last name, used for reporting data
$email
The user's email address, used for reporting data

Returns

array
successful user creation
public array
# setReferencePhoto( string $userId, array $file )

Upload reference photo

Upload reference photo

Normally this will be per-user of your system, upload a file into comprobo to use as a reference image for facial comparison

Parameters

$userId
your local user ID
$file
array matching the structure of $_FILES['your-field'] array.

Returns

array
successful upload
Constants summary
string DEFAULT_ENV
# 'production'
API documentation generated by ApiGen