Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-76424

Confluence Search Content API return 404 NotFoundException

XMLWordPrintable

      Issue Summary

      User is seeing a 404 instead of a regular response when calling search content API.

      Steps to Reproduce

      I'm hitting the following API:

      https://api.atlassian.com/ex/confluence/CloudId/rest/api/content/search

      With the parameters:

      cql:(type=page or type=blogpost or type=attachment) and lastModified >= "2023/08/08 17:00" and lastModified <"2023/08/09 17:05"
      expand:history.lastUpdated,container,restrictions,ancestors,restrictions.read.restrictions.user,restrictions.update.restrictions.user,space
      cursor:_sa_WyJcdDU3Mzc2Nzk5IGVrYmBEVUE3OWpeWUxJWU03Sy9VIGNwIl0

      The goal is to get all the contents created/modified within a given timeframe.
      I'm expecting a response with the "results" array containing "0" or more contents.

      However, the result I observed is :

      {
      "statusCode": 404,
      "data": {
      "authorized": false,
      "valid": false,
      "errors": [
      {
      "message":

      { "translation": "Cannot find content <attachment: 1231234 v.1>. Outdated version/old_draft/trashed? Please provide valid ContentId.", "args": [] }

      }
      ],
      "successful": false
      },
      "message": "com.atlassian.confluence.api.service.exceptions.NotFoundException: Cannot find content <attachment: 1231234 v.1>. Outdated version/old_draft/trashed? Please provide valid ContentId."
      }

      Expected Results

       a response with the "results" array containing "0" or more contents.

      Actual Results

      User is seeing a 404 instead of a regular response.

      Workaround

      Remove "type=attachment" or remove all the "restrictions.*" expansion in the search query, 

              ywang2@atlassian.com Ying Wang
              ywang2@atlassian.com Ying Wang
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated: