In order to expose a Data Provider object as REST Web Services, you only need to configure the following Data Provider properties:
They are REST services for reading data only (must be called through HTTP GETmethod).
Note that the specification document of this service can be generated automatically. See Documenting RESTFul services.
The endpoint URI for Data Providers is
<server uri>/rest/<dp name>
If the Data Provider belongs to a Module, the endpoint URI is <server uri>/rest/<module>/<dp name>.
For example, if the module is "module2" under "module1", the URL would be:
<server uri>/rest/module2/module1/<dp name>.
The parameters should be passed in the query string (in the URL), separated by &:
<server uri>/rest/<module>/<dp name>?param1=value1¶m2=value2&...¶mN=valueN
Notes:
- When the Data Provider output is a Business Component and its Collection property = True, the JSON response has these fields:
[{<Primary Key>,<Description Att>, <URI>}]
Where:
<URI>
Is the REST URI to get the rest of the record's attributes.
- With respect to consuming a Rest service (it can be generated by GeneXus or not), GeneXus provides the OpenAPI import tool.
HowTo: Consume a Rest Data Provider