PullMonkey Blog


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:

# 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"}>
view raw gistfile1.rb hosted with ❤ by GitHub


Comments Off on VIN API – ignore checksum validation Filed under: Uncategorized Tags: , , , , , , , , ,