Page 1 of 1

API with token

Posted: Sat Jun 10, 2017 11:52 pm
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.


Re: API with token

Posted: Mon Jun 12, 2017 9:47 am
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.


Re: API with token

Posted: Sat Jun 17, 2017 9:46 pm
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


Re: API with token

Posted: Mon Jun 19, 2017 11:04 am
by arbei

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