We will use fake online REST API JSONPlaceholder for this and following chapters.
To create new REST Service go to REST Clients page (under Data Sources) and click on button.
Make following configurations and click save. Then reload cache.
Now, let's add a method to JSONPlaceholder. Go to Methods of JSONPlaceholder and click on button.
We will add users method of https://jsonplaceholder.typicode.com/ and reload cache.
We can test the method by clicking on button.
It will open Backend Function page with the method's code. Click on button on top right corner.
You can see response for the request in the console.
We can show response data in a grid. To show the data in a grid we need to create a query first. So, let's go ahead and convert our users method to query.
Select users method and click on button to generate its parameters.
Now that we have method parameters as well, right click on users method and select
Convert -> Service Method -> Query.
There will be a lot of automatically generated fields in SELECT section. So, we trimmed down to 4 to keep it simple. Leave other properties as they are and click save. Then, go to Query fields of
wsqry_JSONPlaceholder.users and click on button to generate its fields.
Now, convert our web service query to grid. Right click on it and select
Convert -> Query -> Grid.
Select name as Query PK Field, set its label as Users and give default width and height values. Leave other properties as default and click save. After creating the grid, insert its columns from query fields.
Create a new page (automatically add it to menu as well) and add
grd_1 as its page object. Open preview of the page and you can see response data in grid.