SMC Auto Switch for pneumatic ram

Hi.
I just got a SMC pneumatic ram with two Auto switches to sense when its at at either end of its stroke.
I was hoping to connect these with the arduino but have a question.
I have looked up the data sheet for the auto switch.
Its a D-M9P. have included some basic specs and a wiring diagram.
my question is…

because i wont be connection it to a plc. do i need to put those resistors and diode in before connecting to my arduino?
and if so what resistors and diode should i use.

thanks
fulstop

My best guess would be Blue to Ground, Brown to +5, and Black to a data input pin. Measure the voltage between Blue and Black with the switch ON and OFF. If it's always LOW (near 0), add a 10K pull-up resistor between Black and +5.

I tried connecting it in the way you suggested. But to an Independant power source.
I got 0v and pretty much 5v respectively. Also a led lit up on the switch when it was on.
Do I need to put a current limiting resistor or some protection for the arduino?
Thanks

fulstop: Do I need to put a current limiting resistor or some protection for the arduino?

You don't need current limiting for inputs, just outputs.

Thank!