Page 1 of 1

Invoking Rest Service to retrieve data from User collection

Posted: Thu Apr 23, 2015 6:44 am
by Sirn Loong Toh

I've been reading a few threads on using Rest service to obtain data from the user collection and am wondering, when should a parameter be added as a header and when to use query string?

Is the header similar to a primary key in a conventional SQL database?


Invoking Rest Service to retrieve data from User collection

Posted: Thu Apr 23, 2015 7:20 am
by Sirn Loong Toh

I've got a follow up question as well after being able to solve my problem.

What I wanted to do was to create a REST Service that passes the username as a parameter to retrieve user details and was passing https://api.appery.io/rest/1/db/users/ as my URL

I then noticed in one of the topics that I should use https://api.appery.io/rest/1/db/users... instead.

What is the difference between < and {}? Is {} the correct syntax to use? And do you have any links on where I can read more on this topic?


Invoking Rest Service to retrieve data from User collection

Posted: Fri Apr 24, 2015 4:39 pm
by Serhii Kulibaba

It is impossible to get user's date by it's name. You should use "_id" instead on name.

< uses for describing parameters which you should set.
{} uses for dynamic URL parts.
More information about "{}" here: https://devcenter.appery.io/documenta...


Invoking Rest Service to retrieve data from User collection

Posted: Sat Aug 08, 2015 4:00 pm
by pakbull6772540

If I am using Auth0 plugin to log in to Appery app, it returns session token and for a new user will add that user to the Users collection.

How do I get the _id for that user back so I can use it as part of the ACL setup during create item REST service.

Does the Auth0 service returns the _id along with the token. If not, then how to find the _id for that user.


Invoking Rest Service to retrieve data from User collection

Posted: Sat Aug 08, 2015 7:48 pm
by pakbull6772540

Ok. I figured it out. Basically the Auth0 service does return the appery_userid value but it is not defined in the response tab (which is created by default). Just add another string to the response tab and name it

apperyio_userId

This will be the user id for the logged in user and now it can be used in the create / update REST api to load the acl.


Invoking Rest Service to retrieve data from User collection

Posted: Sun Aug 09, 2015 5:00 am
by Illya Stepanov

Thank you for update!