GET API Questions

Help please, I am a little lost. Some of these questions may seem random, but I am trying to fill some gaps in my understanding…

I am using Backendless (and the ‘Users’ database)…previously set up the ‘Registration’ and ‘Log In’ API and that works fine.
I have now added fields to ‘Users’ in Backendless, and am trying to create a ‘Profile’ page where users can add profile details such as country, age, etc (when they register, all that is required is email and password).
I figure the page would work as follows: on page focus (or mounted?) it would pull values for country, age, etc from Backendless using ‘Get Record’. The fields will be amended manually, and an ‘Update Record’ would send the changes to Backendless. Both of these would use the same API.
Is this logic/plan OK?

My setup is as follows for the GET;
image

image

It just doesn’t seem to pull anything through. I have tried setting page variables after the GET record and then setting that page variable to the component. And I have bound the component to the data Variable…
A few related question around troubleshooting this;
Should I have this against ‘Page Focused’ or Page Mounted’?
For response key path – if I populate that field, that simply limits what the ‘Get’ pulls back to the one field, is that correct? Likewise, if I was to go into the schema and delete the fields that I don’t need, would the Get still work for the remaining fields? Or does the schema have to match the table exactly, i.e. contain all the fields? I thought perhaps the Get was failing because the schema, for some of the unneeded fields, does not match around data type……so I was just going to delete everything I don’t need and see what happens…
Finally, is there a way to test APIs as to why they are failing. Someway to generate an error message or in the debugger. Some help on that would be amazing.

Thanks
Paul

Hi,

Yes the plan sounds alright, if you want to know more about REST APIs and Composer please see our Core Lessons about it :slight_smile:

The difference between mounted and focused is that mounted is triggered when the page is opened for the first time during the app use, and focused is used all other times. In the case of GET calls, I would use Data variables instead of setting them to page focused / mounted. The core lessons cover this.

For debugging you can check your browser’s developer console by Command+Option+J or Control+Shift+J or use the debugger