I have a requirement to ask user to type in the URL of the SharePoint List or library and do validation whether that is a valid list or not. The URL could be of other site collection / subsite too. What is the best way to check if its a valid list URL and how to get the list object out of it?
Note: I can use JSOM / REST only (no server side code)