Rookie question here: I’m looking to pass details about a user from the frontend (appgyver), details such as Date of Birth, gender, which club they play for and which team they play for. These will save into the user’s table.
I’ve setup the API (screenshots below) but I’m getting a 3057 error that ‘could not find user by id or identity’.
Thanks for this guide Mark. I’d gone through it before, but my challenge was the user-id in the URL. How do i dynamically create this for the API call?
I’ve run the test successfully now but I used the ownerid of my test user.
So my understanding is that this API call will work for this 1 user, but how do I make it work for all the users that will sign up for the app. i.e. is there a way to dynamically complete it in the URL?
It sounds like a great question for the AppGyver team. I believe the dynamic value for the user id needs to be configured somewhere in their interface, right?
Did you ever get this working? I think you need to set the id as a URL Placeholder which in turn you can ‘populate’ using a page or app variable in appgyver…that will make it dynamic. I used this method to pull through (with a GET RECORD) the contents of my Users table.
But I am stuck getting my PUT to work, which will send updated values back to the ‘Users’ table after being edited by the user…was hoping you could show me your working setup!
Thanks
Paul
Add the Update User button and call the UpdateUser API using the Data Get Record block. Configure it with necessary values. Bind objectId with userObjectId Page Variable and record properties with the userName Page Variable:
I think I had two problems;
I had not populated request schema, I was populating all the fields in the ‘Custom Object’ under ‘Record Properties’ to test which were coming through as a default, presumably from the schema for my GET…Perhaps this was actually OK, but actually doing it your way enables me to cherry-pick the fields I want to update…
BUT my big problem was that I had the user-token in my header…and removing that seems to make it work. This is perplexing because the Backendless documentation states that you need the user-token in the header to update ‘Users’. But clearly not!
One little question just for my understanding - what is the difference between ownerId and objectId? I can see in my table the fields are populated with the same value, just wondering if that is ever not the case?
Thanks so much for your help. Sometimes I just need a hint after I think I have tried everything…I have been relying on Appgyvers nifty ‘get schema from response’ functionality so I haven’t had to think to much about that SCHEMA section in the API but I now know I need to populate the request section when POST or PUT…and presumably DELETE…thats the crucial bit I was missing right?
[LAYER 5] Owner Policy.
When a new object is created in Backendless, the system automatically links it with the account of the user that made the call to save the object. You can see that information in the 'ownerId' column in any of your tables in the data browser. With the association between objects and users (owners), Backendless provides a way to control whether users can get access to the data they created. This is done through a concept we call ‘Owner Policy’. To navigate to Owner Policy, select a table in the data browser and click the PERMISSIONS menu. Click the OWNER POLICY menu item.
Granting a permission for an operation in Owner Policy, guarantees that the objects owned by the current user will be allowed access for the specified operations. Denying a permission, takes out the ‘owned’ objects from the collection of candidate objects to return.
The objectId column is just a unique record identifier.