API for amending User Details

Hello

This is more of a conceptual question…with the answer I may be able to figure out what am doing wrong here…

Working with Appgver and have previously set up ‘User Registration’ and ‘Log in’ using the below guide, and all good with that. I am now creating a profile page where users can add details (age, country…) in addition to the login (email) and password required at registration.

I noticed the third part of the document ‘Save Data In Backendless’ uses a table called ‘Person’. I thought I would rather add fields to ‘Users’ and have the additional details stored there…and adding such fields was mentioned in some Backendless docs I read, so I assumed this was OK. But having not been able to get my API working to pull data from ‘Users’ to populate the profile page, I just wanted to check? Should I be keeping the password and login values stored in ‘Users’ separate from the additional info, i.e. it should go into something like ‘Person’ and not an expanded ‘User’?
Another slightly confusing bit is that in the documentation about setting up the ‘Save Object’ API (for use with the ‘Person’ table), it states “in the CONFIG tab, as during registration, we specify the Response key path objectId”. But in registration, it actually says to use email.
I am also struggling to see how ‘Person’ and ‘Users’ are linked, which is why I went with updating ‘Users’ with additional fields and updating using user-token and ownerId, but it may have something to do with the above…is it the objectId that links them?

Why my API is not working I am going to query on the appgyver forum, but just wanted to check my method beforehand…

Thanks
Paul

Are you looking for help?

This is a support forum for reporting issues related to Backendless services. Please note that due to our support policy we cannot provide you help with debugging your code, consulting in regards to any language or third-party library usage. For this kind of questions we recommend using more appropriate forums like Stack Overflow.

In order to suggest you a quality solution, we shall usually ask you to provide the details mentioned below first. Including them into your topic right away helps us to start investigating your issue much faster.

In case you have a suggestion or an idea, the details below are not always required, though still any additional background is welcome.

Backendless Version (3.x / 5.x, Online / Managed / Pro )

Client SDK (REST / Android / Objective-C / Swift / JS )

Application ID

Expected Behavior

Please describe the expected behavior of the issue, starting from the first action.

Actual Behavior

Please provide a description of what actually happens, working from the same starting point.

Be descriptive: “it doesn’t work” does not describe what the behavior actually is – instead, say “the request returns a 400 error with message XXX”. Copy and paste your logs, and include any URLs.

Reproducible Test Case

Please provide a simple code that could be run in a new clean app and reproduce the issue.

If the issue is more complex or requires configuration, please provide a link to a project on Github that reproduces the issue.

Could you be more precise, please.

In a way f.e.:

  1. This is the table structure (description of fields) / link to your Backendless app;
  2. This is my request in a form of code or curl(http);
  3. This is the result.

Such information decrease the time of investigation drastically.

Hey Oleg

I don’t have any of that as I am not asking about a particular problem…it is more around strategy.
Should I be amending the ‘User’ table under ‘SYSTEM DATA’ , i.e. adding in additional fields for user details, or is it preferable not to do that and isolate any additional fields/details in a table under ‘APP TABLES’. The procedure I followed did the latter but at face value, I would prefer to do the former.

Thanks
Paul

Hello @Paul_McCullen

You can add additional fields to the Users Table. Adding fields to this table is a normal strategy, it can be applied, it all depends on the tasks that you want to solve.

The Users table differs from the other tables you create, here are some of them (this is not the whole list):

  • user registration goes through the Users table
  • the value of the special password field is hidden
  • user authorization goes through the Users table
  • the section User Service API refers to the Users table.

Thanks Vladimir
I have amended my ‘Users’ table and have it working fine. It seems my problem was that I was constructing GET and PUT API, and the Backendless docs mention having to include the user-token in the HTTP header for PUT…and I mistakenly read it as being required for GET also.
BUT once I took it out…for both…I soon got both the GET and PUT working.
Have I misunderstood that requirement for the user-taken for PUT…mine is definitely updating the ‘Users’ table without it? Am using Appgyver as the front end.

Thanks
Paul