Page 1 of 1

Session Token to access User table

Posted: Sat Jul 19, 2014 11:35 pm
by Aeneas McBurney

Hi,

Is there a admin session token that I can read the user table without a user being logged in? I need to create a "forgot login details" function and read the users email from the table to resend login details.

Thanks,
Aeneas


Session Token to access User table

Posted: Sun Jul 20, 2014 4:05 am
by obullei

Hello!

Please take a look here: http://devcenter.appery.io/tutorials/...
This tutorial should help you.


Session Token to access User table

Posted: Mon Jul 21, 2014 2:00 am
by Aeneas McBurney

Hi Arina, that topic is very useful however I wanted to approach it slightly different in that I want to check the registered email is in the users table and if it exists email them their details. How do I check an email exists in the user table without a session token? Can I use the master key?

Thanks,
Aeneas


Session Token to access User table

Posted: Mon Jul 21, 2014 4:09 am
by Yurii Orishchuk

Hi Aeneas,

Yes, you can use master key.

Please follow these steps:

1 Open your getUser service.

2 Navigate to the "Response" tab.

3 Add "X-Appery-Master-Key" request parameter. http://prntscr.com/44qut5/direct

4 Now you can populate this request parameter and query users collection in accordance to your needs without sessionToken.

http://prntscr.com/44qvas/direct

Regards.


Session Token to access User table

Posted: Tue Jul 29, 2014 8:09 am
by Jennifer Liu

Hi, where do you create the getUser service because my app needs to perform a similar function.

I tried create a rest service and called it getUser, but I am not sure what to put for the url in the getUser rest service setting.

Thanks,


Session Token to access User table

Posted: Tue Jul 29, 2014 11:51 pm
by Yurii Orishchuk

Hi Jennifer,

Here is brief plan:

1 Create "getUser" REST service. http://devcenter.appery.io/documentat...

2 Navigate to Settings tab and populate it like on screen shot:

pre

URL: https://api.appery.io/rest/1/db/users/{userId}

/pre

http://prntscr.com/3y5fkm/direct

3 Navigate Request Tab and set following parameters:

pre

userId
X-Appery-Database-Id = {database_id}
X-Appery-Session-Token

/pre

http://prntscr.com/3y5fws/direct

That's all.

Regards.