# SPID Services

The SPID Services API is desgined for system integrators to access the SPID functionalities from whithin their own applications.

The SPID Services API is provided along with any SPID installation and can be also configured in the SPID Configuration File located at the following paths:

Windows Installation:

```default
C:\Griaule\SPID\conf\GBSSpid2.properties
```

Linux Installation:

{% hint style="info" %}
Further information about the SPID Configuration file can be found in the SPID Configuration Manual.
{% endhint %}

The default port for the SPID Services API is `19980` and can be changed by the `port.number` parameter in the configuration file. The default endpoint structure is `localhost:8080/gbs-spid-services/api/`.

{% hint style="warning" %}
The endpoint structure must be followed in any API call, appending the specific information for the desired call at the end of the default structure.
{% endhint %}

{% hint style="info" %}
The SPID-Linux is only available for debian-based linux distributions. Contact the Griaule Support Team for further information.
{% endhint %}

## API Calls

### Login

This method is used for operator login in the system. It will perform a consult to obtain the operator status from the server.

If the operator is enrolled and has no exceptions linked to his profile, his biometrics will be retrieved for local verification.

When the server cannot be reached, the method will check whether the desired operator is eligible for offline login (the biometrics are already stored at the local database).

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/login/{id}</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td><strong>id</strong>: ID of the operator to be logged in</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the operator login attempt:</p><ul><li><code>OPERATOR_FAILED</code>: there was a problem with the operator enrollment at the server;</li><li><code>OPERATOR_NOT_FOUND</code>: no operator with the provided ID was found;</li><li><code>OPERATOR_IN_PROGRESS</code>: the operator is waiting for the server to process its enrollment after providing its biometrics;</li><li><code>OPERATOR_PENDING</code>: the operator was added by the administrator, but did not provided its biometrics yet;</li><li><code>OPERATOR_OK</code>: the operator was found and had its biometrics downloaded;</li><li><code>OPERATOR_OFFLINE_OK</code>: there has been a problem in the server connection, but the operator was successfully logged in based on the local database information</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.<br><br><strong>id</strong>: ID of the operator.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"status": "OPERATOR_OK",
	"message": "Operator enroll ok",
	"id": "id1"
}
```

### Login Status

This method is used for checking whether there is an active operator logged in the current session.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/login/status</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td>none</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the operator login:</p><ul><li><code>LOGIN_NOT_ACTIVE</code>: there is no active operator logged in the current session;</li><li><code>LOGIN_OK</code>: there is an active operator logged in the current session;</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.<br><br><strong>id</strong>: ID of the current operator, if logged in.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"status": "LOGIN_OK",
	"message": "Current session login status is LOGIN_OK",
	"id": "id1"
}
```

### Logout

This method is used for disconnecting any active operator from the current session.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/logout</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td>none</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the operator logout attempt:</p><ul><li><code>LOGIN_NOT_ACTIVE</code>: there is no active operator logged in the current session;</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"status": "LOGIN_NOT_ACTIVE",
	"message": "Log out successful. There is no active operator"
}
```

### Verify Operator

This method is used for biometrically verifying the active operator of the current session by collecting one of its biometrics and comparing against the biometrics obained at login.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/verify/operator</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td>none</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the operator verification:</p><ul><li><code>LOGIN_NOT_ACTIVE</code>: there is no active operator logged in the current session;</li><li><code>OPERATOR_VERIFIED</code>: the biometric verification for the current operator is disabled, so it is successfully verified;</li><li><code>OPERATOR_VERIFYING</code>: the verification capture scene was initialized;</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.<br><br><strong>id</strong>: ID of the operator being verified.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"status": "OPERATOR_VERIFYING",
	"message": "The operator verify scene has been initialized",
	"id": "id1"
}
```

### Verify Operator Status

This method is used for checking the status of the operator verification.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/verify/status</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td>none</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the operator verification:</p><ul><li><code>LOGIN_NOT_ACTIVE</code>: there is no active operator logged in the current session;</li><li><code>OPERATOR_VERIFIED</code>: the biometric verification for the current operator is disabled, so it is successfully verified;</li><li><code>OPERATOR_NOT_VERIFIED</code>: the operator was not verified, or there is no verification initialized for this session;</li><li><code>OPERATOR_VERIFYING</code>: the verification capture scene was initialized;</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.<br><br><strong>id</strong>: ID of the operator being verified.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"status": "OPERATOR_VERIFYING",
	"message": "The operator verify scene has been initialized",
	"id": "id1"
}
```

### Operator Enroll

This method is used for operator enrollment. It invokes the capture scene for the desired operator and submit the captured biometrics to the server.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/capture/operator-enroll/{id}</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td><strong>id</strong>: ID of the operator to be enrolled</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the operator enrollment:</p><ul><li><code>LOGIN_OK</code>: there is an already active operator logged in the current session (an operator can not be enrolled if there is another operator logged in);</li><li><code>OPERATOR_NOT_PENDING</code>: the operator status in the server is not eligible for enrollment;</li><li><code>OPERATOR_CAPTURING</code>: the operator capture scene was initialized;</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.<br><br><strong>id</strong>: ID of the operator being enrolled.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"status": "OPERATOR_CAPTURING",
	"message": "Operator capture was initialized",
	"id": "id1"
}
```

### Enroll

This method is used for capturing a client’s biometrics for enrollment.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/capture/enroll/{id}</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td><strong>id</strong>: ID of the client to be enrolled</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the client enrollment capture:</p><ul><li><code>LOGIN_NOT_ACTIVE</code>: there is no operator logged in the current session (there must be a valid operator active to perform a client capture).</li><li><code>CLIENT_CAPTURING</code>: the client capture scene was initialized;</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.<br><br><strong>id</strong>: ID of the client being enrolled.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"status": "CLIENT_CAPTURING",
	"message": "Client capture initialized",
	"id": "id1"
}
```

### Verify

This method is used to verify the biometrics of a client.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/capture/verify/{id}</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td><strong>id</strong>: ID of the client to be verified</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the client verification capture:</p><ul><li><code>LOGIN_NOT_ACTIVE</code>: there is no operator logged in the current session (there must be a valid operator active to perform a client capture).</li><li><code>PERSON_NOT_FOUND</code>: the provided ID does not exist;</li><li><code>CLIENT_CAPTURING</code>: the client capture scene was initialized;</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.<br><br><strong>id</strong>: ID of the client being verified.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"status": "CLIENT_CAPTURING",
	"message": "Client capture initialized",
	"id": "id1"
}
```

### Remote Enroll

This method is used to perform remote capture and enrollment of the biometrics of a client.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/capture/remoteEnroll/{id}</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td><strong>id</strong>: ID of the client to be verified</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the client verification capture:</p><ul><li><code>LOGIN_NOT_ACTIVE</code>: there is no operator logged in the current session (there must be a valid operator active to perform a client capture).</li><li><code>DONE</code>: the capture was correctly started remotely;</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: returns the <strong>tguid</strong> and <strong>dynamicLink</strong> of the remote enroll transaction.<br><br><strong>id</strong>: ID of the client being captured.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"status": "Done",
	"message": "Remote enroll initialized tguid:, dynamicLink",
	"id": "id1"
}
```

### Remote Enroll Result by TGUID

This method is used for querying the status of a given remote enroll.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/capture/remoteEnroll/result/{tguid}</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td><strong>tguid</strong>: TGUID of the desired transaction</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the given transaction at the server:</p><ul><li><code>LOGIN_NOT_ACTIVE</code>: there is no operator logged in;</li><li><code>DONE</code>: the remote enroll was started successfully. Outcome described in the status message;</li><li><code>ERROR</code>: an error has occurred, detailed description given in the status message;</li></ul><p><br><strong>message</strong>: for valid enroll transactions, the message contains the enroll status. Possible enroll status are:</p><ul><li>ENROLL_CACHE_OK</li><li>ENROLL_IN_PROGRESS</li><li>ENROLL_OK</li><li>ENROLL_FAILED</li><li>ERROR</li><li>ENROLL_EXCEPTION</li><li>REMOTE_CAPTURE_PENDING</li><li>REMOTE_CAPTURE_STORED</li><li>REMOTE_CAPTURE_ACCEPTED</li><li>REMOTE_CAPTURE_REFUSED</li><li>REMOTE_CAPTURE_AVAILABLE</li><li>ENROLL_REJECTED</li></ul></td></tr></tbody></table>

#### Response Examples

```json
{
	"status": "Done",
	"message": "Remote enroll with status ENROLL_IN_PROGRESS"
}
```

```json
{
	"status": "Error",
	"message": "Get enroll result returned null for tguid: TGUID"
}
```

```json
{
	"status": "Login not active",
	"message": "There is no valid operator logged in"
}
```

```json
{
	"status": "Enroll Rejected",
	"message": "It wasn't possible to finish operation, because the client enroll belongs to another PSBIO."
}
```

### Remote Verify

This method is used to perform remote capture and verification of the biometrics of a client.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/capture/remoteVerify/{id}</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td><strong>id</strong>: ID of the client to be verified</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the client verification capture:</p><ul><li><code>LOGIN_NOT_ACTIVE</code>: there is no operator logged in the current session (there must be a valid operator active to perform a client capture).</li><li><code>PERSON_NOT_FOUND</code>: the provided ID does not exist;</li><li><code>DONE</code>: the capture was correctly started remotely;</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the tguid and dynamic link of the remote verify, on success.<br><br><strong>id</strong>: ID of the client being verified.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"status": "Done",
	"message": "Remote verify initialized tguid:, dynamicLink",
	"id": "id1"
}
```

### Remote Verify Result by ID

This method is used for querying the status of a given remote verify.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/capture/remoteVerify/result/{tguid}</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td><strong>tguid</strong>: TGUID of the desired transaction</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the given transaction at the server:</p><ul><li><code>LOGIN_NOT_ACTIVE</code>: there is no operator logged in;</li><li><code>DONE</code>: the remote verify was started successfully. Outcome described in the status message;</li><li><code>ERROR</code>: an error has occurred, detailed description given in the status message;</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the verify status in the absence of errors. The verify status can be:</p><ul><li>SEARCH_MATCH</li><li>SEARCH_NOT_MATCH</li><li>SEARCH_IN_PROGRESS</li><li>SEARCH_FAILED</li><li>REMOTE_CAPTURE_PENDING</li><li>REMOTE_CAPTURE_STORED</li><li>REMOTE_CAPTURE_ACCEPTED</li><li>REMOTE_CAPTURE_REFUSED</li><li>REMOTE_CAPTURE_AVAILABLE</li></ul></td></tr></tbody></table>

#### Response Example

```json
{
	"status": "Done",
	"message": "Remote verify with status SEARCH_MATCH"
}
```

### Remote Approval by TGUID

This method is used to open the remote approval window. Used for remote enroll and remote verify

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/gbs-spid-services/api/capture/remoteApproval/{tguid}</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td><strong>tguid</strong>: TGUID returned by the remote capture</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the call, can be one of the following values:</p><ul><li><code>LOGIN_NOT_ACTIVE</code>: there is no operator logged in, must be a valid operator active to make the client capture.</li><li><code>DONE</code>: the remote approval was started correctly.</li><li><code>ERROR</code>: an error has occurred, detailed description given in the status message;</li></ul><p><br><strong>message</strong>: eturns message for remote approval</p></td></tr></tbody></table>

#### Response Examples

```json
{
	"status": "Done",
	"message": "Remote approval initialized"
}
```

```json
{
	"status": "Error",
	"message": "..."
}
```

```json
{
	"status": "Login not active",
	"message": "There is no valid operator logged in"
}
```

### Operator Capture

This method is utilized for capturing the biometrics of the operator and authenticating him. It will initialize a capture scene that can also receive comments from the operator and includes the agreement for use of his biometrics.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>capture/operator-capture</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td>none</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the operator authentication:</p><ul><li><code>LOGIN_NOT_ACTIVE</code>: there is no active operator logged in the current session;</li><li><code>CLIENT_CAPTURE_NOT_DONE</code>: the client capture hasn’t been finalized yet, so the operator can not authenticate itself;</li><li><code>OPERATOR_CAPTURE_DONE</code>: the biometric authentication for the current operator is disabled at the server, so it is successfully authenticated;</li><li><code>OPERATOR_CAPTURING</code>: the operator capture scene was initialized;</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.<br><br><strong>id</strong>: ID of the client being captured.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"status": "CLIENT_CAPTURE_NOT_DONE",
	"message": "The client capture hasn't been completed",
	"id": "id1"
}
```

### Stop Capture

This method is used to stop and close all capture scenes initialized.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/capture/stop</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td>none</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the capture scene stop attempt:</p><ul><li><code>OK</code>: all the capture scenes were successfully closed;</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"status": "OK",
	"message": "All active scenes were closed"
}
```

### Capture Status

This method is used for checking the status of the current capture session.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/capture/status</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td>none</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the current capture session:</p><ul><li><code>NONE</code>: there is no capture session initialized;</li><li><code>CLIENT_CAPTURING</code>: the client capture scene was initialized and is waiting for the operator to finish the client’s capture;</li><li><code>CLIENT_CAPTURE_DONE</code>: the client capture has been completed;</li><li><code>FINGERPRINT_LOW_QUALITY</code>: The client capture has been completed, but the fingerprint was not able to be captured because of the low quality.</li><li><code>OPERATOR_CAPTURE_DONE</code>: the operator has captured it’s biometrics and has been authenticated;</li><li><code>OPERATOR_CAPTURING</code>: the operator capture scene was initialized and is waiting for the operator to authenticate.</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"status": "CLIENT_CAPTURING",
	"message": "The client capture has been initialized"
}
```

### Capture Send

This parameter is used for enqueuing an operation to be sent to the server.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/capture/send</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td>none</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the enqueuing attempt:</p><ul><li><code>CAPTURE_ENQUEUED</code>: the capture was enqueued to be sent to the server;</li><li><code>CLIENT_CAPTURING</code>: the client capture scene is waiting to be finished;</li><li><code>OPERATOR_CAPTURING</code>: the operator capture scene is waiting to be finished;</li><li><code>VERIFIED</code>: In case of send verify, return this status if verify is sent correctly to SPID Server</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.<br><br><strong>id</strong>: local ID of the operation.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"status": "CAPTURE_ENQUEUED",
	"message": "The message has been enqueued to be sent",
	"id": "97"
}
```

### Capture Result by ID

This method is used for querying the result of a given capture.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/capture/result/{id}</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td><strong>id</strong>: local ID or TGUID of the desired transaction</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the given transaction at the server:</p><ul><li><code>NOT_SENT</code>: a problem has happened while trying to send the capture to the server;</li><li><code>ENROLL_OK</code>: the enrollment transaction was successfully finalized at the server;</li><li><code>ENROLL_CACHE_OK</code>: the enrollment transaction was successfully processed locally and is awaiting responses from remote servers;</li><li><code>ENROLL_CONTINGENCY_OK</code>: the enrollment transaction was successfully processed locally while one or more remote servers couldn’t be reached and is awaiting responses;</li><li><code>ENROLL_SENT</code>: the server received the enrollment transaction and is processing it; This is a temporary status.</li><li><code>ENROLL_FAILED</code>: the enrollment transaction failed at the server;</li><li><code>ENROLL_ANOMALY</code>: the enrollment transaction has caused an exception (a match occured with a previously enrolled set of biometrics);</li><li><code>ENROLL_TIMEOUT</code>: the server connection timed out while sending the enrollment transaction;</li><li><code>UPDATE_OK</code>: the update transaction was successfully finalized at the server;</li><li><code>UPDATE_CACHE_OK</code>: the update transaction was successfully processed locally and is awaiting responses from remote servers;</li><li><code>UPDATE_CONTINGENCY_OK</code>: the update transaction was successfully processed locally while one or more remote servers couldn’t be reached and is awaiting responses;</li><li><code>UPDATE_SENT</code>: the server received the update transaction and is processing it; This is a temporary status.</li><li><code>UPDATE_FAILED</code>: the update transaction failed at the server;</li><li><code>UPDATE_ANOMALY</code>: the update transaction has caused an exception (no match occured with the previously enrolled set of biometrics);</li><li><code>UPDATE_TIMEOUT</code>: the server connection timed out while sending the update transaction;</li><li><code>CORRUPTED</code>: the transaction data couldn’t be read from the local database;</li><li><code>SEARCH_ENQUEUED</code>: the “verify” transaction in the server is in progress. This is a temporary status;</li><li><code>SEARCH_MATCH</code>: the “verify” transaction returned a match with the previously enrolled biometrics;</li><li><code>SEARCH_NOT_MATCH</code>: the “verify” transaction returned a no match with the previously enrolled biometrics;</li><li><code>SEARCH_FAILED</code>: the “verify” transaction failed at the server;</li><li><code>OPERATOR_NOT_AUTHENTICATED</code>: the server couldn’t successfully authenticate the operator;</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br></p><blockquote><p>If the return is an error, the following fields will be added:</p></blockquote><p><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.<br><br></p><blockquote><p>If the return is not an error, the following fields will be added:</p></blockquote><p><strong>id</strong>: local ID or TGUID of the operation.<br><br><strong>doc</strong>: person ID of the client.<br><br><strong>docOperator</strong>: operator ID.<br><br><strong>timestamp</strong>: time the transaction was registered at the local database (epoch time in miliseconds).<br><br><strong>lastUpdate</strong>: timestamp of the transaction’s last update at the server.<br><br><strong>tguid</strong>: transaction ID at the server.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"id": 97,
	"doc": "id1",
	"docOperator": "id2",
	"timestamp": 1490114943468,
	"lastUpdate": 1490114943969,
	"status": "UPDATE_SENT",
	"tguid": "37BBE44B-924B-406F-824C-73FDC535416F"
}
```

### Capture Result by Date

This method is used for consulting the result of a set of transactions within a given time interval and ordered by ID.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/capture/result/list/{startDate}/{endDate}/{offset}</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td><strong>startDate</strong>: initial date to be consulted (epoch time in miliseconds)<br><strong>endDate</strong>: final date to be consulted (epoch time in miliseconds)<br><strong>offset</strong>: the list is limited to 100 results per request and this parameter defines the offset from the list head to be considered</td></tr><tr><td><strong>Response</strong></td><td><blockquote><p>For each transaction in the returned list, the following information will be provided:</p></blockquote><p><strong>status</strong>: status of the given transaction at the server:</p><ul><li><code>NOT_SENT</code>: a problem has happened while trying to send the capture to the server;</li><li><code>ENROLL_OK</code>: the enrollment transaction was successfully finalized at the server;</li><li><code>ENROLL_CACHE_OK</code>: the enrollment transaction was successfully processed locally and is awaiting responses from remote servers;</li><li><code>ENROLL_CONTINGENCY_OK</code>: the enrollment transaction was successfully processed locally while one or more remote servers couldn’t be reached and is awaiting responses;</li><li><code>ENROLL_SENT</code>: the server received the enrollment transaction and is processing it;</li><li><code>ENROLL_FAILED</code>: the enrollment transaction failed at the server;</li><li><code>ENROLL_ANOMALY</code>: the enrollment transaction has caused an exception (a match occured with a previously enrolled set of biometrics);</li><li><code>ENROLL_TIMEOUT</code>: the server connection timed out while sending the enrollment transaction;</li><li><code>UPDATE_OK</code>: the update transaction was successfully finalized at the server;</li><li><code>UPDATE_CACHE_OK</code>: the update transaction was successfully processed locally and is awaiting responses from remote servers;</li><li><code>UPDATE_CONTINGENCY_OK</code>: the update transaction was successfully processed locally while one or more remote servers couldn’t be reached and is awaiting responses;</li><li><code>UPDATE_SENT</code>: the server received the update transaction and is processing it;</li><li><code>UPDATE_FAILED</code>: the update transaction failed at the server;</li><li><code>UPDATE_ANOMALY</code>: the update transaction has caused an exception (no match occured with the previously enrolled set of biometrics);</li><li><code>UPDATE_TIMEOUT</code>: the server connection timed out while sending the update transaction;</li><li><code>CORRUPTED</code>: the transaction data couldn’t be read from the local database;</li><li><code>SEARCH_MATCH</code>: the “verify” transaction returned a match with the previously enrolled biometrics;</li><li><code>SEARCH_NOT_MATCH</code>: the “verify” transaction returned a no match with the previously enrolled biometrics;</li><li><code>SEARCH_FAILED</code>: the “verify” transaction failed at the server;</li><li><code>OPERATOR_NOT_AUTHENTICATED</code>: the server couldn’t successfully authenticate the operator;</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br></p><blockquote><p>If the return is an error, the following fields will be added:</p></blockquote><p><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.<br><br></p><blockquote><p>If the return is not an error, the following fields will be added:</p></blockquote><p><strong>id</strong>: local ID or TGUID of the operation.<br><br><strong>doc</strong>: person ID of the client.<br><br><strong>docOperator</strong>: operator ID.<br><br><strong>timestamp</strong>: time the transaction was registered at the local database (epoch time in miliseconds).<br><br><strong>lastUpdate</strong>: timestamp of the transaction’s last update at the server.<br><br><strong>tguid</strong>: transaction ID at the server.</p></td></tr></tbody></table>

#### Response Example

```json
[
	{
		"Id": 1,
		"doc": "id1",
		"docOperator": "id2",
		"timestamp": 1489752222590,
		"lastUpdate": 1489752228016,
		"status": "ENROLL_OK",
		"tguid": "2272DB15-AC76-4324-98C5-11EA1386F0CE"
	},
	{
		"Id": 2,
		"doc": "id1",
		"docOperator": "id2",
		"timestamp": 1489752274455,
		"lastUpdate": 1489752279908,
		"status": "UPDATE_OK",
		"tguid": "1E823F30-1E67-4254-B347-106D0DE74946"
	},
	{
		"Id": 33,
		"doc": "id1",
		"docOperator": "id2",
		"timestamp": 1489866115100,
		"lastUpdate": 1489866121427,
		"status": "UPDATE_SENT",
		"tguid": "549AEC06-7621-4972-BEDF-BAD24A20EEAC"
	}
]
```

### Capture Result List

This method is used for querying the result of a set of transactions ordered by ID.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/capture/result/list/{offset}</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td><strong>offset</strong>: the list is limited to 100 results per request and this parameter defines the offset from the list head to be considered</td></tr><tr><td><strong>Response</strong></td><td><blockquote><p>For each transaction in the returned list, the following information will be provided:</p></blockquote><p><strong>status</strong>: status of the given transaction at the server:</p><ul><li><code>NOT_SENT</code>: a problem has happened while trying to send the capture to the server;</li><li><code>ENROLL_OK</code>: the enrollment transaction was successfully finalized at the server;</li><li><code>ENROLL_CACHE_OK</code>: the enrollment transaction was successfully processed locally and is awaiting responses from remote servers;</li><li><code>ENROLL_CONTINGENCY_OK</code>: the enrollment transaction was successfully processed locally while one or more remote servers couldn’t be reached and is awaiting responses;</li><li><code>ENROLL_SENT</code>: the server received the enrollment transaction and is processing it;</li><li><code>ENROLL_FAILED</code>: the enrollment transaction failed at the server;</li><li><code>ENROLL_ANOMALY</code>: the enrollment transaction has caused an exception (a match occured with a previously enrolled set of biometrics);</li><li><code>ENROLL_TIMEOUT</code>: the server connection timed out while sending the enrollment transaction;</li><li><code>UPDATE_OK</code>: the update transaction was successfully finalized at the server;</li><li><code>UPDATE_CACHE_OK</code>: the update transaction was successfully processed locally and is awaiting responses from remote servers;</li><li><code>UPDATE_CONTINGENCY_OK</code>: the update transaction was successfully processed locally while one or more remote servers couldn’t be reached and is awaiting responses;</li><li><code>UPDATE_SENT</code>: the server received the update transaction and is processing it;</li><li><code>UPDATE_FAILED</code>: the update transaction failed at the server;</li><li><code>UPDATE_ANOMALY</code>: the update transaction has caused an exception (no match occured with the previously enrolled set of biometrics);</li><li><code>UPDATE_TIMEOUT</code>: the server connection timed out while sending the update transaction;</li><li><code>CORRUPTED</code>: the transaction data couldn’t be read from the local database;</li><li><code>SEARCH_MATCH</code>: the “verify” transaction returned a match with the previously enrolled biometrics;</li><li><code>SEARCH_NOT_MATCH</code>: the “verify” transaction returned a no match with the previously enrolled biometrics;</li><li><code>SEARCH_FAILED</code>: the “verify” transaction failed at the server;</li><li><code>OPERATOR_NOT_AUTHENTICATED</code>: the server couldn’t successfully authenticate the operator;</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br></p><blockquote><p>If the return is an error, the following fields will be added:</p></blockquote><p><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.<br><br></p><blockquote><p>If the return is not an error, the following fields will be added:</p></blockquote><p><strong>id</strong>: local ID or TGUID of the operation.<br><br><strong>doc</strong>: person ID of the client.<br><br><strong>docOperator</strong>: operator ID.<br><br><strong>timestamp</strong>: time the transaction was registered at the local database (epoch time in miliseconds).<br><br><strong>lastUpdate</strong>: timestamp of the transaction’s last update at the server.<br><br><strong>tguid</strong>: transaction ID at the server.</p></td></tr></tbody></table>

#### Response Example

```json
[
	{
		"Id": 1,
		"doc": "id1",
		"docOperator": "id2",
		"timestamp": 1489752222590,
		"lastUpdate": 1489752228016,
		"status": "ENROLL_OK",
		"tguid": "2272DB15-AC76-4324-98C5-11EA1386F0CE"
	},
	{
		"Id": 2,
		"doc": "id1",
		"docOperator": "id2",
		"timestamp": 1489752274455,
		"lastUpdate": 1489752279908,
		"status": "UPDATE_OK",
		"tguid": "1E823F30-1E67-4254-B347-106D0DE74946"
	},
	{
		"Id": 33,
		"doc": "id1",
		"docOperator": "id2",
		"timestamp": 1489866115100,
		"lastUpdate": 1489866121427,
		"status": "UPDATE_SENT",
		"tguid": "549AEC06-7621-4972-BEDF-BAD24A20EEAC"
	}
]
```

### Capture Update

This method is used for updating the status of a specific transaction.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/capture/result/list/update/{id}</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td><strong>id</strong>: local ID of the desired transaction</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the given transaction at the server:</p><ul><li><code>NOT_SENT</code>: a problem has happened while trying to send the capture to the server;</li><li><code>ENROLL_OK</code>: the enrollment transaction was successfully finalized at the server;</li><li><code>ENROLL_CACHE_OK</code>: the enrollment transaction was successfully processed locally and is awaiting responses from remote servers;</li><li><code>ENROLL_CONTINGENCY_OK</code>: the enrollment transaction was successfully processed locally while one or more remote servers couldn’t be reached and is awaiting responses;</li><li><code>ENROLL_SENT</code>: the server received the enrollment transaction and is processing it;</li><li><code>ENROLL_FAILED</code>: the enrollment transaction failed at the server;</li><li><code>ENROLL_ANOMALY</code>: the enrollment transaction has caused an exception (a match occured with a previously enrolled set of biometrics);</li><li><code>ENROLL_TIMEOUT</code>: the server connection timed out while sending the enrollment transaction;</li><li><code>UPDATE_OK</code>: the update transaction was successfully finalized at the server;</li><li><code>UPDATE_CACHE_OK</code>: the update transaction was successfully processed locally and is awaiting responses from remote servers;</li><li><code>UPDATE_CONTINGENCY_OK</code>: the update transaction was successfully processed locally while one or more remote servers couldn’t be reached and is awaiting responses;</li><li><code>UPDATE_SENT</code>: the server received the update transaction and is processing it;</li><li><code>UPDATE_FAILED</code>: the update transaction failed at the server;</li><li><code>UPDATE_ANOMALY</code>: the update transaction has caused an exception (no match occured with the previously enrolled set of biometrics);</li><li><code>UPDATE_TIMEOUT</code>: the server connection timed out while sending the update transaction;</li><li><code>CORRUPTED</code>: the transaction data couldn’t be read from the local database;</li><li><code>SEARCH_MATCH</code>: the “verify” transaction returned a match with the previously enrolled biometrics;</li><li><code>SEARCH_NOT_MATCH</code>: the “verify” transaction returned a no match with the previously enrolled biometrics;</li><li><code>SEARCH_FAILED</code>: the “verify” transaction failed at the server;</li><li><code>OPERATOR_NOT_AUTHENTICATED</code>: the server couldn’t successfully authenticate the operator;</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br></p><blockquote><p>If the return is an error, the following fields will be added:</p></blockquote><p><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.<br><br></p><blockquote><p>If the return is not an error, the following fields will be added:</p></blockquote><p><strong>id</strong>: local ID or TGUID of the operation.<br><br><strong>doc</strong>: person ID of the client.<br><br><strong>docOperator</strong>: operator ID.<br><br><strong>timestamp</strong>: time the transaction was registered at the local database (epoch time in miliseconds).<br><br><strong>lastUpdate</strong>: timestamp of the transaction’s last update at the server.<br><br><strong>tguid</strong>: transaction ID at the server.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"id": 97,
	"doc": "11068101806",
	"docOperator": "41799362833",
	"timestamp": 1490114943468,
	"lastUpdate": 1490114943969,
	"status": "UPDATE_ANOMALY",
	"tguid": "37BBE44B-924B-406F-824C-73FDC535416F"
}
```

### Capture Resend All

This method is used for resending any transaction with a status that indicates problems, such as ENROLL\_TIMEOUT, UPDATE\_TIMEOUT, NOT\_SENT and, if enabled in the configuration file, ERROR and OPERATOR\_NOT\_AUTHENTICATED.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/capture/resendAll</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td>none</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the resending attempt:</p><ul><li><code>OK</code>: the resending process has started</li><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.<br><br><strong>id</strong>: the local ID of the operation.</p></td></tr></tbody></table>

#### Response Example

```json
{
	"status": "OK",
	"message": "The captures that had problem are being resent"
}
```

### Capture Report

This method is used to retrieve the transaction report, which will be returned as a PDF file encoded as base64.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/capture/report/{id}</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td><strong>id</strong>: local ID of desired transaction</td></tr><tr><td><strong>Response</strong></td><td><blockquote><p>If the report is successful retrieved:</p></blockquote><p><strong>report</strong>: the base64 representation of the report document (PDF):<br><br></p><blockquote><p>If there is an error while retrieving the report:</p></blockquote><p><strong>status</strong>: of the attempt to retrieve de report:</p><ul><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.</p></td></tr></tbody></table>

#### Response Example

{% code overflow="wrap" %}

```json
{
	"report": "JVBERi0xLjQKJeLjz9MKMiAwIG9iago8PC9Db2xvclNwYWNlL0RldmljZVJHQi9TdWJ0eXBlL0ltYWdlL0hlaWdodCA1NS9GaWx0ZXIvRmxhdGVEZWNvZGUvVHlwZS9YT2JqZWN0L1dpZHRoIDQ5L0xlbmd0aCAzMS9CaXRzUGVyQ29tcG9uZW50IDg+PnN0cmVhbQp4nO3BMQEAAADCoP6pZwo/oAAAAAAAAACAiwGefnc9CmVuZHN0cmVhbQplbmRvYmoKNCAwIG9iago8PC9Db2xvclNwYWNlL0RldmljZVJHQi9TdWJ0eXBlL0ltYWdlL0hlaWdodCA1NS9GaWx0ZXIvRmxhdGVEZWNvZGUvVHlwZS9YT2JqZWN0L1dpZHRoIDQ5L0xlbmd0aCAzMS9CaXRzUGVyQ29tcG9uZW50IDg+PnN0cmVhbQp4nO3BMQEAAADCoP6pZwo/oAAAAAAAACAiwGefnc9CmVuZHN0cmVhbQplbmRvYmoKNSAwIG9iago8PC9Db2xvclNwYWNlL0RldmljZVJHQi9TdWJ0eXBlL0ltYWdlL0hlaWdodCAyNTAvRmlsdGVyL0ZsYXRlRGVjb2RlL1R5cGUvWE9iamVjdC9XaWR0aCAxODcvTGVuZ3RoIDc1OTA1L0JpdHNQZXJDb21wb25lbnQgOD4+c3RyZWFtCnic5L3nV1vJtu49xv1y7+m2yRlEkgAhiZwzJhkbbJyNbcCAyVFCCeWAckJCEiLb7pxzzsE5x7Y77H3uOe8/8s5aJRayhGnc3TuccTWeXqOQhEyzfjzzmVW1JIPJaCCkNxqwjAE3vV6vVqtlxE2hUBgMBqfTOb/gwXLNu92eeRjA0V9up788LlKueScWHjvdc+Q9MP5jmnM5AuR0OOfscw44euWY3Y7sc17Z7FY/zTpsXs1a/WSzWbCsVrNXMJ61mK2mJ2Q2m0wm+NXKZOKJyZHRsYHxyRF/TQzDQ5Ps0SnuBIjHZ/MFHJBwmjst4onEfKxpsRBLLB..."
}
```

{% endcode %}

### Stop

This method is used for stopping the running SPID instance.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/stop</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td>none</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the stopping attempt:</p><ul><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.</p></td></tr></tbody></table>

### Redirect to Verify

This endpoint redirects a transaction to verify in SPID Server.

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>/redirect_to_verify/{tguid}</td></tr><tr><td><strong>HTTP Method</strong></td><td>GET</td></tr><tr><td><strong>Content Type</strong></td><td>application/json</td></tr><tr><td><strong>Parameters</strong></td><td><strong>tguid</strong>: Unique ID of the desired transaction.</td></tr><tr><td><strong>Response</strong></td><td><p><strong>status</strong>: status of the redirection attempt:</p><ul><li><code>ERROR</code>: there was an error while processing this operation (further information will be provided in the message field).</li></ul><p><br><strong>message</strong>: the message containing more information about any <code>ERROR</code>, or the description of the status in the absence of errors.</p></td></tr></tbody></table>

## Development Guide

The recommended integration flow is shown below:


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.griaule.com/apis/spid-services.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
