Hierarchy

  • CommonHttpService
    • TemplateService

Constructors

  • Internal

    Create a new instance of the service.

    Parameters

    • getClientInstance: (() => CommonHttpClient)
        • (): CommonHttpClient
        • Returns CommonHttpClient

    Returns TemplateService

Methods

  • Returns all templates provided by blueprints. Use this method to retrieve all global blueprint templates or all blueprint templates in a space.

    Note, all global blueprints are inherited by each space. Space blueprints can be customised without affecting the global blueprints.

    Permissions required: 'View' permission for the space to view blueprints for the space and permission to access the Confluence site ('Can use' global permission) to view global blueprints.

    Parameters

    • params: {
          expand?: ("body" | "body.storage")[];
          limit?: number;
          spaceKey?: string;
          start?: number;
      } = {}
      • Optionalexpand?: ("body" | "body.storage")[]

        A multi-value parameter indicating which properties of the template to expand.

        • body or body.storage returns the content of the template in storage format.
      • Optionallimit?: number

        The maximum number of templates to return per page. Note, this may be restricted by fixed system limits.

      • OptionalspaceKey?: string

        The key of the space to be queried for templates. If the spaceKey is not specified, global blueprint templates will be returned.

      • Optionalstart?: number

        The starting index of the returned templates.

    Returns Promise<BlueprintTemplateArray>

    Returned if the requested templates are returned.

    GET /wiki/rest/api/template/blueprint @scopes-current read:confluence-content.summary @scopes-beta read:template:confluence, read:content-details:confluence

  • Returns a content template. This includes information about template, like the name, the space or blueprint that the template is in, the body of the template, and more.

    Permissions required: 'View' permission for the space to view space templates and permission to access the Confluence site ('Can use' global permission) to view global templates.

    Parameters

    • params: {
          contentTemplateId: string;
          expand?: ("body" | "body.storage")[];
      }
      • contentTemplateId: string

        The ID of the content template to be returned.

      • Optionalexpand?: ("body" | "body.storage")[]

        A multi-value parameter indicating which properties of the template to expand.

        • body or body.storage returns the content of the template in storage format.

    Returns Promise<ContentTemplate>

    Returned if the requested template is returned.

    GET /wiki/rest/api/template/{contentTemplateId} @scopes-current read:confluence-content.summary @scopes-beta read:template:confluence, read:content-details:confluence

  • Returns all content templates. Use this method to retrieve all global content templates or all content templates in a space.

    Permissions required: 'View' permission for the space to view space templates and permission to access the Confluence site ('Can use' global permission) to view global templates.

    Parameters

    • params: {
          expand?: ("body" | "body.storage")[];
          limit?: number;
          spaceKey?: string;
          start?: number;
      } = {}
      • Optionalexpand?: ("body" | "body.storage")[]

        A multi-value parameter indicating which properties of the template to expand.

        • body or body.storage returns the content of the template in storage format.
      • Optionallimit?: number

        The maximum number of templates to return per page. Note, this may be restricted by fixed system limits.

      • OptionalspaceKey?: string

        The key of the space to be queried for templates. If the spaceKey is not specified, global templates will be returned.

      • Optionalstart?: number

        The starting index of the returned templates.

    Returns Promise<ContentTemplateArray>

    Returned if the requested templates are returned.

    GET /wiki/rest/api/template/page @scopes-current read:confluence-content.summary @scopes-beta read:template:confluence, read:content-details:confluence

  • Deletes a template. This results in different actions depending on the type of template:

    • If the template is a content template, it is deleted.
    • If the template is a modified space-level blueprint template, it reverts to the template inherited from the global-level blueprint template.
    • If the template is a modified global-level blueprint template, it reverts to the default global-level blueprint template.

    Note, unmodified blueprint templates cannot be deleted.

    Permissions required: 'Admin' permission for the space to delete a space template or 'Confluence Administrator' global permission to delete a global template.

    Parameters

    • params: {
          contentTemplateId: string;
      }
      • contentTemplateId: string

        The ID of the template to be deleted.

    Returns Promise<void>

    DELETE /wiki/rest/api/template/{contentTemplateId} @scopes-current write:confluence-content @scopes-beta write:template:confluence

  • Method to initialize the class. Normally used to set up validation rules.

    Returns void