i am making an Rest API and this is my first one. I am a little bit confused with the endpoints. [1]http://localhost/01_Diplo/API/API/API/api/participants/ thats what a http request looks right now. This will return a list of all participants from a table. [2]http://localhost/01_Diplo/API/API/API/api/participants?kz=14escs37 this would get me one specific participant with the "kz" = 14escs37. participants is just a folder with a index.php inside and i simple check for get request and get value.
Is this how it should look like because some others would make it like this: [3]http://localhost/01_Diplo/API/API/API/api/participants/14escs37 to get on specific user.
I wonder how i can implement this because when i enter this[3] in my url it expects 14escs37 to be a folder but i want it as an endpoint.
How can i program this into my index.php?
Thanks in advance Simon