Using the Folder REST API

This document will explain what you can do with the folder REST API to help edit content within CM1. It will cover how to retrieve, create, and edit different items in CM1 such as Sites, Folders, Sections, and Links. All of these items are viewable in CM1 through the Finder. These items are used to build out the structure of a site in CM1 and allow you to organize and easily navigate through each site. Each REST call either returns or passes a JSON object representing the item in CM1. For the purpose of this document we will use the CM1 instance named myCM1 running on port 9992 as an example.

NOTE: When sending requests to the server they should all be of type application/json.

Get a Site:

Functionality:

This REST call will allow you to retrieve a site from your CM1 instance.

What you need to know:

  • The name of the site you want to retrieve

Use Case:

You need the information about the site object

How to execute:

Execute a GET request against the CM1 instance (http://myCM1:9992) with the name of the site (MySite)

Example:

GET http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite

Response:

The JSON Response may look like this on a fresh site with no content or structure built in:

 

{  

  "id":"16777215-101-7125",

  "name":"",

  "siteName":"MySite",

  "path":"",

  "workflow":"[default]",

  "accessLevel":"WRITE",

  "sectionInfo":{  

     "displayTitle":"Home",

     "targetWindow":"_self",

     "navClass":"",

     "templateName":"MyTemplate",

     "landingPage":{  

        "name":"index",

        "href":"http://myCM1:9992/Rhythmyx/rest/pages/by-path/MySite/index"

     }

  },

  "pages":[  

     {  

        "name":"index",

        "href":"http://myCM1:9992/Rhythmyx/rest/pages/by-path/MySite"

     }

  ],

  "subfolders":[  ],

  "subsections":[  ]

}

Get a Folder:

getFolder.PNG

Functionality:

This REST call will allow you to retrieve a folder from your CM1 instance.

What you need to know:

  • The name of the site you want to retrieve the folder from
  • The name of the folder you want to retrieve

Use Case:

You need the information about the folder object.

How to execute:

Execute a GET request against the CM1 instance (http://myCM1:9992) with the name of the site (MySite) and the name of the folder (MyFolder).

Example #1:

GET http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MyFolder

Response:

The JSON Response may look like this on an empty folder:

{  

  "id":"16777215-101-1809",

  "name":"MyFolder",

  "siteName":"MySite",

  "path":"",

  "workflow":"[default]",

  "accessLevel":"ADMIN",

  "pages":[ ],

  "subfolders":[ ]

}

Example #2:

GET http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MyFolder/SecondLevelFolder

Response:

The JSON Response may look like this on an empty folder:

{  

  "id":"16777215-101-1810",

  "name":"SecondLevelFolder",

  "siteName":"MySite",

  "path":"MyFolder",

  "workflow":"[default]",

  "accessLevel":"ADMIN",

  "pages":[  ],

  "subfolders":[  ]

}

Example #3:

GET http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MyFolder with a subfolder underneath MyFolder

Response:

The JSON Response may look like this on an empty folder:

{  

  "id":"16777215-101-1809",

  "name":"MyFolder",

  "siteName":"MySite",

  "path":"",

  "workflow":"[default]",

  "accessLevel":"ADMIN",

  "pages":[  

 

  ],

  "subfolders":[  

     {  

        "name":"SecondLevelFolder",             "href":"http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MyFolder/SecondLevelFolder"

     }

  ]

}

Get a Section:

MySection.png

Functionality:

This REST call will allow you to retrieve a section from your CM1 instance.

What you need to know:

  • The name of the site you want to retrieve the section from
  • The name of the section you want to retrieve
  • Optionally the path between the site and the section

Use Case:

You need the information about the section object.

How to execute:

Execute a GET request against the CM1 instance (http://myCM1:9992) with the name of the site (MySite), the name of the path to the section (PathSection), and the name of the section (MySection). If there is no Section between the MySite and MySection then there is no need to include PathSection.

Example:

GET http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/PathSection/MySection

Response:

The JSON Response may look like this on an empty section:

{  

  "id":"16777215-101-1814",

  "name":"MySection",

  "siteName":"MySite",

  "path":"PathSection",

  "workflow":"[default]",

  "accessLevel":"WRITE",

  "sectionInfo":{  

     "displayTitle":"MySection",

     "targetWindow":"_self",

     "navClass":"",

     "templateName":"MyTemplate",

     "landingPage":{  

        "name":"index",   "href":"http://myCM1:9992/Rhythmyx/rest/pages/by-path/MySite/PathSection/mysection/index"

     }

  },

  "pages":[  

     {  

        "name":"index",

  "href":"http://myCM1:9992/Rhythmyx/rest/pages/by-path/MySite/PathSection/MySection"

     }

  ],

  "subfolders":[  ],

  "subsections":[  ]

}

Update a Site:

MySite.PNG

Functionality:

This REST call will allow you to update an existing site in your CM1 instance and define its properties. It will pass a JSON object outlining the details of the site (see payload)

What you need to know:

  • The name of the site you want to create

Use Case:

You need to create a site object in CM1.

How to execute:

Execute a PUT request against the CM1 instance (http://myCM1:9992) using the site name (MySite) and the payload containing the JSON object detailing the site.

Example:

PUT http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite

Payload:

NOTE: If you include the id when you execute a PUT it must match the id of the object at the specified PUT URL. If you are creating a new object you should not include the id.

  • siteName correlates to the name you want the site to be and must be the same as the name of the site in the PUT URL.

  • name and path are not used for a site but are used for other folders and sections.

  • workflow correlates to the workflow in CM1, [default] represents the workflow that is selected to be the default.

  • accessLevel correlates to permission level such as READ, WRITE, or ADMIN

  • targetWindow specifies where the link will open in a browser options are:  _self, _blank, _top

  • templateName correlates to the template that will be used for the homepage within the site.

{  

  "name":"",

  "siteName":"MySite",

  "path":"",

  "workflow":"[default]",

  "accessLevel":"WRITE",

  "sectionInfo":{  

     "displayTitle":"Home",

     "targetWindow":"_self",

     "navClass":"",

     "templateName":"MyTemplate",

     "landingPage":{  

        "name":"index",

        "href":"http://myCM1:9992/Rhythmyx/rest/pages/by-path/MySite/index"

     }

  },

  "pages":[  

     {  

        "name":"index",

        "href":"http://myCM1:9992/Rhythmyx/rest/pages/by-path/MySite"

     }

  ],

  "subfolders":[  ],

  "subsections":[ ]

}

Response:

The response will return the same JSON object passed back with any changes you have made.

Create/Update a Folder

CreateFolder.PNG

Functionality:

This REST call will allow you to create or update a folder in your CM1 instance and define its properties. This call can be made without passing a payload and only passing the url of the folder. It can also take a JSON object outlining the details of the folder (see payload)

What you need to know:

  • The name of the folder you want to create or update
  • The name of the site you want to create the folder in
  • Optionally the path between the site and the folder

Use Case:

You need to create or update a folder object in CM1.

How to execute:

Execute a PUT request against the CM1 instance (http://myCM1:9992) using the site name (MySite) and optionally the payload containing the JSON object detailing the site if you want to add detail or update the folder.

Example #1:

This example displays the simplest way to create a folder in CM1. There is no need to define any details about the folder object unless you want more detail (see Example #2)

PUT http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MyFolder

Note: if you receive an java.io.EOFException you may want to add an empty JSON object to the body payload which would look like this “{ }”.

Example #2:

This example displays how to update a folder that already exists in CM1.

GET http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MyFolder

Copy the JSON object that is returned by the GET request and put it in the body of the payload for the PUT you see below and make any changes to the fields to your specifications.

PUT http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MyFolder

Payload:

NOTE: If you include the id when you execute a PUT it must match the id of the object at the specified PUT URL. If you are creating a new object you should not include the id.

  • siteName correlates to the name of the site the folder is under and must be the same as the name of the site (MySite) in the PUT URL.

  • name and path correlate to the name of the folder (MyFolder) and the path (other folders) to get from the site to the folder you want to update. Note that this path also needs to be reflected in the PUT URL.

  • workflow correlates to the workflow in CM1, [default] represents the workflow that is selected to be the default.  If [default] is specified and the default workflow on the system is modified the item will reflect the change.  If a specific workflow is set then that workflow will be used regardless of the system default.

  • accessLevel correlates to permission level such as READ, WRITE, or ADMIN

  • pages correlates to a list of pages that are in the folder. In this example there are none so the list is empty. (See Using REST API - Pages for more information)

  • subfolders correlates to a list of folders underneath the folder you are creating. It is possible to add subfolders in this fashion however the JSON object that the subfolders list takes is different (see Create Subfolder).

{  

  "name":"MyFolder",

  "siteName":"MySite",

  "path":"",

  "workflow":"[default]",

  "accessLevel":"ADMIN",

  "pages":[   ],

  "subfolders":[  ]

}

Response:

The response will return the same JSON object passed back with any changes you have made.

Create/Update a Section

MySection.png

Functionality:

This REST call will allow you to create or update a section in your CM1 instance and define its properties.

What you need to know:

  • The name of the section you want to create or update
  • The name of the site you want to create the section in
  • Optionally the path between the site and the section

Use Case:

You need to create or update a section object in CM1.

How to execute:

Execute a PUT request against the CM1 instance (http://myCM1:9992) using the site name (MySite) and the name of the section (MySection). You must also pass the JSON object in the body payload.

Example #1:

This example displays the simplest way to create a section in CM1.

PUT http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MySection

Payload:

NOTE: If you include the id when you execute a PUT it must match the id of the object at the specified PUT URL. If you are creating a new object you should not include the id.

  • name, siteName, and path all correlate to the location of the section. Please note that these fields do not need to be specified on a PUT as they are covered in the PUT URL. If you choose to specify them it must match the value in the PUT URL otherwise an error will be thrown.

  • workflow correlates to the workflow in CM1, [default] represents the workflow that is selected to be the default.

  • accessLevel correlates to permission level such as READ, WRITE, or ADMIN

  • sectionInfo is what defines a section from a folder and includes properties of a section object.

  • targetWindow specifies where the link will open in a browser options are:  _self, _blank, _top

  • templateName correlates to the template that will be used for the homepage within the site.

  • landingPage correlates to the index page that each section has.

  • pages correlates to a list of pages within the section, in this case the standard index page is within the section and therefore listed.

  • subfolders correlates to a list of folders underneath the folder you are creating. It is possible to add subfolders in this fashion however the JSON object that the subfolders list takes is different (see Create Subfolder).

  • subsections correlates to any sections contained within this section much like subfolders (see Create Subsections)

{  

  "name":"MySection",

  "siteName":"MySite",

  "path":"",

  "workflow":"[default]",

  "accessLevel":"WRITE",

  "sectionInfo":{  

     "displayTitle":"MySection",

     "targetWindow":"_self",

     "navClass":"",

     "templateName":"MyTemplate",

     "landingPage":{  

        "name":"index",

        "href":"http://myCM1:9992/Rhythmyx/rest/pages/by-path/MySite/mysection/index"

     }

  },

  "pages":[  

     {  

        "name":"index",

        "href":"http://myCM1:9992/Rhythmyx/rest/pages/by-path/MySite/MySection"

     }

  ],

  "subfolders":[ ],

  "subsections":[ ]

}

Example #2:

This example displays how to update a section that already exists in CM1.

GET http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MySection

Copy the JSON object that is returned by the GET request and put it in the body of the payload for the PUT you see below and make any changes to the fields to your specifications.

PUT http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MySection

Payload:

The payload would be the same as Example #1 however when updating the section you are free to change any of the fields in the JSON object to suit your specifications.

Response:

The response will return the same JSON object passed back with any changes you have made.

Create a Subsection

SubSection.PNG

Functionality:

This REST call will allow you to create a subsection in your CM1 instance.

What you need to know:

  • The name of the section which the subsection will go under
  • The name of the site you want to create the subsection in
  • Optionally the path between the site and the section the subsection will go under

Use Case:

You need to create a subsection under a section object in CM1

How to execute:

Execute a PUT request against the CM1 instance (http://myCM1:9992) using the site name (MySite) and the name of the section (MySection). You must also pass the JSON object in the body payload.

Example #1:

This example displays the simplest way to create a subsection in CM1.

You must include the payload with the PUT request. (It may be easier to do a GET on a section and copy the JSON object structure then PUT it back with your changes).

In the subsection field of the section you are to inject a JSON object similar to this one:

{  

    "name":"MySubSection",

     "href":"http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MySection/MySubSection”,

     "type":"section"

 }

(See subsections description in payload)

PUT http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MySection

Payload:

NOTE: If you include the id when you execute a PUT it must match the id of the object at the specified PUT URL. If you are creating a new object you should not include the id. You can only PUT a section link underneath or within a section

  • name, siteName, and path all correlate to the location of the selt. Please note that these fields do not need to be specified on a PUTas they are covered in the PUT URL. If you choose to specify them it must match the value in the PUT URL otherwise an error will be thrown.ction.

  • workflow correlates to the workflow in CM1, [default] represents the workflow that is selected to be the defau

  • accessLevel correlates to permission level such as READ, WRITE, or ADMIN

  • sectionInfo is what defines a section from a folder and includes properties of a section object.

  • targetWindow specifies where the link will open in a browser options are:  _self, _blank, _top

  • templateName correlates to the template that will be used for the homepage within the site.

  • landingPage correlates to the index page that each section has.

  • pages correlates to a list of pages within the section, in this case the standard index page is within the section and therefore listed.

  • subfolders correlates to a list of folders underneath the folder you are creating. It is possible to add subfolders in this fashion however the JSON object that the subfolders list takes is different (see Create Subfolder).

  • subsections correlates to any sections contained within this section much like subfolders. This is where you would also create the section link and its fields including the name of the section link, the href which holds the link, and the type which defines the type of link.

{  

  "name":"MySection",

  "siteName":"MySite",

  "path":"",

  "workflow":"[default]",

  "accessLevel":"WRITE",

  "sectionInfo":{  

     "displayTitle":"MySection",

     "targetWindow":"_self",

     "navClass":"",

     "templateName":"MyTemplate",

     "landingPage":{  

        "name":"index",

        "href":"http://myCM1:9992/Rhythmyx/rest/pages/by-path/MySite/MySection/index"

     }

  },

  "pages":[  

     {  

        "name":"index",

        "href":"http://myCM1:9992/Rhythmyx/rest/pages/by-path/MySite/MySection"

     }

  ],

  "subfolders":[],

  "subsections":[  

     {  

        "name":"MySubSection",         "href":"http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MySection/MySubSection",

        "type":"section"

     }

  ]

}

Response:

The response will return the same JSON object passed back with any changes you have made.

Create a Sub-Section Link

SectionLink.PNG

Functionality:

This REST call will allow you to create a section link in your CM1 instance.

What you need to know:

  • The name of the section which the section link will go under
  • The name of the site you want to create the section link in
  • Optionally the path between the site and the section the section link will go under

Use Case:

You need to create a section link object in CM1

How to execute:

Execute a PUT request against the CM1 instance (http://myCM1:9992) using the site name (MySite) and the name of the section (MySection). You must also pass the JSON object in the body payload.

Example #1:

This example displays the simplest way to create a section link in CM1.

You must include the payload with the PUT request. (It may be easier to do a GET on a section and copy the JSON object structure then PUT it back with your changes).

In the subsection field of the section you are to inject a JSON object similar to this one:

{  

    "name":"mysection",

     "href":"http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MySection",

     "type":"sectionlink"

 }

(See subsections description in payload)

PUT http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MySection

Payload:

NOTE: If you include the id when you execute a PUT it must match the id of the object at the specified PUT URL. If you are creating a new object you should not include the id. You can only PUT a section link underneath or within a section.

  • name, siteName, and path all correlate to the location of the section.lt. Please note that these fields do not need to be specified on a PUTas they are covered in the PUT URL. If you choose to specify them it must match the value in the PUT URL otherwise an error will be thrown.

  • workflow correlates to the workflow in CM1, [default] represents the workflow that is selected to be the default.

  • accessLevel correlates to permission level such as READ, WRITE, or ADMIN

  • sectionInfo is what defines a section from a folder and includes properties of a section object.

  • targetWindow specifies where the link will open in a browser options are:  _self, _blank, _top

  • templateName correlates to the template that will be used for the homepage within the site.

  • landingPage correlates to the index page that each section has.

  • pages correlates to a list of pages within the section, in this case the standard index page is within the section and therefore listed.

  • subfolders correlates to a list of folders underneath the folder you are creating. It is possible to add subfolders in this fashion however the JSON object that the subfolders list takes is different (see Create Subfolder).

  • subsections correlates to any sections contained within this section much like subfolders. This is where you would also create the section link and its fields including the name of the section link, the href which holds the link, and the type which defines the type of link.

{  

  "name":"MySection",

  "siteName":"MySite",

  "path":"",

  "workflow":"[default]",

  "accessLevel":"WRITE",

  "sectionInfo":{  

     "displayTitle":"MySection",

     "targetWindow":"_self",

     "navClass":"",

     "templateName":"MyTemplate",

     "landingPage":{  

        "name":"index",

        "href":"http://myCM1:9992/Rhythmyx/rest/pages/by-path/MySite/MySection/index"

     }

  },

  "pages":[  

     {  

        "name":"index",

        "href":"http://myCM1:9992/Rhythmyx/rest/pages/by-path/MySite/MySection"

     }

  ],

  "subfolders":[ ],

  "subsections":[  

     {  

        "name":"MySection",

        "href":"http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MySection",

        "type":"sectionlink"

     }

  ]

}

Response:

The response will return the same JSON object passed back with any changes you have made.

Create an Sub-External Link

ExternalLink.PNG

Functionality:

This REST call will allow you to create an external link in your CM1 instance.

What you need to know:

  • The name of the section which the external link will go under
  • The name of the site you want to create the external link in
  • Optionally the path between the site and the section the external link will go under

Use Case:

You need to create an external link object in CM1 (generally used in the navigation widget)

How to execute:

Execute a PUT request against the CM1 instance (http://myCM1:9992) using the site name (MySite) and the name of the section (MySection). You must also pass the JSON object in the body payload.

Example #1:

This example displays the simplest way to create an external link in CM1.

You must include the payload with the PUT request. (It may be easier to do a GET on a section and copy the JSON object structure then PUT it back with your changes).

In the subsection field of the section you are to inject a JSON object similar to this one:

{  

    "name":"MyExternalLink",

    "href":"http://at-ctrl:9992/Rhythmyx/rest/folders/by-path/MySite/MySection/MyExternalLink",

     "type":"externallink"

 }

(See subsections description in payload)

PUT http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MySection

Payload:

NOTE: If you include the id when you execute a PUT it must match the id of the object at the specified PUT URL. If you are creating a new object you should not include the id. You can only PUT a section link underneath or within a section.

  • name, siteName, and path all correlate to the location of the section.

  • workflow correlates to the workflow in CM1, [default] represents the workflow that is selected to be the default.

  • accessLevel correlates to permission level such as READ, WRITE, or ADMIN

  • sectionInfo is what defines a section from a folder and includes properties of a section object.

  • targetWindow specifies where the link will open in a browser options are:  _self, _blank, _top

  • templateName correlates to the template that will be used for the homepage within the site.

  • landingPage correlates to the index page that each section has.

  • pages correlates to a list of pages within the section, in this case the standard index page is within the section and therefore listed.

  • subfolders correlates to a list of folders underneath the folder you are creating. It is possible to add subfolders in this fashion however the JSON object that the subfolders list takes is different (see Create Subfolder).

  • subsections correlates to any sections contained within this section much like subfolders. This is where you would also create the section link and its fields including the name of the section link, the href which holds the link, and the type which defines the type of link.

{  

  "name":"MySection",

  "siteName":"MySite",

  "path":"",

  "workflow":"[default]",

  "accessLevel":"WRITE",

  "sectionInfo":{  

     "displayTitle":"MySection",

     "targetWindow":"_self",

     "navClass":"",

     "templateName":"MyTemplate",

     "landingPage":{  

        "name":"index",

        "href":"http://myCM1:9992/Rhythmyx/rest/pages/by-path/MySite/mysection/index"

     }

  },

  "pages":[  

     {  

        "name":"index",

        "href":"http://myCM1:9992/Rhythmyx/rest/pages/by-path/MySite/MySection"

     }

  ],

  "subfolders":[],

  "subsections":[  

     {  

        "name":"MyExternalLink",         "href":"http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MySection/MyExternalLink",

        "type":"externallink"

     }

  ]

}

Response:

The response will return the same JSON object passed back with any changes you have made.

Create an External Link

ExternalLink.PNG

Functionality:

This REST call will allow you to create an external link in your CM1 instance.

What you need to know:

  • The name of the external link
  • The name of the site you want to create the external link in
  • Optionally the path between the site and the external link

Use Case:

You need to create an external link object in CM1 (generally used in the navigation widget)

How to execute:

Execute a PUT request against the CM1 instance (http://myCM1:9992) using the site name (MySite) and the name of the external link (ExternalLink). You must also pass the JSON object in the body payload.

Example #1:

This example displays the simplest way to create an external link in CM1.

You must include the payload with the PUT request. (It may be easier to do a GET on a section and copy the JSON object structure then PUT it back with your changes).

PUT http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/ExternalLink

Payload:

NOTE: If you include the id when you execute a PUT it must match the id of the object at the specified PUT URL. If you are creating a new object you should not include the id. You can only PUT a section link underneath or within a section.

  • name, siteName, and path all correlate to the location of the section.

  • workflow correlates to the workflow in CM1, [default] represents the workflow that is selected to be the default.

  • accessLevel correlates to permission level such as READ, WRITE, or ADMIN

  • sectionInfo is what defines the external link details.

  • targetWindow specifies where the link will open in a browser options are:  _self, _blank, _top

  • externalLinkUrl defines the fully qualified link.

 

{  

  "name":"ExternalLink",

  "siteName":"MySite",

  "path":"",

  "workflow":"[default]",

  "accessLevel":"WRITE",

  "sectionInfo":{  

     "type":"externallink",

     "displayTitle":"ExternalLink",

     "targetWindow":"_self",

     "navClass":"",

     "externalLinkUrl":"http://www.facebook.com"

  }

}

 

Response:

The response will return the same JSON object passed back with any changes you have made.

Create a Subfolder

SubFolder.PNG

Functionality:

This REST call will allow you to create a subfolder in your CM1 instance.

What you need to know:

  • The name of the folder which the subfolder will go under
  • The name of the site you want to create the folder in
  • Optionally the path between the site and the folder the subfolder will go under

Use Case:

You need to create a subfolder in CM1.

How to execute:

Execute a PUT request against the CM1 instance (http://myCM1:9992) using the site name (MySite) and the name of the folder (MyFolder). You must also pass the JSON object in the body payload.

Example #1:

This example displays the simplest way to create a subfolder in CM1.

You must include the payload with the PUT request. (It may be easier to do a GET on a folder and copy the JSON object structure then PUT it back with your changes).

In the subfolders field of the folder you are to inject a JSON object similar to this one:

{  

    "name":"MySubFolder",

    "href":"http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MyFolder/MySubFolder"

}

(See subfolders description in payload)

PUT http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MyFolder

Payload:

NOTE: If you include the id when you execute a PUT it must match the id of the object at the specified PUT URL. If you are creating a new object you should not include the id. You can only PUT a section link underneath or within a section.

  • name, siteName, and path all correlate to the location of the section.

  • workflow correlates to the workflow in CM1, [default] represents the workflow that is selected to be the default.

  • accessLevel correlates to permission level such as READ, WRITE, or ADMIN

  • templateName correlates to the template that will be used for the homepage within the site.

  • pages correlates to a list of pages within the section, in this case the standard index page is within the section and therefore listed.

  • subfolders correlates to a list of folders underneath the folder you are creating. To put a subfolder in the list you must inject the JSON object with the fields name which defines the name of the subfolder and the field href which defines the link to the subfolder

{  

  "name":"MyFolder",

  "siteName":"MySite",

  "path":"",

  "workflow":"[default]",

  "accessLevel":"ADMIN",

  "pages":[ ],

  "subfolders":[  

     {  

        "name":"MySubFolder",         "href":"http://at-ctrl:9992/Rhythmyx/rest/folders/by-path/MySite/MyFolder/MySubFolder"

     }

  ]

}

Response:

The response will return the same JSON object passed back with any changes you have made.

Get a Section Link

SectionLink.PNG

Functionality:

This REST call will allow you to get a section link in your CM1 instance.

What you need to know:

  • The name of the section link
  • The name of the site you want to get the section link from
  • Optionally the path between the site and the section the section link is under

Use Case:

You need to see what the section link is in a section in CM1.

How to execute:

Execute a GET request against the CM1 instance (http://myCM1:9992) using the site name (MySite) and the name of the section link (SectionLink).

Example #1:

This example displays the simplest way get a section link in CM1. You must do a get on the section link and you will see the section link returned as a JSON object in the subsections field. This is done the same way as Get Section (see Get Section).

Get an External Link

ExternalLink.PNG

Functionality:

This REST call will allow you to get an external link in your CM1 instance.

What you need to know:

  • The name of the external link
  • The name of the site you want to get the section link from
  • Optionally the path between the site and the section the external link is under

Use Case:

You need to see what the external link is in a section in CM1.

How to execute:

Execute a GET request against the CM1 instance (http://myCM1:9992) using the site name (MySite) and the name of the section (MySection).

Example #1:

This example displays the simplest way get an external link in CM1. You must do a get on the external link and you will see the external link returned as a JSON object in the subsections field. This is done the same way as Get Section (see Get Section).

Delete a Folder

Functionality:

This REST call will allow you to delete a folder in your CM1 instance.

What you need to know:

  • The name of the folder you want to delete
  • The name of the site the folder is under
  • Optionally the path between the site and the folder

Use Case:

You need to see delete a folder in CM1.

How to execute:

Execute a DELETE request against the CM1 instance (http://myCM1:9992) using the site name (MySite) and the name of the folder (MyFolder).

Example #1:

This example displays how to delete an empty folder in CM1. There is no need to post a payload with the request.

DELETE http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MyFolder

Example #2:

This example displays how to delete a non-empty folder in CM1 along with all of its contents. There is no need to post a payload with the request however you will need to pass includeSubFolders = true as an html header.

DELETE http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MyFolder

HTML Parameters: includeSubFolders = true

Response:

{"message":"Deleted"}

Delete a Section

Functionality:

This REST call will allow you to delete a section in your CM1 instance.

What you need to know:

  • The name of the section you want to delete
  • The name of the site the section is under
  • Optionally the path between the site and the section

Use Case:

You need to see delete a section in CM1.

How to execute:

Execute a DELETE request against the CM1 instance (http://myCM1:9992) using the site name (MySite) and the name of the section (MySection).

Example #1:

This example displays how to delete a section in CM1 along with all of its contents. There is no need to post a payload with the request however you will need to pass includeSubFolders = true as an html header.

DELETE http://myCM1:9992/Rhythmyx/rest/folders/by-path/MySite/MyFolder

HTML Parameters: includeSubFolders = true

Response:

{"message":"Deleted"}

Leave a comment

*
*