How To Send Free Sms With Php Api?

Api architecture -  api-consumer flow?

  • I am developing an API for a social network website. This API will basically get all the requests from the users (get friend list, post a status update etc) and reply back if necessary. We will implement OAuth 2.0 protocol for authentication. Consumer (our php project) has API id and secret. Basic scenario: Client wants to log in API Consumer (php web project) takes this request, directs user to API User send his/her user credentials to the api, gets the token. User comes back to our website, pass token to the consumer. Consumer goes to the api server, gets the access token. Now consumer (php project) has access to user's private information. Since this is a social network website, we want app developers to be able to use our API in the future. I am not experienced in API-design. Does that flow make sense? I guess the simplest authentication would be accessing user information through php project. But we dont want to access database in php code. We will use ajax in client side and send a request to the API. And I believe there should be a better solution, what would you suggest?

  • Answer:

    If you are the resource server, the auth server and client, you should implement the password flow. Basically, your web app (role of client) presents the user a login form. The form posts to the auth server the client id, username (user input) and password (user input). The auth server responds with a shortlived token and refresh token.

Daniel Cerecedo at Quora Visit the source

Was this solution helpful to you?

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.