I'm working with an api that requires specific ID numbers to retrieve certain objects. Right now I have a form for the user to manually enter an ID and on submission it GETs an object. But what I want is to have links to all the IDs instead so the user can just click and choose which object to retrieve. I'm not necessarily trying to make a GET request from the user click. I can make the GET request on the backend but I just need a way to determine which ID the user is trying to select. I have been searching and searching for a way to do this but I haven't found anything specific to my dilemma. I've read on having a hidden form or using AJAX but is there not a simpler solution? Is there not a way to where the PHP server can detect which link and ID is clicked to store it in a variable?
For example:
$lib->request('$ID.'/videos','GET');
retrieves a set of videos.
<button type ="button" id="23456" >Video Number 1</button>
Is there a way that I could pass the id of the button above to php?
I'm really confused and I'm wondering if I'm over complicating this.