28 Oct
VIN API – ignore checksum validation
It's been mentioned a few times that there should be a way to skip the checksum validation. This means if the check digit calculation generally fails, VIN API will continue to process the VIN to see if there is a "like" VIN match. So here it is:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first without ignoring the checksum, you'll see that we get an error | |
>> VinApi.find("VIN WITH BAD CHECKSUM GOES HERE") | |
=> #<VinApi @prefix_options={}, @attributes={"error"=>"Vin did not pass checksum test"}> | |
# next ignoring the checksum, we get our data | |
>> VinApi.find("VIN WITH BAD CHECKSUM GOES HERE", :params => {:ignore_checksum => "true"}) | |
=> #<VinApi @prefix_options={}, @attributes={"body_style"=>"Coupe", "model"=>"ACCORD EX", "country"=>"USA", "world_region"=>"North America", "engine_type"=>"FWD", "vin"=>"VIN WITH BAD CHECKSUM GOES HERE", "transmission"=>"Automatic", "make"=>"Honda", "year"=>"2003"}> |