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.
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.
Test the service (test cases)
We have included a query parameter in Sandbox to enable you to query the test cases that we created for running tests. To get a response, fill the testCaseId parameter with any of the following cases:
Num | Id | Name | Description |
---|---|---|---|
1 | 663567bb713cf2110a1106c7 | No encontrado | Indicates that there is no information with the data provided |
2 | 663567bb713cf2110a1106c8 | No válido | Indicates that information was found with the data provided, but the identification is no longer valid or current |
3 | 663567bb713cf2110a1106c6 | Respuesta exitosa | Indicates one successful response |
4 | 663567bb713cf2110a1106c9 | Servicio no disponible | Indicates that the service is not available |
Test your own test case
In case you want to test your own test case created in link, you can send in the testCaseId parameter the identifier of the test case you want to use.
For more information visit our knowledge center to know more about test cases
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"
}