Hierarchy

  • CommonHttpService
    • CustomContentService

Constructors

  • Internal

    Create a new instance of the service.

    Parameters

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

    Returns CustomContentService

Methods

  • Creates a new custom content in the given space, page, blogpost or other custom content.

    Only one of spaceId, pageId, blogPostId, or customContentId is required in the request body. Permissions required: Permission to view the content of the page or blogpost and its corresponding space. Permission to create custom content in the space.

    Parameters

    • params: {
          requestBody: {
              blogPostId?: string;
              body: CustomContentBodyWrite | CustomContentNestedBodyWrite;
              customContentId?: string;
              pageId?: string;
              spaceId?: string;
              status?: "current" | "draft";
              title: string;
              type: string;
          } & {
              [key: string]: unknown;
          };
      }
      • requestBody: {
            blogPostId?: string;
            body: CustomContentBodyWrite | CustomContentNestedBodyWrite;
            customContentId?: string;
            pageId?: string;
            spaceId?: string;
            status?: "current" | "draft";
            title: string;
            type: string;
        } & {
            [key: string]: unknown;
        }

    Returns Promise<CustomContentSingle & {
        _links?: {
            base?: string;
        } & {
            [key: string]: unknown;
        };
    } & {
        [key: string]: unknown;
    }>

    Returned if the requested custom content is created successfully.

    POST /custom-content @scopes-current write:custom-content:confluence

  • Delete a custom content by id.

    Deleting a custom content will either move it to the trash or permanently delete it (purge it), depending on the apiSupport. To permanently delete a trashed custom content, the endpoint must be called with the following param purge=true.

    Permissions required: Permission to view the content of the page or blogpost and its corresponding space. Permission to delete custom content in the space. Permission to administer the space (if attempting to purge).

    Parameters

    • params: {
          id: number;
          purge?: boolean;
      }
      • id: number

        The ID of the custom content to be deleted.

      • Optionalpurge?: boolean

        If attempting to purge the custom content.

    Returns Promise<void>

    DELETE /custom-content/{id} @scopes-current delete:custom-content:confluence

  • Returns a specific piece of custom content.

    Permissions required: Permission to view the custom content, the container of the custom content, and the corresponding space (if different from the container).

    Parameters

    • params: {
          bodyFormat?: CustomContentBodyRepresentationSingle;
          id: number;
          includeCollaborators?: boolean;
          includeLabels?: boolean;
          includeOperations?: boolean;
          includeProperties?: boolean;
          includeVersion?: boolean;
          includeVersions?: boolean;
          version?: number;
      }
      • OptionalbodyFormat?: CustomContentBodyRepresentationSingle

        The content format types to be returned in the body field of the response. If available, the representation will be available under a response field of the same name under the body field.

        Note: If the custom content body type is storage, the storage and atlas_doc_format body formats are able to be returned. If the custom content body type is raw, only the raw body format is able to be returned.

      • id: number

        The ID of the custom content to be returned. If you don't know the custom content ID, use Get Custom Content by Type and filter the results.

      • OptionalincludeCollaborators?: boolean

        Includes collaborators on the custom content.

      • OptionalincludeLabels?: boolean

        Includes labels associated with this custom content in the response. The number of results will be limited to 50 and sorted in the default sort order. A meta and _links property will be present to indicate if more results are available and a link to retrieve the rest of the results.

      • OptionalincludeOperations?: boolean

        Includes operations associated with this custom content in the response, as defined in the Operation object. The number of results will be limited to 50 and sorted in the default sort order. A meta and _links property will be present to indicate if more results are available and a link to retrieve the rest of the results.

      • OptionalincludeProperties?: boolean

        Includes content properties associated with this custom content in the response. The number of results will be limited to 50 and sorted in the default sort order. A meta and _links property will be present to indicate if more results are available and a link to retrieve the rest of the results.

      • OptionalincludeVersion?: boolean

        Includes the current version associated with this custom content in the response. By default this is included and can be omitted by setting the value to false.

      • OptionalincludeVersions?: boolean

        Includes versions associated with this custom content in the response. The number of results will be limited to 50 and sorted in the default sort order. A meta and _links property will be present to indicate if more results are available and a link to retrieve the rest of the results.

      • Optionalversion?: number

        Allows you to retrieve a previously published version. Specify the previous version's number to retrieve its details.

    Returns Promise<CustomContentSingle & {
        _links?: {
            base?: string;
        } & {
            [key: string]: unknown;
        };
    } & {
        [key: string]: unknown;
    }>

    Returned if the requested custom content is returned.

    GET /custom-content/{id} @scopes-current read:custom-content:confluence

  • Returns all custom content for a given type. The number of results is limited by the limit parameter and additional results (if available) will be available through the next URL present in the Link response header.

    Permissions required: Permission to view the custom content, the container of the custom content, and the corresponding space (if different from the container).

    Parameters

    • params: {
          bodyFormat?: CustomContentBodyRepresentation;
          cursor?: string;
          id?: number[];
          limit?: number;
          sort?: CustomContentSortOrder;
          spaceId?: number[];
          type: string;
      }
      • OptionalbodyFormat?: CustomContentBodyRepresentation

        The content format types to be returned in the body field of the response. If available, the representation will be available under a response field of the same name under the body field.

        Note: If the custom content body type is storage, the storage and atlas_doc_format body formats are able to be returned. If the custom content body type is raw, only the raw body format is able to be returned.

      • Optionalcursor?: string

        Used for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results.

      • Optionalid?: number[]

        Filter the results based on custom content ids. Multiple custom content ids can be specified as a comma-separated list.

      • Optionallimit?: number

        Maximum number of pages per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results.

      • Optionalsort?: CustomContentSortOrder

        Used to sort the result by a particular field.

      • OptionalspaceId?: number[]

        Filter the results based on space ids. Multiple space ids can be specified as a comma-separated list.

      • type: string

        The type of custom content being requested. See: https://developer.atlassian.com/cloud/confluence/custom-content/ for additional details on custom content.

    Returns Promise<{
        _links?: MultiEntityLinks;
        results?: CustomContentBulk[];
    } & {
        [key: string]: unknown;
    }>

    Returned if the requested custom content is returned.

    GET /custom-content @scopes-current read:custom-content:confluence

  • Returns all custom content for a given type within a given blogpost. The number of results is limited by the limit parameter and additional results (if available) will be available through the next URL present in the Link response header.

    Permissions required: Permission to view the custom content, the container of the custom content (blog post), and the corresponding space.

    Parameters

    • params: {
          bodyFormat?: CustomContentBodyRepresentation;
          cursor?: string;
          id: number;
          limit?: number;
          sort?: CustomContentSortOrder;
          type: string;
      }
      • OptionalbodyFormat?: CustomContentBodyRepresentation

        The content format types to be returned in the body field of the response. If available, the representation will be available under a response field of the same name under the body field.

        Note: If the custom content body type is storage, the storage and atlas_doc_format body formats are able to be returned. If the custom content body type is raw, only the raw body format is able to be returned.

      • Optionalcursor?: string

        Used for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results.

      • id: number

        The ID of the blog post for which custom content should be returned.

      • Optionallimit?: number

        Maximum number of pages per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results.

      • Optionalsort?: CustomContentSortOrder

        Used to sort the result by a particular field.

      • type: string

        The type of custom content being requested. See: https://developer.atlassian.com/cloud/confluence/custom-content/ for additional details on custom content.

    Returns Promise<{
        _links?: MultiEntityLinks;
        results?: CustomContentBulk[];
    } & {
        [key: string]: unknown;
    }>

    Returned if the requested custom content is returned.

    GET /blogposts/{id}/custom-content @scopes-current read:custom-content:confluence

  • Returns all custom content for a given type within a given page. The number of results is limited by the limit parameter and additional results (if available) will be available through the next URL present in the Link response header.

    Permissions required: Permission to view the custom content, the container of the custom content (page), and the corresponding space.

    Parameters

    • params: {
          bodyFormat?: CustomContentBodyRepresentation;
          cursor?: string;
          id: number;
          limit?: number;
          sort?: CustomContentSortOrder;
          type: string;
      }
      • OptionalbodyFormat?: CustomContentBodyRepresentation

        The content format types to be returned in the body field of the response. If available, the representation will be available under a response field of the same name under the body field.

        Note: If the custom content body type is storage, the storage and atlas_doc_format body formats are able to be returned. If the custom content body type is raw, only the raw body format is able to be returned.

      • Optionalcursor?: string

        Used for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results.

      • id: number

        The ID of the page for which custom content should be returned.

      • Optionallimit?: number

        Maximum number of pages per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results.

      • Optionalsort?: CustomContentSortOrder

        Used to sort the result by a particular field.

      • type: string

        The type of custom content being requested. See: https://developer.atlassian.com/cloud/confluence/custom-content/ for additional details on custom content.

    Returns Promise<{
        _links?: MultiEntityLinks;
        results?: CustomContentBulk[];
    } & {
        [key: string]: unknown;
    }>

    Returned if the requested custom content is returned.

    GET /pages/{id}/custom-content @scopes-current read:custom-content:confluence

  • Returns all custom content for a given type within a given space. The number of results is limited by the limit parameter and additional results (if available) will be available through the next URL present in the Link response header.

    Permissions required: Permission to view the custom content and the corresponding space.

    Parameters

    • params: {
          bodyFormat?: CustomContentBodyRepresentation;
          cursor?: string;
          id: number;
          limit?: number;
          type: string;
      }
      • OptionalbodyFormat?: CustomContentBodyRepresentation

        The content format types to be returned in the body field of the response. If available, the representation will be available under a response field of the same name under the body field.

        Note: If the custom content body type is storage, the storage and atlas_doc_format body formats are able to be returned. If the custom content body type is raw, only the raw body format is able to be returned.

      • Optionalcursor?: string

        Used for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results.

      • id: number

        The ID of the space for which custom content should be returned.

      • Optionallimit?: number

        Maximum number of pages per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results.

      • type: string

        The type of custom content being requested. See: https://developer.atlassian.com/cloud/confluence/custom-content/ for additional details on custom content.

    Returns Promise<{
        _links?: MultiEntityLinks;
        results?: CustomContentBulk[];
    } & {
        [key: string]: unknown;
    }>

    Returned if the requested custom content is returned.

    GET /spaces/{id}/custom-content @scopes-current read:custom-content:confluence

  • Update a custom content by id. At most one of spaceId, pageId, blogPostId, or customContentId is allowed in the request body. Note that if spaceId is specified, it must be the same as the spaceId used for creating the custom content as moving custom content to a different space is not supported.

    Permissions required: Permission to view the content of the page or blogpost and its corresponding space. Permission to update custom content in the space.

    Parameters

    • params: {
          id: number;
          requestBody: {
              blogPostId?: string;
              body: CustomContentBodyWrite | CustomContentNestedBodyWrite;
              customContentId?: string;
              id: string;
              pageId?: string;
              spaceId?: string;
              status: "current";
              title: string;
              type: string;
              version: {
                  message?: string;
                  number?: number;
              } & {
                  [key: string]: unknown;
              };
          } & {
              [key: string]: unknown;
          };
      }
      • id: number

        The ID of the custom content to be updated. If you don't know the custom content ID, use Get Custom Content by Type and filter the results.

      • requestBody: {
            blogPostId?: string;
            body: CustomContentBodyWrite | CustomContentNestedBodyWrite;
            customContentId?: string;
            id: string;
            pageId?: string;
            spaceId?: string;
            status: "current";
            title: string;
            type: string;
            version: {
                message?: string;
                number?: number;
            } & {
                [key: string]: unknown;
            };
        } & {
            [key: string]: unknown;
        }

    Returns Promise<CustomContentSingle & {
        _links?: {
            base?: string;
        } & {
            [key: string]: unknown;
        };
    } & {
        [key: string]: unknown;
    }>

    Returned if the requested custom content is updated successfully.

    PUT /custom-content/{id} @scopes-current write:custom-content:confluence

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

    Returns void