Backendless Support
 
Answered

How to construct BackendlessUser from userToken

Hi,

I'm calling a Hosted service and I'm passing user-token in header because I'll need to create and save an object that belongs to User.

So, I have the object created (lets call it Item) and each User may have N items. So how can I create a BackendlessUser with user-token. Or it there other alternative to create the Item without constructing the User object.

Service is in Java.

Thanks for any help,

Telmo Cardoso

Best Answer
photo

If you pass user-token in headers this mean that you are logged in, and hosted service will do the calls as logged in user. Also if you pass user-token you can get userId, in the hosted service, from context https://backendless.com/documentation/business-logic/java/apieng_invocation_context.htm

Leave a Comment

Comments (1)

photo
1

If you pass user-token in headers this mean that you are logged in, and hosted service will do the calls as logged in user. Also if you pass user-token you can get userId, in the hosted service, from context https://backendless.com/documentation/business-logic/java/apieng_invocation_context.htm