I am a college student looking to make a portfolio piece regarding web services and web applications working with another API and interfacing it with my own. I am attempting to create my own API (In which we will be using API and posting to the web as this is our only way known) but the API must have multiple endpoints which is one thing I do not know how to do. I can write and API that is "queryable" meaning I can enter many different parameters into the request to return different data but the different endpoints is what is confusing me. If anyone could help that would be great
Asked
Active
Viewed 64 times
0
-
1From the duplicate, I would recommend something more like https://stackoverflow.com/a/15466937/1213708, this uses a router to decide which piece of code the run according to the URI used. – Nigel Ren Dec 03 '20 at 08:32
-
See @NigelRen The only issue is as far as I know with API is that all I know with APIs is how to make a simple like examplesite.php return me some like simple Question and Answer JSON... this all seems like something I shouldn't know – RyanXLVI Dec 03 '20 at 08:39
-
Different endpoints are just different URLs. So you can have several different PHP scripts with different names to achieve that, or you can do what Nigel suggests and use a router pattern. – ADyson Dec 03 '20 at 09:08