List the Asset Types Used by a Template

get

/sites/management/api/v1/templates/{id}/assetTypes

COLLECTION

List asset types that are used by the template. Each instance of an asset type used is returned, with the instance identifier and the page id that contains that instance. To include the name of the asset type, expand the type field by including the expand=type query parameter. As there might be a large number of assets, results can be requested in pages.

Introduced in release 21.1.3.

Authorization

To invoke this operation, the authenticated user or client application must have been shared with the resource and have one of the following sharing roles:

  • Owner
  • Manager
  • Contributor
  • Downloader
  • Viewer

Limits

If the limit query parameter is not provided this operation uses a default limit of 50 items. The maximum limit that can be specified is 250. If the limit exceeds this maximum then a limit of 250 is used.

Path Alternative Identifiers

The default identifier for a Template resource is the Template Identifier. The Template resource supports alternative identifiers.

nameTemplate Name

Instead of the template identifier, the template name can be used to uniquely identify a template in the resource path. The default resource path parameter for a template is the template identifier, but when working with templates the human-readable template name is sometimes easier.

http://api.example.com/sites/management/api/v1/templates/name:CafeSupremo/assetTypes

Introduced in release 19.4.1.

Successful Response Examples

This operation responds with the following success (2xx) responses. For a full list of response HTTP status codes and example bodies, consult the Response section of this operation.

200OK - List Asset Types

List the asset types used by a template. The type field in the response contains a canonical link to read the relationship details from the content management REST API.

Request

GET https://api.example.com/sites/management/api/v1/templates/{id}/assetTypes

Response Body

{
  "totalResults": 2,
  "limit": 50,
  "count": 2,
  "hasMore": false,
  "offset": 0,
  "items": [
      {
        "pageId": 100,
        "instanceId": "a47be99b-7b63-4918-bd2d-8373c8484036",
        "type": {
          "links": [
              {
                "rel": "canonical",
                "href": "http://api.example.com/content/management/api/v1.1/types/MenuItem",
                "templated": false,
                "mediaType": "application/json",
                "method": "GET"
              }
          ]
        }
      },
      {
        "pageId": 120,
        "instanceId": "d952fa9d-56cc-4adf-a1f5-0f549f3c49a4",
        "type": {
          "links": [
              {
                "rel": "canonical",
                "href": "http://api.example.com/content/management/api/v1.1/types/Author",
                "templated": false,
                "mediaType": "application/json",
                "method": "GET"
              }
          ]
        }
      }
  ]
}

200OK - List Asset Types Including Asset Type Name

List the asset types used by a template, expanding the type field to include the asset type name. Links are excluded for clarity.

Request

GET https://api.example.com/sites/management/api/v1/templates/{id}/assetTypes?expand=type&links=none

Response Body

{
  "totalResults": 2,
  "limit": 50,
  "count": 2,
  "hasMore": false,
  "offset": 0,
  "items": [
      {
        "pageId": 100,
        "instanceId": "a47be99b-7b63-4918-bd2d-8373c8484036",
        "type": {
          "name": "MenuItem"
        }
      },
      {
        "pageId": 120,
        "instanceId": "d952fa9d-56cc-4adf-a1f5-0f549f3c49a4",
        "type": {
          "name": "Author"
        }
      }
  ]
}

Client Error Response Examples

This operation responds with following client error (4xx) responses with exception details in the response body. For a full list of response HTTP status codes and example bodies, consult the Response section of this operation.

404Not Found - Template Not Found

The site template does not exist or has been deleted, or the authenticated user or client application does not have access to the template.

Error Code

OCE-SITEMGMT-009000

Resolution - Check Identifier

Check that the template identifier is valid.

Resolution - Check Membership

Check that the authenticated user is a member of the template or a site administrator.

Exception Detail Fields

This error type includes the following fields/values in the response:

Field NameDescription
templateTemplate that does not exist or is not visible to the authenticated user.

For detailed information about this exception detail type, consult the TemplateNotFoundExceptionDetail schema in the definitions section of the swagger document.

Example Response Body
{
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
  "title": "Template Not Found",
  "status": "404",
  "detail": "Template does not exist or has been deleted, or the authenticated user or client application does not have access to the template.",
  "o:errorCode": "OCE-SITEMGMT-009000",
  "template": {
    "id": "F30F08EB205D44AD20B5A48D1B1B3DD7D74F45978AB6"
  }
}

Request

Path Parameters
Query Parameters
  • Comma-delimited string of field names that you do not want in the response. Nested fields can be identified using a dot to separate the field names. Field names are case-sensitive. Field names are ignored if the field does not exist. To reference the fields of the collection the field name can be prepended with the @ character (for example, @hasMore).

  • Comma-separated list of link relation names to exclude from the response.

  • Comma-delimited string of field names that you want to expand. Use the value all to expand all relationships.

    The following field names can be specified in the expand query parameter:

    Field NameDescription
    typeThe asset type.
  • Specify how errors in expansion are handled. If not specified, then the default is to include error details in the relationship field.

    Valid values are:

    • ignore - Ignore the error and do not expand the relationship. Relationship links are not included in the response
    • include - Include the error details instead of the expanded relationship. Relationship links are returned
    • fail - Fail the request with an expansion failure error response

  • Comma-delimited string of field names that you want in the response. Nested properties can be identified using a dot to separate the field names. Field names are case-sensitive. Field names are ignored if the field does not exist. To reference the fields of the collection the field name can be prepended with the @ character (for example, @hasMore).

  • Positive integer value that specifies the maximum number of items returned in the response. If not specified the service will choose an appropriate limit.

  • Comma-separated list of link relation names to include in the response. By default, all links are returned.

    The following links are provided by this resource:

    Link RelationshipDescription
    parentDescribes where the parent resource can be read. Equivalent to an up link, this link provides the link to the parent resource, such as the collection resource that contains a singular resource.
    selfDescribes the current returned representation of the resource. Used for links that represent the resource itself. For example, if a resource is returned as part of a collection, the self link will provide the URL path for the individual resource.
    canonicalDescribes the preferred representation of the requested resource. Used for links that represent the canonical form of the resource. For example, if a resource is returned as part of a collection, the canonical link will provide the URL path for the canonical form of the individual resource.
    childDescribes where a related or child resource can be read. Child links are returned in expandable properties and provide the location where unexpanded relationship details can be read.
    prevDescribes the previous page of results, if a previous page exists. Used with collection resources to provide a previous-page link based on the response to a paged request that specified the offset and limit query parameters.
    nextDescribes the next page of results, if a next page exists. Used with collection resources to provide a next-page link based on the response to a paged request that specified the offset and limit query parameters.
    describedByDescribes the schema resource providing metadata information about the resource. Used on collection, singular and relation resources to indicate where the schema resource is that describes the resource.
  • Non-negative integer value that specifies the index of the first item to be returned. The offset index begins at zero. By default, the offset is zero, which returns items starting from the first item in the collection.

  • Specify the resource representation that should be used to control the response fields and links. If no representation is specified, the client-defined representation is returned, based on the values of the fields, excludeFields, links, excludeLinks and expand query parameters.

    The following representations are supported with the return query parameter:

    RepresentationDescription
    representationFull resource representation includes all properties and links and expands most relationships.
    defaultDefault resource representation includes most properties and links.
    basicBasic resource representation includes some properties and some links.
    minimalMinimal resource representation, includes essential properties and no links.
Back to Top

Response

Supported Media Types

200 Response

OK
Headers
Body ()
Root Schema : schema
Type: object
Show Source
  • items

    Collection of Template Page Asset Type elements.

    Introduced in release 21.1.3.
Match All
Show Source
  • CollectionResource

    All collections returned by REST APIs extend the standard collection definition. The definition provides information about the total number of items, the offset and limit details for the items returned, the number of items and an indicator to whether there are more items available.

Nested Schema : items
Type: array

Collection of Template Page Asset Type elements.

Introduced in release 21.1.3.
Show Source
Nested Schema : CollectionResource

All collections returned by REST APIs extend the standard collection definition. The definition provides information about the total number of items, the offset and limit details for the items returned, the number of items and an indicator to whether there are more items available.

Match All
Show Source
Nested Schema : SingularResource
Type: object

All singular resources include the properties of the singular resource definition. A singular resource includes a list of links that provide relationships to other resources, or in the case of the self link the resource itself.

Show Source
  • links
Nested Schema : CollectionResource-allOf[1]
Type: object
Show Source
  • Total number of resources in the response.

  • Collection has more elements that match the request. Indicates whether there are more items to be returned when a paged request is made and the page was not big enough to return all elements.

  • Actual response size limit used. If the request specifies too large a limit, or does not specify a limit then the response will specify the limit used.

  • Actual response offset used. If the request specifies no offset then the actual offset is provided in the response.

  • Total number of resources that match the request. If provided, this is the total number of available items. If not specified the total is not known, or is not viable to return. Paging limits or offsets are ignored when calculating this value. Only returned if the totalResults parameter is supported and is set to true by the client.

Nested Schema : items
Match All
Show Source
Nested Schema : TemplatePageAssetType

Information about an asset type that is used on a site page.

Introduced in release 21.1.3.
Match All
Show Source
Nested Schema : TemplatePageAssetType-allOf[1]
Type: object
Show Source
Nested Schema : type

The asset type.

Introduced in release 21.1.3.
Match All
Show Source
Nested Schema : ContentType

A content type.

Introduced in release 21.1.3.
Match All
Show Source
  • SingularResource

    All singular resources include the properties of the singular resource definition. A singular resource includes a list of links that provide relationships to other resources, or in the case of the self link the resource itself.

  • ContentType-allOf[1]
Nested Schema : ContentType-allOf[1]
Type: object
Show Source
Nested Schema : createdDate

Date and time the type was created.

Introduced in release 21.1.3.
Match All
Show Source
Nested Schema : id

Unique identifier for the content type.

Introduced in release 21.1.3.
Match All
Show Source
Nested Schema : updatedDate

Date and time the type was last updated.

Introduced in release 21.1.3.
Match All
Show Source
Nested Schema : DateTimeZone
Type: object

Date, time and time zone.

Show Source
Nested Schema : ContentTypeId
Type: object

Content type identifier.

Show Source
Example Response (List Asset Types)
{
    "totalResults":2,
    "limit":50,
    "count":2,
    "hasMore":false,
    "offset":0,
    "items":[
        {
            "pageId":100,
            "instanceId":"a47be99b-7b63-4918-bd2d-8373c8484036",
            "type":{
                "links":[
                    {
                        "rel":"canonical",
                        "href":"http://api.example.com/content/management/api/v1.1/types/MenuItem",
                        "templated":false,
                        "mediaType":"application/json",
                        "method":"GET"
                    }
                ]
            }
        },
        {
            "pageId":120,
            "instanceId":"d952fa9d-56cc-4adf-a1f5-0f549f3c49a4",
            "type":{
                "links":[
                    {
                        "rel":"canonical",
                        "href":"http://api.example.com/content/management/api/v1.1/types/Author",
                        "templated":false,
                        "mediaType":"application/json",
                        "method":"GET"
                    }
                ]
            }
        }
    ]
}

400 Response

Bad Request

401 Response

Unauthorized

403 Response

Forbidden

404 Response

Not Found
Headers
Body ()
Root Schema : schema
Match All
Show Source
Nested Schema : TemplateNotFoundExceptionDetail
Match All
Show Source
Nested Schema : ExceptionDetail
Type: object

In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.

Show Source
Nested Schema : TemplateNotFoundExceptionDetail-allOf[1]
Type: object
Show Source
Nested Schema : o:errorDetails
Type: array

Multiple errors can be organized in a hierarchical structure.

Show Source
Nested Schema : items
Match All
Show Source
  • ExceptionDetail

    In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.

Example Response (Template Not Found)
{
    "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Template Not Found",
    "status":"404",
    "detail":"Template does not exist or has been deleted, or the authenticated user or client application does not have access to the template.",
    "o:errorCode":"OCE-SITEMGMT-009000",
    "template":{
        "id":"F30F08EB205D44AD20B5A48D1B1B3DD7D74F45978AB6"
    }
}

406 Response

Not Acceptable

416 Response

Range Not Satisfiable

429 Response

Too Many Requests

500 Response

Internal Server Error

501 Response

Not Implemented

502 Response

Bad Gateway

503 Response

Service Unavailable

504 Response

Gateway Timeout
Back to Top