7.2 Enabling REST Objects

Enable REST objects using the AutoREST feature of ORDS.

Tip:

While the AutoREST feature of ORDS is the most straight forward way to create RESTful Services based on database objects, it does have some drawbacks and limitations. To learn more about AutoREST, see Automatic Enabling of Schema Objects for REST Access (AutoREST) in the Oracle REST Data Services Developer's Guide

Required

To perform this procedure, your enviroment must meet the following requirements:

  • Your schema must be registered in ORDS.

    To register your schema, see Registering Schema with ORDS.

  • The REST objects you wish to enable must exist and comply with AutoREST.

To REST Enable an object:

  1. On the Workspace home page, click SQL Workshop and then RESTful Services.
    The RESTful Services home page appears.
  2. Click Enabled Objects in the RESTful Data Services tree.
  3. Click Create AutoREST Object.
  4. In the AutoREST Enable Object dialog:
    1. Object Type - Select the type of database object you wish to AutoREST enable.
    2. Object - Select the object you wish to AutoREST enable.
    3. Object Alias - Enter the alias to be used for the selected object. This alias replaces the object name in the AutoREST URL. The default is the object name. For security reasons, it is always good practice to provide an alias that is different to the underlying object name.
    4. Authorization Required - Indicates whether external users trying to access the AutoREST enabled object are required to be assigned the related role.

      If Authorization Required is set to Yes, Authorization Role displays the role name. If you enable authorization for the object, you can use the resulting Authorization Role information to configure user roles in ORDS.

      Note:

      Disabling the Authorization Required setting renders the object publicly accessible. Enabling this setting requires further configuration of user roles to grant access to users.
    5. Full URL - Displays the full URL. To copy the URL, click Copy to Clipboard.
    6. Click Create.

Optional

Once the object is REST Enabled, you can access the data through the supplied URI. The URI is formatted in JSON.

  1. To view the plain text contents of the RESTful URI using a browser:
    1. Click Enabled Objects in the RESTful Data Services tree.
    2. Under Parsing Object, click the object name.
    3. Copy the RESTful URI.

      Tip:

      You can click the Copy to Clipboard icon (Copy to Clipboard) to quickly copy the RESTful URI.
    4. Open a new browser tab, paste the copied URI into the URL field, and press Enter.

    The browser displays a JSON document exposing the table data for the table you selected.