How to check if NC user is logged in from 3rd REST API

I would like to write a NC application, but some data will be provided by third party REST API. The API must be accessible only for users already logged in to NC.
Do you have any idea how to do it?