The collector outputs will each need a pull-up resistor to Vdd, your CPU logic voltage, so that these pins may go "high". Other than that, it should work. The resistance value chosen (along with the capacitance of each line) determines how fast the output goes high. If speed isn't an issue, 10kΩ should work. But for fast speeds, much lower values will be better, and this means the current rating of the transistors inside the opto needs to be taken into consideration.
Edit: The STM32F072C8T6 has a supply voltage of 3.3v nominal. Bypass caps must be installed across Vdd/Vss pins. Make sure
NRST lines are handled correctly according to the datasheet.
The TLP280-4 LEDs can be driven to 50mA: 24v/50mA = 480Ω minimum input resistance. Output transistor limit is also 50mA: 3.3v/50mA = 66Ω minimum pull-up. Smaller resistances will be faster, if speed is a concern.