Richard Edwards
Posts: 0
Joined: Sat May 16, 2015 7:00 pm

Updating Users, keep getting unauthorized

Hi there,

I'm having difficulty updating users in my db. I think I've set up the service correctly but I keep getting the following - even when I test it within Appery:

{
"status":401,
"uri":"https://api.appery.io/rest/1/db/users...",
"response":{
"code":"DBUU001",
"description":"unauthorized"
}
}

What am I missing? Is it because I don't have X-Appery-Session-Token set in the Headers? And if so, what should I use there?

Here are my settings:

Image Image
Image Image

Thanks for your help!

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Updating Users, keep getting unauthorized

Correct, you need to pass the session token (in header) which you get when you login.

Richard Edwards
Posts: 0
Joined: Sat May 16, 2015 7:00 pm

Updating Users, keep getting unauthorized

Hi Max,

Thanks for the quick reply! Okay, so I have got that and also now realise that users can only update their own object too. It works!

Thanks for being so speedy and awesome!
Richard

Michael Ochakovsky
Posts: 0
Joined: Thu Oct 17, 2019 2:56 am

Updating Users, keep getting unauthorized

How was this solved? I've been trying to update some fields on my tables for over a year. still cannot find any code to do this.

Any help practical pointers would be appreciated

Michael Ochakovsky
Posts: 0
Joined: Thu Oct 17, 2019 2:56 am

Updating Users, keep getting unauthorized

How do I display all the DB record for the current user on the gui, via a separate label for each db field. Who can answer this without sending me a link? Does anyone on the forum knows how to do this?

Thanks

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Updating Users, keep getting unauthorized

Hello Michael,

Have you imported a database update service into your project?

Could you please clarify what you have tried and what exactly does not work?

Michael Ochakovsky
Posts: 0
Joined: Thu Oct 17, 2019 2:56 am

Updating Users, keep getting unauthorized

Not much Serhii. my knowledge of js is very limited at this time.

I have an app with the default 'Users' collection, where I store each username, password, and a pointer column pointing to: 'to_userdata'

Here is my goal:

  1. When a user login to the app I want to retrieve and store the login user's pointer id.and store this value into a LSV.

  2. I'd then use this pointer id in my code to perform different collection/database operations (read, update, delete...)

    is this something you have experience on? I looked all over your API docs and there is no sample code explaining how this is done., There are many random fragmentd mention of such procedures, but nothing concrete I can use or use as reference for my code. Can you help? or perhaps someone in your team can share some code with me.

    any starter sample code would be a great help for me.

    Thanks Serhii

    Mike

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Updating Users, keep getting unauthorized

Hello Michael,

Let's continue the discussion in the ticket #38430

Return to “Issues”