SPID Services API¶
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:
C:\Griaule\SPID\conf\GBSSpid2.properties
Linux Installation 1:
See also
Further information about the SPID Configuration file can be found in the SPID Configuration Manual.
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/
.
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.
- 1
The SPID-Linux is only available for debian-based linux distributions. Contact the Griaule Support Team for further information.
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).
URL |
/login/<id> |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
id: ID of the operator to be logged in |
Response |
status: status of the operator login attempt:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
id: ID of the operator. |
Response Example |
---|
{"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.
URL |
/login/status |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
|
Response |
status: status of the operator login:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
id: ID of the current operator, if logged in. |
Response Example |
---|
{"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.
URL |
/logout |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
|
Response |
status: status of the operator logout attempt:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
|
Response Example |
---|
{"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.
URL |
/verify/operator |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
|
Response |
status: status of the operator verification:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
id: ID of the operator being verified. |
Response Example |
---|
{"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.
URL |
/verify/status |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
|
Response |
status: status of the operator verification:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
id: ID of the operator being verified. |
Response Example |
---|
{"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.
URL |
/capture/operator-enroll/<id> |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
id: ID of the operator to be enrolled |
Response |
status: status of the operator enrollment:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
id: ID of the operator being enrolled. |
Response Example |
---|
{"status":"OPERATOR_CAPTURING","message":"Operator capture was
initialized","id":"id1"}
|
Enroll¶
This method is used for capturing a client’s biometrics for enrollment.
URL |
/capture/enroll/<id> |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
id: ID of the client to be enrolled |
Response |
status: status of the client enrollment capture:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
id: ID of the client being enrolled. |
Response Example |
---|
{"status":"CLIENT_CAPTURING","message":"Client capture initialized",
"id":"id1"}
|
Verify¶
This method is used to verify the biometrics of a client.
URL |
/capture/verify/<id> |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
id: ID of the client to be verified |
Response |
status: status of the client verification capture:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
id: ID of the client being verified. |
Response Example |
---|
{"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.
URL |
/capture/remoteEnroll/<id> |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
id: ID of the client to be verified |
Response |
status: status of the client verification capture:
message: returns the tguid and dynamicLink
of the remote enroll transaction.
id: ID of the client being captured. |
Response Example |
---|
{"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.
URL |
/capture/remoteEnroll/result/<tguid> |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
tguid: TGUID of the desired transaction |
Response |
status: status of the given transaction at the
server:
message: for valid enroll transactions, the
message contains the enroll status.
Possible enroll status are: ENROLL_CACHE_OK,
ENROLL_IN_PROGRESS, ENROLL_OK, ENROLL_FAILED,
ERROR, ENROLL_EXCEPTION, REMOTE_CAPTURE_PENDING,
REMOTE_CAPTURE_STORED, REMOTE_CAPTURE_ACCEPTED,
REMOTE_CAPTURE_REFUSED, REMOTE_CAPTURE_AVAILABLE,
ENROLL_REJECTED.
|
Response Examples |
---|
{"status":"Done","message":"Remote enroll with status ENROLL_IN_PROGRESS"}
{"status":"Error","message":"Get enroll result returned null for tguid: TGUID"}
{"status":"Login not active","message":"There is no valid operator logged in"}
{"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.
URL |
/capture/remoteVerify/<id> |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
id: ID of the client to be verified |
Response |
status: status of the client verification capture:
message: the message containing more information
about any ERROR, or the tguid and dynamic link
of the remote verify, on success.
id: ID of the client being verified. |
Response Example |
---|
{"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.
URL |
/capture/remoteVerify/result/<tguid> |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
tguid: TGUID of the desired transaction |
Response |
status: status of the given transaction at the
server:
message: the message containing more information
about any ERROR, or the description of
the verify status in the absence of errors.
The verify status can be:
SEARCH_MATCH, SEARCH_NOT_MATCH,
SEARCH_IN_PROGRESS, SEARCH_FAILED,
REMOTE_CAPTURE_PENDING, REMOTE_CAPTURE_STORED,
REMOTE_CAPTURE_ACCEPTED, REMOTE_CAPTURE_REFUSED,
REMOTE_CAPTURE_AVAILABLE.
|
Response Example |
---|
{"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
URL |
/gbs-spid-services/api/capture/remoteApproval/{tguid} |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
tguid: TGUID returned by the remote capture |
Response |
status: status of the call, can be one of the
following values:
message: eturns message for remote approval
|
Response Examples |
---|
{"status":"Done","message":"Remote approval initialized"}
{"status":"Error","message":"..."}
{"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.
URL |
capture/operator-capture |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
|
Response |
status: status of the operator authentication:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
id: ID of the client being captured. |
Response Example |
---|
{"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.
URL |
/capture/stop |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
|
Response |
status: status of the capture scene stop attempt:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
|
Response Example |
---|
{"status":"OK","message":"All active scenes were closed"}
|
Capture Status¶
This method is used for checking the status of the current capture session.
URL |
/capture/status |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
|
Response |
status: status of the current capture session:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
|
Response Example |
---|
{"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.
URL |
/capture/send |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
|
Response |
status: status of the enqueuing attempt:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
id: local ID of the operation. |
Response Example |
---|
{"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.
URL |
/capture/result/<id> |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
id: local ID or TGUID of the desired transaction |
Response |
status: status of the given transaction at the
server:
If the return is an error, the following fields
be added:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
If the return is not an error, the following fields
will be added:
id: local ID or TGUID of the operation. doc: person ID of the client. docOperator: operator ID. timestamp: time the transaction was registered
at the local database (epoch time in miliseconds).
lastUpdate: timestamp of the transaction’s last
update at the server.
tguid: transaction ID at the server. |
Response Example |
---|
{"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.
URL |
/capture/result/list/<startDate>/<endDate>/<offset> |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
startDate: initial date to be consulted (epoch
time in miliseconds)
endDate: final date to be consulted (epoch
time in miliseconds)
offset: the list is limited to 100 results per
request and this parameter defines the offset from
the list head to be considered
|
Response |
For each transaction in the returned list, the will
be provided the following information:
status: status of the given transaction at the
server:
If the return is an error, the following fields
be added:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
If the return is not an error, the following fields
will be added:
id: local ID or TGUID of the operation. doc: person ID of the client. docOperator: operator ID. timestamp: time the transaction was registered
at the local database (epoch time in miliseconds).
lastUpdate: timestamp of the transaction’s last
update at the server.
tguid: transaction ID at the server. |
Response Example |
---|
[
{
"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.
URL |
/capture/result/list/<offset> |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
offset: the list is limited to 100 results per
request and this parameter defines the offset from
the list head to be considered
|
Response |
For each transaction in the returned list, the
following information will be provided:
status: status of the given transaction at the
server:
If the return is an error, the following fields
be added:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
If the return is not an error, the following fields
will be added:
id: local ID or TGUID of the operation. doc: person ID of the client. docOperator: operator ID. timestamp: time the transaction was registered
at the local database (epoch time in miliseconds).
lastUpdate: timestamp of the transaction’s last
update at the server.
tguid: transaction ID at the server. |
Response Example |
---|
[
{
"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.
URL |
/capture/result/list/update/<id> |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
id: local ID of the desired transaction
|
Response |
status: status of the given transaction at the
server:
If the return is an error, the following fields
be added:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
If the return is not an error, the following fields
will be added:
id: local ID or TGUID of the operation. doc: person ID of the client. docOperator: operator ID. timestamp: time the transaction was registered
at the local database (epoch time in miliseconds).
lastUpdate: timestamp of the transaction’s last
update at the server.
tguid: transaction ID at the server. |
Response Example |
---|
{"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.
URL |
/capture/resendAll |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
|
Response |
status: status of the resending attempt:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
id: the local ID of the operation. |
Response Example |
---|
{"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.
URL |
/capture/report/<id> |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
id: local ID of desired transaction |
Response |
If the report is successful retrieved: report: the base64 representation of the report
document (PDF):
If there is an error while retrieving the report: status: of the attempt to retrieve de report:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
|
Response Example |
---|
{"report":"JVBERi0xLjQKJeLjz9MKMiAwIG9iago8PC9Db2xvclNwYWNlL0RldmljZV
JHQi9TdWJ0eXBlL0ltYWdlL0hlaWdodCA1NS9GaWx0ZXIvRmxhdGVEZWNvZGUvVHlwZS9
YT2JqZWN0L1dpZHRoIDQ5L0xlbmd0aCAzMS9CaXRzUGVyQ29tcG9uZW50IDg+PnN0cmVh
bQp4nO3BMQEAAADCoP6pZwo/oAAAAAAAAACAiwGefnc9CmVuZHN0cmVhbQplbmRvYmoKN
CAwIG9iago8PC9Db2xvclNwYWNlL0RldmljZVJHQi9TdWJ0eXBlL0ltYWdlL0hlaWdodC
A1NS9GaWx0ZXIvRmxhdGVEZWNvZGUvVHlwZS9YT2JqZWN0L1dpZHRoIDQ5L0xlbmd0aCA
zMS9CaXRzUGVyQ29tcG9uZW50IDg+PnN0cmVhbQp4nO3BMQEAAADCoP6pZwo/oAAAAAAA
ACAiwGefnc9CmVuZHN0cmVhbQplbmRvYmoKNSAwIG9iago8PC9Db2xvclNwYWNlL0Rldm
ljZVJHQi9TdWJ0eXBlL0ltYWdlL0hlaWdodCAyNTAvRmlsdGVyL0ZsYXRlRGVjb2RlL1R
5cGUvWE9iamVjdC9XaWR0aCAxODcvTGVuZ3RoIDc1OTA1L0JpdHNQZXJDb21wb25lbnQg
OD4+c3RyZWFtCnic5L3nV1vJtu49xv1y7+m2yRlEkgAhiZwzJhkbbJyNbcCAyVFCCeWAc
kJCEiLb7pxzzsE5x7Y77H3uOe8/8s5aJRayhGnc3TuccTWeXqOQhEyzfjzzmVW1JIPJaC
CkNxqwjAE3vV6vVqtlxE2hUBgMBqfTOb/gwXLNu92eeRjA0V9up788LlKueScWHjvdc+Q
9MP5jmnM5AuR0OOfscw44euWY3Y7sc17Z7FY/zTpsXs1a/WSzWbCsVrNXMJ61mK2mJ2Q2
m0wm+NXKZOKJyZHRsYHxyRF/TQzDQ5Ps0SnuBIjHZ/MFHJBwmjst4onEfKxpsRBLLB…"}
|
Stop¶
This method is used for stopping the running SPID instance.
URL |
/stop |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
|
Response |
status: status of the stopping attempt:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
|
Redirect to Verify¶
This endpoint redirects a transaction to verify in SPID Server.
URL |
/redirect_to_verify/<tguid> |
HTTP Method |
GET |
Content Type |
|
Accept |
application/json |
Parameters |
tguid: Unique ID of the desired transaction. |
Response |
status: status of the redirection attempt:
message: the message containing more information
about any ERROR, or the description of
the status in the absence of errors.
|