Well, it would be a 3 wire sensor if the bolt hole is the ground, otherwise it is a sensor with a current output, delivering 6mA on one state and 16ma in the other state. Thus you use a 12V supply to pin 1 and a resistor from pin 2 to ground, detecting the voltage drop across the resistor. 16mA says it must drop 5V, so the value is around 300R, giving you a pretty close to TTL signal.