Welcome to the OpenCities help centre. Search for what you're after, or browse the categories.
Can't find what you're looking for? Submit a support ticket and we'll be in touch.

Follow

Content Pages API

avatar of Kira Hartley

Kira Hartley

Last updated

In this article:

Get Content Page

Endpoint: GET /{objectTypeEndpoint}/get 

Authentication: Required 

Description: Get a specific content page with the given item ID and language code.

Parameters

Parameter Type Required Description
objectTypeEndpoint string Yes

The endpoint of the object type (path parameter). 

To find this value, go to More > Content Type, select your content type, and copy the Endpoint for API value.

id string Yes Item ID of the content page (query parameter)
languageCode string No Language code (e.g., en-AU) for content variant.

Sample Request

curl -u "your_app_id:your_api_key" \
  -H "Content-Type: application/json" \
  "https://your-domain.com/api/v1/oc-general/get?id=7b5ad630-38d2-4bdd-95da-02dd0e9207cf&languageCode=en-US"

Sample Response

{
  "Id": "7b5ad630-38d2-4bdd-95da-02dd0e9207cf",
  "Owner": "admin",
  "CreateDate": "2025-02-20T02:55:07Z",
  "ActivateDate": "2025-09-04T05:53:00Z",
  "ReviewDate": "9999-12-31T23:59:59Z",
  "DeactivateDate": "9999-12-31T23:59:59Z",
  "IsShared": false,
  "HideFromNavigation": false,
  "HideFromSearch": false,
  "NotificationSent": 0,
  "NotifySubscribers": false,
  "Template": "OC 2 Column",
  "ReplicatedItem": "00000000-0000-0000-0000-000000000000",
  "Locale": {
    "en-US": {
      "Author": "admin",
      "Link": "$720cfbd8-df7e-4b88-bf92-e218d51ee173$/LeisurePlex/Fitness-Studio",
      "Name": "Fitness Studio",
      "PageDataField": {
        "OC Title": {
          "Type": 10,
          "Value": "Fitness Studio"
        },
        "OC Page Image": {
          "Type": 90,
          "Value": {
            "UrlOrId": "files/f8ee7687-a4bc-4a68-a32e-813f4e9b5556/Sized-Studio.jpg",
            "AltText": "Sized-Studio.jpg",
            "FileName": "Sized-Studio.jpg",
            "Transcript": null,
            "OverrideDescription": true
          }
        },
        "OC Section Type": {
          "Type": 40,
          "Value": ""
        },
        "OC Body Content": {
          "Type": 30,
          "Value": "<p>Content coming soon</p>\r\n\r\n"
        },
        "OC Toggle On 1": {
          "Type": 50,
          "Value": {
            "Options": [
              {
                "Value": "Yes",
                "Text": "Yes"
              }
            ]
          }
        },
        "OC Show Feedback Form": {
          "Type": 60,
          "Value": {
            "Value": "Yes",
            "Text": "Yes"
          }
        },
        "OC Short Description": {
          "Type": 20,
          "Value": "For all crossfitters, the Point Russell fitness studio is purpose built for cardio sessions like never before. Sweat it out while having some fun at our studio."
        },
        "OC Content Labels": {
          "Type": 190,
          "Value": ""
        },
        "OC Multiple Content 2": {
          "Type": 900,
          "Value": ""
        }
      },
      "PageDataFieldRemoved": {}
    }
  }
}

List Content Pages

Endpoint: GET /{objectTypeEndpoint}/list 

Authentication: Required 

Description: Get a list of content pages for a specified object type.

Parameters

Parameter Type Required Description
objectTypeEndpoint string Yes

The endpoint of the object type (path parameter). 

To find this value, go to More > Content Type, select your content type, and copy the Endpoint for API value.

properties string No Data field names separated by '
index integer No Index of the first item
pageSize integer No Total number of items requested
languageCode string No Language code for specific variant

Sample Request

curl -u "your_app_id:your_api_key" \
  -H "Content-Type: application/json" \
  "https://your-domain.com/api/v1/oc-general/list?properties=OC Title|OC Short Description&index=0&pageSize=10&languageCode=en-US"

Sample Response

{
  "Total": 25,
  "Items": [
    {
      "Id": "7b5ad630-38d2-4bdd-95da-02dd0e9207cf",
      "Owner": "admin",
      "CreateDate": "2025-02-20T02:55:07Z",
      "ActivateDate": "2025-09-04T05:53:00Z",
      "Template": "OC 2 Column",
      "Locale": {
        "en-US": {
          "Name": "Fitness Studio",
          "Author": "admin",
          "Link": "$720cfbd8-df7e-4b88-bf92-e218d51ee173$/LeisurePlex/Fitness-Studio",
          "PageDataField": {
            "OC Title": {
              "Type": 10,
              "Value": "Fitness Studio"
            },
            "OC Short Description": {
              "Type": 20,
              "Value": "For all crossfitters, the Point Russell fitness studio is purpose built for cardio sessions like never before. Sweat it out while having some fun at our studio."
            }
          }
        }
      }
    },
    {
      "Id": "8c6be741-49e3-5cee-a6eb-13fe5fa1916e",
      "Owner": "admin",
      "CreateDate": "2025-03-10T08:22:15Z",
      "ActivateDate": "2025-03-10T08:22:15Z",
      "Template": "OC 2 Column",
      "Locale": {
        "en-US": {
          "Name": "Swimming Pool",
          "Author": "admin",
          "Link": "$720cfbd8-df7e-4b88-bf92-e218d51ee173$/LeisurePlex/Swimming-Pool",
          "PageDataField": {
            "OC Title": {
              "Type": 10,
              "Value": "Swimming Pool"
            },
            "OC Short Description": {
              "Type": 20,
              "Value": "Our 25-meter heated indoor pool is perfect for lap swimming, aqua fitness classes, and family fun."
            }
          }
        }
      }
    }
  ]
}

Create Content Page

Endpoint: POST /{objectTypeEndpoint}/create 

Authentication: Required 

Description: Create a new content page with the provided data.

Parameters

Parameter Type Required Description
objectTypeEndpoint string Yes

The endpoint of the object type (path parameter). 

To find this value, go to More > Content Type, select your content type, and copy the Endpoint for API value.

page object Yes Page DTO JSON (request body)
parent string No Parent content's path or ID (query parameter)
comment string No Note to add to the page (query parameter)

Sample Request

curl -u "your_app_id:your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "Name": "New Leisure Facility",
    "Template": "OC 2 Column",
    "Locale": {
      "en-US": {
        "PageDataField": {
          "OC Title": {
            "Type": 10,
            "Value": "New Leisure Facility"
          },
          "OC Short Description": {
            "Type": 20,
            "Value": "A brand new state-of-the-art leisure facility with modern equipment and professional training programs."
          },
          "OC Body Content": {
            "Type": 30,
            "Value": "<p>Welcome to our newest leisure facility featuring cutting-edge equipment and expert instructors.</p>"
          },
          "OC Show Feedback Form": {
            "Type": 60,
            "Value": {
              "Value": "Yes",
              "Text": "Yes"
            }
          }
        }
      }
    }
  }' \
  "https://your-domain.com/api/v1/oc-general/create?parent=/leisureplex&comment=Created via API"

Sample Response

{
  "itemid": "9d7cf852-f0a4-12e4-b567-537625285001"
}

Update Content Page

Endpoint: POST /{objectTypeEndpoint}/update 

Authentication: Required 

Description: Update an existing content page.

Parameters

Parameter Type Required Description
objectTypeEndpoint string Yes

The endpoint of the object type (path parameter). 

To find this value, go to More > Content Type, select your content type, and copy the Endpoint for API value.

page object Yes Page DTO JSON (request body)
comment string No Note to add to the page (query parameter)
overwriteLatest boolean No Overwrite latest version instead of creating new. Default: false

Sample Request

curl -u "your_app_id:your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "Id": "7b5ad630-38d2-4bdd-95da-02dd0e9207cf",
    "Locale": {
      "en-US": {
        "PageDataField": {
          "OC Title": {
            "Type": 10,
            "Value": "Updated Fitness Studio"
          },
          "OC Short Description": {
            "Type": 20,
            "Value": "Our newly renovated fitness studio with the latest equipment and expanded class schedules."
          },
          "OC Body Content": {
            "Type": 30,
            "Value": "<p>Experience our completely renovated fitness studio with brand new equipment and expanded program offerings.</p>"
          }
        }
      }
    }
  }' \
  "https://your-domain.com/api/v1/oc-general/update?comment=Updated via API&overwriteLatest=true"

Archive Content Page

Endpoint: POST /{objectTypeEndpoint}/archive 

Authentication: Required 

Description: Archive a specific content page.

Parameters

Parameter Type Required Description
objectTypeEndpoint string Yes

The endpoint of the object type (path parameter). 

To find this value, go to More > Content Type, select your content type, and copy the Endpoint for API value.

id String(UUID) Yes Item ID of the content page (query parameter)

Sample Request

curl -u "your_app_id:your_api_key" \
  -X POST \
  "https://your-domain.com/api/v1/oc-general/archive?id=7b5ad630-38d2-4bdd-95da-02dd0e9207cf"

Upload File to Content Page

Endpoint: POST /{objectTypeEndpoint}/fileupload 

Authentication: Required 

Description: Uploads a file to the Temp folder for use in content pages.

Parameters

Parameter Type Required Description
objectTypeEndpoint string Yes

The endpoint of the object type (path parameter). 

To find this value, go to More > Content Type, select your content type, and copy the Endpoint for API value.

file file Yes File to be uploaded (form data)

Sample Request

curl -u "your_app_id:your_api_key" \
  -F 'file=@/path/to/document.pdf' \
  "https://your-domain.com/api/v1/oc-general/fileupload"

Sample Response

[
  {
    "FileName": "filename.jpg",
    "UniqueServerFileId": "BodyPart_a5ab71c2-a7b3-484f-8d81-73572db06364_remotecopy",
    "FileExpiryUTC": "2025-09-01T08:23:41.6179727Z"
  }
]

Delete Content Page

Endpoint: DELETE /{objectTypeEndpoint}/delete 

Authentication: Required 

Description: Delete a specific content page.

Parameters

Parameter Type Required Description
objectTypeEndpoint string Yes

The endpoint of the object type (path parameter). 

To find this value, go to More > Content Type, select your content type, and copy the Endpoint for API value.

id String(UUID) Yes Item ID of the content page (query parameter)

Sample Request

curl -u "your_app_id:your_api_key" \
  -X DELETE \
  "https://your-domain.com/api/v1/oc-general/delete?id=7b5ad630-38d2-4bdd-95da-02dd0e9207cf"

Get Content Types List

Endpoint: GET /contenttypes/list 

Authentication: Required 

Description: Returns a list of content types available via API endpoints.

Sample Request

curl -u "your_app_id:your_api_key" \
  -H "Content-Type: application/json" \
  "https://your-domain.com/api/v1/contenttypes/list"

Sample Response

[
  {
    "Id": "ct_001",
    "Name": "News Article",
    "Description": "News articles for the website",
    "EndPointName": "news"
  },
  {
    "Id": "ct_002",
    "Name": "Event",
    "Description": "Event pages",
    "EndPointName": "events"
  }
]

General Search Content Pages

Endpoint: GET /search 

Authentication: Required 

Description: Search content pages available in the system front end in current group with specified parameters.

Parameters

  • Keyword (query, optional): Search keyword
  • PageSize (query, optional): Number of items to return (default: 20)
  • Index (query, optional): Page index for pagination (default: 0)
  • LanguageCode (query, optional): Language code for results

Sample Request

curl -u "your_app_id:your_api_key" \
  -H "Content-Type: application/json" \
  "https://your-domain.com/api/v1/search?Keyword=business&PageSize=10&Index=0"

Sample Response

{
  "Total": 25,
  "Limit": 10,
  "Offset": 0,
  "Items": [
    {
      "Id": "12345678-1234-1234-1234-123456789012",
      "Owner": "admin",
      "CreateDate": "2025-01-15T10:30:00Z",
      "ActivateDate": "2025-01-15T14:00:00Z",
      "ReviewDate": null,
      "DeactivateDate": null,
      "IsShared": false,
      "HideFromNavigation": false,
      "HideFromSearch": false,
      "NotificationSent": false,
      "NotifySubscribers": true,
      "Template": "StandardPage",
      "ReplicaItem": null,
      "Locale": {
        "Name": "Business Services",
        "Author": "admin",
        "Link": "/business-services",
        "PageDataField": {
          "OC Title": {
            "Type": "TextBox",
            "Value": "Business Services"
          }
        }
      }
    }
  ]
}

Example: Search with Properties Parameter

Request Parameters:

{
  "Keyword": "Information",
  "Properties": ["OC Title", "OC Short Description"],
  "PageSize": 10,
  "Index": 0
}

Sample Request:

curl -u "your_app_id:your_api_key" \
  -H "Content-Type: application/json" \
  "https://your-domain.com/api/v1/search?Keyword=Information&Properties=OC%20Title,OC%20Short%20Description&PageSize=10&Index=0"

Sample Response:

{
  "Total": 2,
  "Limit": 10,
  "Offset": 0,
  "Items": [
    {
      "Id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "Owner": "editor",
      "CreateDate": "2025-02-01T09:00:00Z",
      "ActivateDate": "2025-02-01T10:00:00Z",
      "ReviewDate": null,
      "DeactivateDate": null,
      "IsShared": false,
      "HideFromNavigation": false,
      "HideFromSearch": false,
      "NotificationSent": false,
      "NotifySubscribers": true,
      "Template": "StandardPage",
      "ReplicaItem": null,
      "Locale": {
        "Name": "Information Hub",
        "Author": "editor",
        "Link": "/information-hub",
        "PageDataField": {
          "OC Title": {
            "Type": "TextBox",
            "Value": "Information Hub"
          },
          "OC Short Description": {
            "Type": "TextBox",
            "Value": "A hub for all information resources."
          }
        }
      }
    },
    {
      "Id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
      "Owner": "admin",
      "CreateDate": "2025-02-02T11:00:00Z",
      "ActivateDate": "2025-02-02T12:00:00Z",
      "ReviewDate": null,
      "DeactivateDate": null,
      "IsShared": false,
      "HideFromNavigation": false,
      "HideFromSearch": false,
      "NotificationSent": false,
      "NotifySubscribers": true,
      "Template": "StandardPage",
      "ReplicaItem": null,
      "Locale": {
        "Name": "Public Information",
        "Author": "admin",
        "Link": "/public-information",
        "PageDataField": {
          "OC Title": {
            "Type": "TextBox",
            "Value": "Public Information"
          },
          "OC Short Description": {
            "Type": "TextBox",
            "Value": "Information for public access and reference."
          }
        }
      }
    }
  ]
}

Response Codes

  • 200 OK: Search results returned successfully
  • 400 Bad Request: Invalid search parameters
  • 401 Unauthorized: Authentication required
  • 403 Forbidden: Access denied
Was this article helpful?
0 out of 0 found this helpful