The request /rest/api/content/ returns No content found with id for drafts

XMLWordPrintable

    • Type: Bug
    • Resolution: Not a bug
    • Priority: Low
    • None
    • Affects Version/s: 6.13.0
    • None
    • 1
    • Severity 3 - Minor

      Summary

      Fetching draft data using REST will return a 404 error code.

      Steps to Reproduce

      1. Create a page and publish it
      2. Edit the page and exit the editor, choose keep draft if necessary
      3. Get the contentid of the draft
      4. Execute the following REST call to fetch the draft data:
        curl -u <USERNAME>:<PASSWORD> -X GET "http://<DOMAIN>/rest/api/content/<DRAFT-CONTENTID>" | python -mjson.tool
        

      Expected Results

      Draft content is returned as expected.

      Actual Results

      Draft content is not returned. Instead, this is what we see:

      {
          "data": {
              "authorized": false,
              "errors": [],
              "successful": false,
              "valid": true
          },
          "message": "No content found with id: ContentId{id=<ID>}",
          "statusCode": 404
      }
      

      Workaround

      It is not possible to access the content ID for drafts directly. Instead, if you need to fetch draft data, use the content ID of the published version of the page and add status=draft to the request. Example:

      /rest/api/content/101112?status=draft
      

      In this request 101112 is the content ID of the last published version of this page.

            Assignee:
            Unassigned
            Reporter:
            Bernardo Andreeti
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: