Create a page

post

/v1/portal/pages

Creates a page and returns information about the newly created page. Note: After a new page is created, this page has to be inserted into the NavigationNode as a childNode, then only the page will be visible in the Portal

To do this follow these steps:

  • Query the portal to get the navigationnodes id. Use the REST API, Retrieve Portal Details by Short ID. In the response obtained search for navigationnodes URL, the URL will be something like : "http://host:port/rest/api/v1/portal/navigationnodes/AjY?utoken=". Here Ajy is the navigationNodeId. Note down this id.
  • Next, insert the navigationNode as the childNode using the REST API Add Child Node To The Navigation Node here id is the navigationNodeId, which we noted down in the earlier step.

Request

Supported Media Types
Body ()
Content of required attributes of the page to be created.
Root Schema : page
Type: object
Show Source
Nested Schema : linkStates
Type: array
Show Source
Nested Schema : Locale
Type: object
Show Source
Nested Schema : Linked
Type: object
Show Source
Nested Schema : LinkElementState
Type: object
Show Source
Nested Schema : pathLinkValues
Type: array
Show Source
Nested Schema : pathLinkWildcards
Type: array
Show Source
Nested Schema : reflect.Method
Type: object
Show Source
Nested Schema : annotatedExceptionTypes
Type: array
Show Source
Nested Schema : annotatedParameterTypes
Type: array
Show Source
Nested Schema : reflect.AnnotatedType
Type: object
Show Source
Nested Schema : genericExceptionTypes
Type: array
Show Source
Nested Schema : genericParameterTypes
Type: array
Show Source
Nested Schema : reflect.Type
Type: object
Show Source
Nested Schema : parameters
Type: array
Show Source
Nested Schema : typeParameters
Type: array
Show Source
Nested Schema : reflect.Parameter
Type: object
Show Source
Nested Schema : reflect.Executable
Type: object
Show Source
Nested Schema : annotatedExceptionTypes
Type: array
Show Source
Nested Schema : annotatedParameterTypes
Type: array
Show Source
Nested Schema : genericExceptionTypes
Type: array
Show Source
Nested Schema : genericParameterTypes
Type: array
Show Source
Nested Schema : parameters
Type: array
Show Source
Nested Schema : typeParameters
Type: array
Show Source
Nested Schema : reflect.TypeVariable
Type: object
Show Source
Nested Schema : annotatedBounds
Type: array
Show Source
Nested Schema : bounds
Type: array
Show Source
Nested Schema : unicodeLocaleAttributes
Type: array
Show Source
Nested Schema : unicodeLocaleKeys
Type: array
Show Source
Nested Schema : linkStates
Type: array
Show Source
Back to Top

Response

Supported Media Types

400 Response

Bad request: ill-formatted content in request

403 Response

Invalid utoken supplied
Back to Top

Examples

You can create a portal page using REST API. It is a 3 step process. First we have to create a page, then obtain the navigation node Id of the portal, and then add the Page as a childNode to this Navigation Node.

First Step: To create a portal page submit a POST request on the REST resource and you must specify the following required parameters in the request body:

Use the following format to submit a POST request using cURL:

curl -i -X POST -H 'Content-Type: application/json' -d @create-page.json http://host:port/rest/api/v1/portal/portals/{shortId}/pages?utoken=
  • create-page.json is the JSON file containing the request body for the request.

  • hostname:port is the name of the host and the IP port where Oracle WebCenter Portal is running. For example, example.com:8888.

  • utoken is the API token for accessing the portal APIs. For example, utoken=utoken=abcdIC05zgjZoqCF8ShWL42AhTVvq-fc8uFshnw%2A%2A. For more information, see Authentication.

Example of a Request Body

The following is the sample of the create-page.json file containing the body for the request and shows how to create a page using the Blank pageStyle:

{
               "name": "RestPage",
               "reference": {
               "name": "Blank",
               "namespace": "pageStyle"
  },
               "description": "A Simple Json Page"
      },

HTTP Status Code

HTTP_STATUS = 201 Created

Example of Response Body

{
	    "resourceType": "urn:oracle:webcenter:portal:page",
    "pageStyleBean": {
        "links": [
            {
                "href": "http://hostname:port/rest/api/v1/portal/pages/Eeg/pageStyle?utoken=IPrUJFYBs44bC7kRXuWBmcVx_g21KtAEu7Hmkun0sA9O_w%2A%2A",
                "rel": "alternate",
                "resourceType": "urn:oracle:webcenter:portal:pagestyle",
                "capabilities": "urn:oracle:webcenter:read urn:oracle:webcenter:delete"
            },
            {
                "href": "http://hostname:port/rest/api/v1/portal/pagestyles/FQ?utoken=IPrUJFYBs44bC7kRXuWBmcVx_g21KtAEu7Hmkun0sA9O_w%2A%2A",
                "rel": "self",
                "resourceType": "urn:oracle:webcenter:portal:pagestyle",
                "capabilities": "urn:oracle:webcenter:read urn:oracle:webcenter:delete urn:oracle:webcenter:update"
            }
        ],
        "resourceType": "urn:oracle:webcenter:portal:pagestyle",
        "portalName": "DefaultGroupSpace",
        "namespace": "pageStyle",
        "name": "Blank"
    },
    "overridePolicy": false,
    "publishedVersion": 0,
    "permissionClass": "oracle.webcenter.security.auth.NavigationResourcePermission",
    "locked": false,
    "pageStyle": "/oracle/webcenter/siteresources/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/pageStyle/gsr1b60e8a7_2e23_48ff_9571_31ede592de01/TemplateBlank.jspx",
    "fileName": "Page721a8c93_76a8_4f83_951d_7692acabfc8c.jspx",
    "pageDefinitionPath": "/pageDefs/oracle/webcenter/page/scopedMD/sda24fbda_d8cf_4013_b696_df9cce7589aa/Page721a8c93_76a8_4f83_951d_7692acabfc8cPageDef.xml",
    "pageViewType": "JSPX",
    "sourcePath": "/oracle/webcenter/siteresources/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/pageStyle/gsr1b60e8a7_2e23_48ff_9571_31ede592de01/TemplateBlank.jspx",
    "pagePath": "/oracle/webcenter/page/scopedMD/sda24fbda_d8cf_4013_b696_df9cce7589aa/Page721a8c93_76a8_4f83_951d_7692acabfc8c.jspx",
    "description": "Vertically stacked content in a single column",
    "creator": "weblogic",
    "modifier": "weblogic",
    "securityId": "serviceID=oracle.webcenter.page,scopeID=sda24fbda_d8cf_4013_b696_df9cce7589aa,resourceID=sda24fbda_d8cf_4013_b696_df9cce7589aa",
    "shortId": "Eeg",
    "modified": "2021-01-11T10:53:20.427Z",
    "created": "2021-01-11T10:53:20.182Z",
    "namespace": "pageStyle",
    "currentVersionId": "4ddf1a55-a08c-4857-933f-a9970e4af71f",
    "locale": "en_US",
    "id": "721a8c93-76a8-4f83-951d-7692acabfc8c",
    "name": "RestPage"
	  }

Second Step: To obtain the navigation node Id of the portal, run the cURL command to get details of the portal. In the response, search for navigationRootNode. Get the id of the navigationnodes, the id is in the URL. In the response, the shortId for NavigationNode is AjY in the response shown below.

Use the following format to submit a GET request using cURL:

curl -i -X GET  http://host:port/rest/api/v1/portal/portals/{shortId}?utoken= -H 'Content-Type: application/json'
Example of Response Body
{
	 "navigationRootNode": {
        "links": [
            {
                "href": "http://host:port/rest/api/v1/portal/portals/AjQ/navigationRootNode?utoken=",
                "rel": "alternate",
                "resourceType": "urn:oracle:webcenter:portal:navigationnode",
                "capabilities": "urn:oracle:webcenter:read urn:oracle:webcenter:delete"
            },
            {
                "href": "http://host:port/rest/api/v1/portal/navigationnodes/AjY?utoken=",
                "rel": "self",
                "resourceType": "urn:oracle:webcenter:portal:navigationnode",
                "capabilities": "urn:oracle:webcenter:read urn:oracle:webcenter:delete urn:oracle:webcenter:update"
            }
        ],
        "resourceType": "urn:oracle:webcenter:portal:navigationnode",
        "portalName": "RestPortal1",
        "namespace": "",
        "name": "root"
    }
	  }

Third Step: Add the newly created Page to the Navigation Node. In the cURL command, insertNavigationNode.json is the JSON file containing the request body for the request. hostname:port is the name of the host and the IP port where Oracle WebCenter Portal is running. For example, example.com:8888. utoken is the API token for accessing the portal APIs. For example, utoken=utoken=abcdIC05zgjZoqCF8ShWL42AhTVvq-fc8uFshnw%2A%2A.

Use the following format to submit a POST request using cURL:

curl -i -X POST -H 'Content-Type: application/json'-d @insertNavigationNode.json http://host:portal/rest/api/v1/portal/navigationnodes/{navigation-node-shortId}/childNodes?utoken=
Example of Request Body
{
              "name": "RestPage",
              "namespace": "pageStyle",
              "portalName": "RestPortal"
      },
Example of Response Body
{
     "resourceType": "urn:oracle:webcenter:portal:page",
    "pageStyle": "/oracle/webcenter/siteresources/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/pageStyle/gsr1b60e8a7_2e23_48ff_9571_31ede592de01/TemplateBlank.jspx",
    "overridePolicy": false,
    "permissionClass": "oracle.webcenter.security.auth.NavigationResourcePermission",
    "locked": false,
    "fileName": "Page662d449a_b506_42a5_83a9_ef59eb87d27b.jspx",
    "publishedVersion": 0,
    "pageStyleBean": {
        "links": [
            {
                "href": "http://slc14url.us.oracle.com:8888/rest/api/v1/portal/pages/Eeg/pageStyle?utoken=IEM4UE4n8YG6ZA8fay8b18oTSMmgI8qC7cKAy6vzPqfz_w%2A%2A",
                "rel": "alternate",
                "resourceType": "urn:oracle:webcenter:portal:pagestyle",
                "capabilities": "urn:oracle:webcenter:read urn:oracle:webcenter:delete"
            },
            {
                "href": "http://slc14url.us.oracle.com:8888/rest/api/v1/portal/pagestyles/FQ?utoken=IEM4UE4n8YG6ZA8fay8b18oTSMmgI8qC7cKAy6vzPqfz_w%2A%2A",
                "rel": "self",
                "resourceType": "urn:oracle:webcenter:portal:pagestyle",
                "capabilities": "urn:oracle:webcenter:read urn:oracle:webcenter:delete urn:oracle:webcenter:update"
            }
        ],
        "resourceType": "urn:oracle:webcenter:portal:pagestyle",
        "namespace": "pageStyle",
        "portalName": "DefaultGroupSpace",
        "name": "Blank"
    },
    "pageDefinitionPath": "/pageDefs/oracle/webcenter/page/scopedMD/s7edf2c3d_f10c_4db4_a961_297ca6c2f806/Page662d449a_b506_42a5_83a9_ef59eb87d27bPageDef.xml",
    "sourcePath": "/oracle/webcenter/siteresources/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/pageStyle/gsr1b60e8a7_2e23_48ff_9571_31ede592de01/TemplateBlank.jspx",
    "pagePath": "/oracle/webcenter/page/scopedMD/s7edf2c3d_f10c_4db4_a961_297ca6c2f806/Page662d449a_b506_42a5_83a9_ef59eb87d27b.jspx",
    "pageViewType": "JSPX",
    "description": "Vertically stacked content in a single column",
    "created": "2021-01-13T08:29:18.195Z",
    "namespace": "pageStyle",
    "modifier": "weblogic",
    "creator": "weblogic",
    "currentVersionId": "67b0193d-5d2b-45d3-aedb-658330a17775",
    "modified": "2021-01-13T08:29:18.295Z",
    "securityId": "serviceID=oracle.webcenter.page,scopeID=s7edf2c3d_f10c_4db4_a961_297ca6c2f806,resourceID=s7edf2c3d_f10c_4db4_a961_297ca6c2f806",
    "name": "RestPage4",
    "id": "662d449a-b506-42a5-83a9-ef59eb87d27b",
    "locale": "en_US",
    "shortId": "Eeg"
	  }    }
  ]
}
Back to Top