Previous Next

Quick Start

Set up your environment for the Oracle WebCenter Sites Aggregate REST API.

Prerequisite

WebCenter Sites must be installed and running.

cURL Installation

The examples within this document use the cURL command-line tool to demonstrate how to access the WebCenter Sites Aggregate REST API. For more information about Using cURL, see cURL Access.

The following procedure demonstrates how to install cURL on a Windows 64-bit system.
  1. In your browser, navigate to the cURL home page at http://curl.haxx.se, and click Download in the left navigation menu.

  2. On the cURL Releases and Downloads page, locate the SSL-enabled version of the cURL software that corresponds to your operating system, click the link to download the ZIP file, and install the software.

  3. Navigate to the cURL CA Certs page at http://curl.haxx.se/docs/caextract.html, and download the ca-bundle.crt SSL CA certificate bundle in the folder where you installed cURL.

  4. Open a command window, navigate to the directory where you installed cURL, and set the cURL environment variable, CURL_CA_BUNDLE, to the location of an SSL certificate authority (CA) certificate bundle. For example:

    C:\curl> set CURL_CA_BUNDLE=ca-bundle.crt

You are now ready to use cURL to send requests to the WebCenter Sites Aggregate REST API.

Make Your First Request

This procedure walks you through basic REST services provided by the WebCenter Sites Aggregate REST API. The steps also help you make REST calls to these services. The avisports sample site is for demonstration purposes.

  1. Asset Resource

    You can get any asset data along with its dependent assets in WebCenter Sites by making a REST call to this resource.

    1. Execute this cURL command:
      curl -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/AVIArticle/1328196047241"

      You have now made a successful REST call to get data on the AVIArticle asset with the ID 1328196047241 along with its dependent assets.

    2. Execute this cURL command:

      curl -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/AVIArticle/1328196047241?assetDepth=0"

      You have now made a successful REST call to get data on the AVIArticle asset with the ID 1328196047241 without getting its dependent assets.

    For a complete understanding of this resource, see "Read an asset by ID, type, and site along with its dependent assets in an aggregated format" under "Asset Resources."

  2. Navigation Resource

    You can get any navigation data for a site in WebCenter Sites by making a REST call to this resource.

    1. Execute this cURL command:

      curl -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/navigation"

      You have now made a successful REST call to GET avisports site navigation data (all pages under this site in a hierarchical way).

    2. Execute this cURL command:

      curl -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/navigation?navigationDepth=1"

      You have now made a successful REST call to get avisports site navigation data, but only immediate pages under this site.

      For complete understanding of this resource, see "Navigation Resources."

  3. Collection Asset Resource

    You can get any collection asset data along with its results in a given site in WebCenter Sites by making a REST call to this resource.

    1. Execute this cURL command:

      curl -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ContentQuery/1395380847207/items"

      You have now made a successful REST call to get the results of a ContentQuery asset with the ID 1395380847207 in the avisports site.

    2. Execute this cURL command:

      curl -H "Accept: application/json" -X GET "http://cnkumar-lap:8080/cs/REST/resources/v1/aggregates/avisports/ContentQuery/1395380847207/items?limit=2"

      You have now made a successful REST call to get only the first two results of a ContentQuery asset with the ID 1395380847207 in the avisports site.

      For a complete understanding of this resource, see "Collection Asset Resources."

  4. Recommendation Resource

    You can get any Recommendation asset data along with its recommended assets in a given site in WebCenter Sites by making a REST call to this resource.

    1. Execute this cURL command:

      curl -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/engage/recommendation/Running%20Recommendation/items"

      You have now made a successful REST call to get recommended assets of a Recommendation asset with the name Running Recommendation in the avisports site.

    2. Execute this cURL command:

      curl -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/engage/recommendation/Running%20Recommendation/items?limit=2"

      You have now made a successful REST call to get only the first two recommended assets of a Recommendation asset with the name Running Recommendation in the avisports site.

      For a complete understanding of this resource, see "Recommendation Resources."

  5. Search Resource

    You can search assets by making a REST call to this resource.

    1. Execute this cURL command:

      curl -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/search/sites/avisports/assets"

      You have now made a successful REST call to search all assets in the avisports site.

    2. Execute this cURL command:

      curl -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/search/sites/avisports/types/AVIArticle/assets"

      You have now made a successful REST call to search all assets of the AVIArticle asset type in the avisports site.

      For a complete understanding of this resource, see "Search Resources."