According to the spec, 3.5 volts is the blue flavor. LED is rated at 20 mA.
So resistance = (Vsupply - 3.5) / .02 as a minimum value.
For 12 volts that's 245 ohms at .17 watts.
For 24 volts it's 1.025 kOhms at .41 watts.
So using real world values, try 270 ohms 1/4 watt resistor if you've got 12 volts. For 24 volts, 1 kOhm or 1.2 kOhms.
1/2 watt should work, but a conservative application might want more margin.
These are minimum values. If it's too bright, increase the resistance.