DataProviders as Rest web services in GeneXus

Official Content

The Data Provider object can be exposed as REST Web Services. You only need to do the following configuration at the Data Provider properties:

Dp rest

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>.

How are the parameters passed to the Data Provider?

The parameters should be passed in the query string (in the URL), separated by &:

<server uri>/rest/<module>/<dp name>?param1=value1&param2=value2&...&paramN=valueN


When the Data Provider output is a Business Component and 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.

Go on reading: HowTo: Consuming a Rest Data Provider



With respect to consuming a Rest service (it can be generated by GeneXus or not), GeneXus provides the OpenAPI import tool.



Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.