Create Site from Site

post

/documents/api/1.2/sites/{siteId}/site

Create a site from another site.

Request

Supported Media Types
Path Parameters
Body ()

This parameter includes information such as the name parameter, which is the name of the site. Other parameters supported are description and copyUpdates.

Root Schema : SitesCreateBody
Type: object
The request body defines details of the site to be created.
Show Source
  • Flag indicating whether updates from the source site should be copied (1) or not (0) to the new site.
  • Maximum Length: 2000
    Description of the site to be created.
  • Maximum Length: 250

    Name of the site to be created.

    The following restrictions apply to site names:

    • Site name can't start or end with spaces.
    • The length of the name can't exceed 250 characters.
    • Site name isn't case-sensitive; that is, My Site and MY SITE are considered identical.

    Don't use the following characters:

     / \ < > * "
     ? : . .. |

    The following strings are also not allowed in site names:

    • documents
    • sites
    • authsite
    • mobileauthsite
    • _sitescloud
    • _sitesclouddelivery
    • _comps
    • _components
    • _compdelivery
    • _idcservice
    • scstemplate_*
    • CON
    • PRN
    • AUX
    • CLOCK$
    • NUL
    • NULL
    • COM0
    • COM1
    • COM2
    • COM3
    • COM4
    • COM5
    • COM6
    • COM7
    • COM8
    • COM9
    • LPT0
    • LPT1
    • LPT2
    • LPT3
    • LPT4
    • LPT5
    • LPT6
    • LPT7
    • LPT8
    • LPT9
    • .DS_STORE
    • Users
    • _shortcuts
    • REALITEMS
    • Personal Libraries
    • Shared By Me
    • Shared With Me
    • Favorites
    • Trash

Example Request (application/json)
{
    "name":"Site Sample from Another Site",
    "description":"Site created from an existing site",
    "copyUpdates":"1"
}
Back to Top

Response

Supported Media Types

201 Response

The request was fulfilled.

Body ()
Root Schema : SiteCreateResponse
Type: object

The response includes details on the created site.

Show Source
Nested Schema : User
Type: object
User information
Show Source
Example Response (application/json)
{
    "createdBy":{
        "id":"U0EAA20910FAF3052ACB79E4T00000000001",
        "displayName":"User AA",
        "loginName":"UserAA",
        "type":"user"
    },
    "createdTime":"2017-06-12T21:19:30Z",
    "description":"Site created from an existing site",
    "errorCode":"0",
    "id":"F4FAEFCE084DD434A61B7CA9B5D17B95F47087F4E518",
    "modifiedBy":{
        "id":"U0EAA20910FAF3052ACB79E4T00000000001",
        "displayName":"User AA",
        "loginName":"UserAA",
        "type":"user"
    },
    "modifiedTime":"2017-06-12T21:19:30Z",
    "name":"Site Sample from Another Site",
    "ownedBy":{
        "id":"docadmin",
        "displayName":"Oracle Documents Administrator",
        "loginName":"docadmin",
        "type":"user"
    },
    "pseudoOwnedBy":{
        "id":"U0EAA20910FAF3052ACB79E4T00000000001",
        "displayName":"User AA",
        "loginName":"UserAA",
        "type":"user"
    },
    "type":"site"
}

400 Response

Request parameters are not formatted correctly.

403 Response

User has insufficient privilege to access Site ID.

404 Response

Site ID is not found.

409 Response

Site name already exists.

Back to Top

Examples

The following example creates a new site from an existing site.

POST .../sites/F4DA4BC72B3CA38C532E3A0AB5D17B95F47087F4E518/site

Request Header

None.

Request Body

{
	"name":"Site Sample from another Site",
	"description":"Site created from an existing site",
	"copyUpdates":"1"
}

HTTP Status Code

HTTP_STATUS = 201

JSON Response

{
  "createdBy": {
    "displayName": "User AA",
    "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
    "loginName": "userAALoginName",
    "type": "user"
  },
  "createdTime": "2017-06-12T21:19:30Z",
  "description": "Site created from an existing site",
  "errorCode": "0",
  "id": "F4FAEFCE084DD434A61B7CA9B5D17B95F47087F4E518",
  "modifiedBy": {
    "displayName": "User AA",
    "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
    "loginName": "userAALoginName",
    "type": "user"
  },
  "modifiedTime": "2017-06-12T21:19:30Z",
  "name": "Site Sample from another Site",
  "ownedBy": {
    "displayName": "Oracle Documents Administrator",
    "id": "docadmin",
    "loginName": "docadmin",
    "type": "user"
  },
  "pseudoOwnedBy": {
    "displayName": "User AA",
    "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
    "loginName": "userAALoginName",
    "type": "user"
  },
  "type": "site"
}

Example 2

The following example attempts to create a new site using an existing name.

POST .../sites/F4DA4BC72B3CA38C532E3A0AB5D17B95F47087F4E518/site

Request Header

None.

Request Body

{
	"name":"Site Name Already Exists",
	"description":"Trying to create new site using existing name",
	"copyUpdates":"1"
}

HTTP Status Code

HTTP_STATUS = 409

JSON Response

{
    "errorCode": "-17",
    "errorKey": "!csFldUnableToCopyItems!csFldPathAlreadyExists,Site Name Already Exists,F:SCS:SITES",
    "errorMessage": "Unable to copy items. An item with name 'Site Name Already Exists' already exists at 'F:SCS:SITES'.",
    "errorType": "site",
    "title": "Unable to copy items. An item with name 'Site Name Already Exists' already exists at 'F:SCS:SITES'.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}

Example 3

The following example attempts to create a new site using an invalid template ID.

POST .../sites/F4DA4BC72B3CA38C532E3A0AB5D17B95F47087F4E518aaaa/site

Request Header

None.

Request Body

{
	"name":"Site From Invalid Site",
	"description":"This source site does not exist",
	"copyUpdates":"1"
}

HTTP Status Code

HTTP_STATUS = 404

JSON Response

{
    "copyUpdates": "1",
    "description": "This source site does not exist",
    "errorCode": "-16",
    "errorKey": "!csSecurityValidationFailed!csFldDoesNotExist,FE0B7B1244D622F109A900E1B5D17B95F47087F4E518aaa!csUnprivilegedSystemError",
    "errorMessage": "Security validation failed. 'FE0B7B1244D622F109A900E1B5D17B95F47087F4E518aaa' does not exist. The error was caused by an internally generated issue. The error has been logged.",
    "errorType": "site",
    "idList": "FE0B7B1244D622F109A900E1B5D17B95F47087F4E518aaa",
    "name": "Site From Invalid Site",
    "title": "Security validation failed. 'FE0B7B1244D622F109A900E1B5D17B95F47087F4E518aaa' does not exist. The error was caused by an internally generated issue. The error has been logged.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Back to Top