So I know that an API is basically something that passes data to applications such as a person's username.
But I was wondering whether API is used to create UI and up to what extent?
So let's say my mobile application needs a login screen. When the application loads should the application send a GET request which then gives them a JSON answer of what inputs it needs for the POST request (eg: Username, Password, Agree to terms checkbox)
Sorry if my question is low quality. I'm just beginning to learn about API's
APIs may be used for everything.
It's better to say that APIs' responses are used to fill prerendered UIs with required data.
So, you create table with undefined number of fields and require JSON structure from remote API like:
{[{"username": "string", "opts": []}, {"password": "string", "opts": ["hidden"]}]}
,
where hidden stands for hiding letters during input.
I have had some experience with that case, but the number and specification of input fields are usually known on the client side.
Your method is useful for GUI database clients and administration tools.