Verify the validity of a voting credential

Intro

This API lets you validate if a voting credential exists or is active in the INE "lista nominal" service.

Important points

Required parameters

All fields are required, but the list may change depending on the modelo type of document.
The types of credentials that can be validated with this tool are models C, D, E, F, G and H, to validate the differences int models visit our Knowledge center for .

modelo

The modelo field is the main field in the request body, in it the credential model to be consulted must be sent, from this field the mandatory fields to send will be determined.

The possible values for this field are:

  • c, to validate type C credentials
  • d, to validate type D credentials
  • e, to validate type E or newer credentials
Model c

claveElector
Required alphanumeric field with 18 characters long
numEmision
Required numeric field with 2 characters long
ocr
Required numeric field with 12-13 characters long

Model d

cic
Required numeric field between 7 and 9 digits long
ocr
Required numeric field with 12-13 characters long

Model e and newer

cic
Required numeric field between 7 and 9 digits long
idCiudadano
Required numeric field with 9 characters long

Successful response

To know the fields of a successful response you should see our example called Success any Model in the response section.

808

Test the service (test cases)

We included a query param in Sandbox environment, so you can query test cases that we created to run tests.
In order to obtain the response you shall fill the query param with:

  • success: it sends back a successful example of a requests

  • notFound: it sends back an answer with the status "NOT FOUND" to indicate that the query was not found on the INE system.

  • notValid: it sends back an answer with the status "NOT_VALID" to indicate that the query was not found on the INE system.

Possible Errors

Model required

You will get a 400 bad request if the modelo field is not provided to the request

{
    "modelo": "REQUIRED_FIELD_ERROR; EMPTY_ERROR; can't be empty"
}

Required fields

You will get a 400 bad request error when any of the parameters are not provided in the body request.

{
    "claveElector": "REQUIRED_FIELD_ERROR; EMPTY_ERROR; can't be empty",
    "numEmision": "REQUIRED_FIELD_ERROR; EMPTY_ERROR; can't be empty",
    "ocr": "REQUIRED_FIELD_ERROR; EMPTY_ERROR; can't be empty",
    "cic": "REQUIRED_FIELD_ERROR; EMPTY_ERROR; can't be empty",
    "idCiudadano": "REQUIRED_FIELD_ERROR; EMPTY_ERROR; can't be empty"
}

Invalid format

You will get a 400 bad request error when any of the parameters do not conform the specific length

{
        "claveElector": "LENGTH_ERROR; should be 18 digits",
    "numEmision": "LENGTH_ERROR; should be 2 digits",
    "ocr": "LENGTH_ERROR; should be 12-13 digits",
    "cic": "LENGTH_ERROR; should be 7 to 9 digits",
    "idCiudadano": "LENGTH_ERROR; should be 9 digits"
}

Test case not found

if a test case parameter is not sent or a value other than those mentioned above is sent, the service will return the following error 400 bad request

{
    "testCase": "EMPTY_ERROR; test case not found"
}
Language
Authentication
Header
Click Try It! to start a request and see the response here!