Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
PHP - Need API w/ Authentication
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="JayC" data-source="post: 465905" data-attributes="member: 36373"><p>Hey Guys,</p><p></p><p>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. </p><p></p><p>Here is how I would like to do it:</p><p></p><p>{domain}/api/get/{command}/params</p><p>{domain}/api/post/{command}/params</p><p></p><p>So for example: </p><p>{domain}/api/get/phone_exists&phone=5555555555</p><p></p><p>Here is what I was thinking:</p><p></p><p>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)</p><p></p><p>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. </p><p></p><p>Each command would have its own php page that would perform the required items, and return a result. </p><p></p><p></p><p></p><ul> <li data-xf-list-type="ul">Is my structure OK?</li> <li data-xf-list-type="ul">How do I proceed with Authentication?</li> <li data-xf-list-type="ul">Other helpful tips?</li> </ul></blockquote><p></p>
[QUOTE="JayC, post: 465905, member: 36373"] 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. [LIST] [*]Is my structure OK? [*]How do I proceed with Authentication? [*]Other helpful tips? [/LIST] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
PHP - Need API w/ Authentication
Top