Creating Web Services

RAW entities - views, materialized views, packages and tables - are available as REST services.

This means that to create a "Web Service" in RAW, all you need to do is, for instance, define a view.

If we define a view such as:

This view can be queried in the endpoint:

https://<SERVER ADDRESS>/query-view/view_as_webservice

The HTTP request needs the uthorization token to be passed in the header: Authorization: Bearer <TOKEN>.

In addition, to obtain output in a specific format, the optional header X-RAW-output-format can be passed, e.g.: X-RAW-output-format: json.

In the case of packages, parameters can also be passed. That's because packages can contain function declarations that take parameters.

Let's assume a package is defined as:

This package exposes two web services, corresponding to the methods airports_by_country and airports_in_city.

For instance, airports_in_city can be queried in the endpoint:

https://<SERVER ADDRESS>/query-package/package_as_webservice/airports_in_city?city=Lisbon

Next: Managing Credentials