Check if person, using date of birth and name, have a valid certificate using GET.
For every API request you make, you'll need to present the API access key in the HTTP Header as X-API-Key to be authenticated.
Name | Required | Value | Description |
---|---|---|---|
date | required | string | Date of birth. format: yyyy-mm-dd OR yyyy-mm-dd hh:mm:ss |
firstname | required | string | |
lastname | required | string |
$request_url = 'https://api.frontcore.com/v2/certificate/check/1992-05-12/Lars/Larsen';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'X-API-Key: {your-api-key}',
'Accept: application/json',
));
$result = curl_exec($ch);
curl_close($ch);
If the method is successful it responds with an JSON structure, as it is shown below.
{ "person_found": true, "is_certificate_valid": false, "certificate_issued_at": null, "certificate_expires_at": null, "user": { "id": 154420, "firstname": "Lars", "lastname": "Larsen", "email": "lars@eksemel.ek", "phone": "21212121" } }
Unsuccessful response sample:
{ "error": "Wrong API Key" }