Normal
Hey Guys,So I am working on my own custom CMS for a client, who has requested that I give them an API that another system will be able to make simple calls to validate or pull information. So for example, they need to know if a phone number exists in my system.Here is how I would like to do it:{domain}/api/get/{command}/params{domain}/api/post/{command}/paramsSo for example:{domain}/api/get/phone_exists&phone=5555555555Here is what I was thinking:API would be a PHPpage that has a connection to the database / main system (Would not require them to be LOGGED IN for the SESSION, but I will need to somehow validate their authentication <-- this is also where I need some help)get/post is a parameter I can read from the URL rewrite, that I would call an appropriate function, which would have a switch statement for the commands available.Each command would have its own php page that would perform the required items, and return a result.Is my structure OK?How do I proceed with Authentication?Other helpful tips?
Hey Guys,
So I am working on my own custom CMS for a client, who has requested that I give them an API that another system will be able to make simple calls to validate or pull information. So for example, they need to know if a phone number exists in my system.
Here is how I would like to do it:
{domain}/api/get/{command}/params
{domain}/api/post/{command}/params
So for example:
{domain}/api/get/phone_exists&phone=5555555555
Here is what I was thinking:
API would be a PHPpage that has a connection to the database / main system (Would not require them to be LOGGED IN for the SESSION, but I will need to somehow validate their authentication <-- this is also where I need some help)
get/post is a parameter I can read from the URL rewrite, that I would call an appropriate function, which would have a switch statement for the commands available.
Each command would have its own php page that would perform the required items, and return a result.