Get selected contact ID dynamically or from the URL

Get selected contact ID dynamically or from the URL

Hello, 

I'm working on getting an integration done, and I need to get the selected contact information to be passed to the integration, in other words, my end goal here is to go to Zoho CRM>click contacts>click on a contact to open it>Get the ID of that opened contact only

So far, I know there are functions that will allow you to get contact by ID, but this works if you know the ID already, and there is also get contacts which returns the list of contacts and you can get the ID from there, but I need a way to get the ID of the contact I have opened, so I pull it by clicking a button for example, 

I guess a good way may be to get a contact ID from the URL which is displayed every time you open a contact, does anybody know if this can be done?

I'm referring for example to the part of the URL when you open a contact which looks like https://crm.zoho.com/crm/org751578/tab/Contacts/509752300051619 so I need to get just that number 509752300051619 so I can then get its information, but I need it to be the one I currently have opened. Any ideas?