Hierarchy

  • CommonHttpService
    • BlogPostService

Constructors

  • Internal

    Create a new instance of the service.

    Parameters

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

    Returns BlogPostService

Methods

  • Creates a new blog post in the space specified by the spaceId.

    By default this will create the blog post as a non-draft, unless the status is specified as draft. If creating a non-draft, the title must not be empty.

    Currently only supports the storage representation specified in the body.representation enums below

    Parameters

    • params: {
          private?: boolean;
          requestBody: {
              body?: BlogPostBodyWrite | BlogPostNestedBodyWrite;
              createdAt?: string;
              spaceId: string;
              status?: "current" | "draft";
              title?: string;
          } & {
              [key: string]: unknown;
          };
      }
      • Optionalprivate?: boolean

        The blog post will be private. Only the user who creates this blog post will have permission to view and edit one.

      • requestBody: {
            body?: BlogPostBodyWrite | BlogPostNestedBodyWrite;
            createdAt?: string;
            spaceId: string;
            status?: "current" | "draft";
            title?: string;
        } & {
            [key: string]: unknown;
        }

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

    Returned if the blog post was created successfully.

  • Delete a blog post by id.

    By default this will delete blog posts that are non-drafts. To delete a blog post that is a draft, the endpoint must be called on a draft with the following param draft=true. Discarded drafts are not sent to the trash and are permanently deleted.

    Deleting a blog post that is not a draft moves the blog post to the trash, where it can be restored later. To permanently delete a blog post (or "purge" it), the endpoint must be called on a trashed blog post with the following param purge=true.

    Permissions required: Permission to view the blog post and its corresponding space. Permission to delete blog posts in the space. Permission to administer the space (if attempting to purge).

    Parameters

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

        If attempting to delete a blog post that is a draft.

      • id: number

        The ID of the blog post to be deleted.

      • Optionalpurge?: boolean

        If attempting to purge the blog post.

    Returns Promise<void>

    DELETE /blogposts/{id} @scopes-current delete:page:confluence

  • Returns a specific blog post.

    Permissions required: Permission to view the blog post and its corresponding space.

    Parameters

    • params: {
          bodyFormat?: PrimaryBodyRepresentationSingle;
          getDraft?: boolean;
          id: number;
          includeCollaborators?: boolean;
          includeFavoritedByCurrentUserStatus?: boolean;
          includeLabels?: boolean;
          includeLikes?: boolean;
          includeOperations?: boolean;
          includeProperties?: boolean;
          includeVersion?: boolean;
          includeVersions?: boolean;
          includeWebresources?: boolean;
          status?: (
              | "current"
              | "draft"
              | "historical"
              | "trashed"
              | "deleted")[];
          version?: number;
      }
      • OptionalbodyFormat?: PrimaryBodyRepresentationSingle

        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.

      • OptionalgetDraft?: boolean

        Retrieve the draft version of this blog post.

      • id: number

        The ID of the blog post to be returned. If you don't know the blog post ID, use Get blog posts and filter the results.

      • OptionalincludeCollaborators?: boolean

        Includes collaborators on the blog post.

      • OptionalincludeFavoritedByCurrentUserStatus?: boolean

        Includes whether this blog post has been favorited by the current user.

      • OptionalincludeLabels?: boolean

        Includes labels associated with this blog post 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.

      • OptionalincludeLikes?: boolean

        Includes likes associated with this blog post 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 blog post 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 blog post 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 blog post 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 blog post 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.

      • OptionalincludeWebresources?: boolean

        Includes web resources that can be used to render blog post content on a client.

      • Optionalstatus?: (
            | "current"
            | "draft"
            | "historical"
            | "trashed"
            | "deleted")[]

        Filter the blog post being retrieved by its status.

      • Optionalversion?: number

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

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

    Returned if the requested blog post is returned.

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

  • Returns all blog posts. 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 access the Confluence site ('Can use' global permission). Only blog posts that the user has permission to view will be returned.

    Parameters

    • params: {
          bodyFormat?: PrimaryBodyRepresentation;
          cursor?: string;
          id?: number[];
          limit?: number;
          sort?: BlogPostSortOrder;
          spaceId?: number[];
          status?: ("current" | "trashed" | "deleted")[];
          title?: string;
      } = {}
      • OptionalbodyFormat?: PrimaryBodyRepresentation

        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.

      • 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 blog post ids. Multiple blog post ids can be specified as a comma-separated list.

      • Optionallimit?: number

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

      • Optionalsort?: BlogPostSortOrder

        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.

      • Optionalstatus?: ("current" | "trashed" | "deleted")[]

        Filter the results to blog posts based on their status. By default, current is used.

      • Optionaltitle?: string

        Filter the results to blog posts based on their title.

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

    Returned if the requested blog posts are returned.

  • Returns all blog posts in a 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 access the Confluence site ('Can use' global permission) and view the space. Only blog posts that the user has permission to view will be returned.

    Parameters

    • params: {
          bodyFormat?: PrimaryBodyRepresentation;
          cursor?: string;
          id: number;
          limit?: number;
          sort?: BlogPostSortOrder;
          status?: ("current" | "trashed" | "deleted")[];
          title?: string;
      }
      • OptionalbodyFormat?: PrimaryBodyRepresentation

        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.

      • 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 blog posts should be returned.

      • Optionallimit?: number

        Maximum number of blog posts 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?: BlogPostSortOrder

        Used to sort the result by a particular field.

      • Optionalstatus?: ("current" | "trashed" | "deleted")[]

        Filter the results to blog posts based on their status. By default, current is used.

      • Optionaltitle?: string

        Filter the results to blog posts based on their title.

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

    Returned if the requested blog posts are returned.

    GET /spaces/{id}/blogposts @scopes-current read:page:confluence

  • Returns the blogposts of specified label. 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 content of the page and its corresponding space.

    Parameters

    • params: {
          bodyFormat?: PrimaryBodyRepresentation;
          cursor?: string;
          id: number;
          limit?: number;
          sort?: BlogPostSortOrder;
          spaceId?: number[];
      }
      • OptionalbodyFormat?: PrimaryBodyRepresentation

        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.

      • 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 label for which blog posts should be returned.

      • Optionallimit?: number

        Maximum number of blog posts 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?: BlogPostSortOrder

        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.

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

    Returned if the requested blog posts for specified label were successfully fetched.

    GET /labels/{id}/blogposts @scopes-current read:page:confluence

  • Update a blog post by id.

    Permissions required: Permission to view the blog post and its corresponding space. Permission to update blog posts in the space.

    Parameters

    • params: {
          id: number;
          requestBody: {
              body: BlogPostBodyWrite | BlogPostNestedBodyWrite;
              createdAt?: string;
              id: string;
              spaceId?: string;
              status: "current" | "draft";
              title: string;
              version: {
                  message?: string;
                  number?: number;
              } & {
                  [key: string]: unknown;
              };
          } & {
              [key: string]: unknown;
          };
      }
      • id: number

        The ID of the blog post to be updated. If you don't know the blog post ID, use Get Blog Posts and filter the results.

      • requestBody: {
            body: BlogPostBodyWrite | BlogPostNestedBodyWrite;
            createdAt?: string;
            id: string;
            spaceId?: string;
            status: "current" | "draft";
            title: string;
            version: {
                message?: string;
                number?: number;
            } & {
                [key: string]: unknown;
            };
        } & {
            [key: string]: unknown;
        }

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

    Returned if the requested blog post is successfully updated.

    PUT /blogposts/{id} @scopes-current write:page:confluence

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

    Returns void