Getting the last event made with a CustomDimension as segment


I would like to get the last event made by a CustomDimension (in my case a local lan ip adress). It’s very important that I get the timestamp when the event has been made.

I tried using the API but could’nt find the right method to achieve this

Thank you,