Class

Services

Services(apiKey)

Services Class Represents a client for interacting with various open services for the Dominican citizen. This class extends the FetchService class and provides methods for different use cases.
Constructor

# new Services(apiKey)

Create an instance of OpenData service.
Parameters:
Name Type Description
apiKey string The API key for authentication.

View Source services/services.js, line 13

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
Parameters:
Name Type Description
cedula string The ID number of the citizen to be validated.

View Source services/services.js, line 40

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();