Start a conversation

Retrieving all the Archived Messages

Added in 24.11.

Use the archivedMessages query to retrieve all the archived messages.

The constraints for the archivedMessages query are:

Field Description Required
nodeId The node ID where you want to retrieve all the archived messages information. No
archivedBy The community member ID who archived the messages. No
postType The content type. Supported values:
FORUM, BLOG, TKB, IDEA, CONTEST, GROUP, OCCASION
No
archivedDate The archived date range.
Supported values:
PAST_24_HOURS, PAST_WEEK, PAST_MONTH, PAST_YEAR
No
authorId The author ID of a message No

Use the example query below to retrieve all the archived messages of a community.

{
  archivedMessages(
    constraints: {
      nodeId: { eq: "community:Docscommunity" }
      archivedBy: { eq: "user:1" }
      postType: { eq: IDEA }
      archivedDate: { eq: PAST_YEAR }
      authorId: { eq: "user:1" }
    }
    sorts: { archivedDate: { direction: ASC } }
    first: 5
  ) {
    totalCount
    edges {
      node {
        message {
          subject
          uid
          conversation {
            style
          }
        }
        archiver {
          uid
        }
      }
    }
  }
}

The GraphQL response:

{
  "data": {
    "archivedMessages": {
      "totalCount": 1,
      "edges": [
        {
          "node": {
            "message": {
              "subject": "Content Improvement",
              "uid": 3513,
              "conversation": {
                "style": "IDEA"
              }
            },
            "archiver": {
              "uid": 1
            }
          }
        }
      ]
    }
  }
}
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. ATLAS

  2. Posted
  3. Updated

Comments