Constructor
# new Services(apiKey)
Create an instance of OpenData service.
Parameters:
Name | Type | Description |
---|---|---|
apiKey |
string
|
The API key for authentication. |
Extends
- FetchService
Methods
# validateCitizenCedula(cedula) → {Promise|Object}
Validate a citizen's ID card number.
Full documentation: https://developer.digital.gob.do/apis/ff9ce928-e16e-4ea9-9ce9-28e16e1ea96e
Full documentation: https://developer.digital.gob.do/apis/ff9ce928-e16e-4ea9-9ce9-28e16e1ea96e
Parameters:
Name | Type | Description |
---|---|---|
cedula |
string
|
The ID number of the citizen to be validated. |
A Promise that resolves with the validation result.
Promise
Returns the validation result.
Object
Example
// Example: Retrieve citizen data for the Dominican Republic
// Full documentation: https://developer.digital.gob.do/apis/ff9ce928-e16e-4ea9-9ce9-28e16e1ea96e
async function getCitizenData() {
try {
const isValid = await aletheiaSDK.services.validateCitizenCedula('XXX');
console.log('Citizen Cedula:', isValid);
} catch (error) {
console.error('Error retrieving citizen data:', error);
}
}
getCitizenData();