API with token

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
Wisdomz
User
Posts: 6

API with token

Post by Wisdomz »

our user want to access their data with API based on URL

//www.myweb.com/getmydata.php?token=sfsdfhsdhf...

I had assigned a token for every user, so, the user did not need login with userid and password,

their programs can call the API to get some table data or view data based on Json format

for example

table A,

return table A some fields with API based on userid security.


arbei
User
Posts: 9284

Post by arbei »

You can use the advanced options "Allow login by URL" or "Allow login by session variable" in [Tools] -> [Advanced Settings] to archive your goal.

Read help file topic: "Tools" -> "Advanced Settings" for more information.

You can use Page_Redirecting server event for the login page to redirect user to your page to get data.

If you prefer your own way using token, you can use User_CustomValidate server event to validate your token and login user.

Read help file topic: "Server Events and Client Scripts" for more information.


Wisdomz
User
Posts: 6

Post by Wisdomz »

Hi,

thank you, but if I use the approach, please advise if it will have confilict with phpmaker generated page,

I expect some programs can get the data with "allow login by URL", meanwhile the system can maintain the others user login the website and go as normal model.

two models can work well.

I will try the allow login by URL, anything, I will post the my questions.

thank you

Wisdom


arbei
User
Posts: 9284

Post by arbei »

It will not conflict with the normal login procedure, and the user still can log in with the login.php.


Post Reply