REST API v2 - Get attachment by id does not return the media type information

XMLWordPrintable

    • Severity 3 - Minor

      Issue Summary

      The Confluence REST API endpoint V2 "Get attachment by ID" does not return the MediaType information, as it should, according to the documentation.

      Steps to Reproduce

      1. For the same attachment id call the V1 and V2 endpoints and compare the results.

      Expected Results

      The MediaType information is returned for both calls.

      Actual Results

      The mediaType information is not returned when calling the v2 endpoint:

      • V1 (The Confluence Cloud REST API)
        {
         [...]
            "metadata":
            {
                "mediaType": "image/jpeg"
            },
            "extensions":
            {
                "mediaType": "image/jpeg",
                "fileSize": 11019764,
                "comment": "",
                "mediaTypeDescription": "JPEG Image",
                "fileId": "0265f0bb-f800-4c81-82e0-45459e07c732",
                "collectionName": "contentId-29458434"
         [...]
        }
        
      • V2 (The Confluence Cloud REST API )
        {
         [...]
         "title": "DSC_0292.JPG",
         "fileSize": null,
         "status": "current",
         "fileId": null,
         "mediaType": null, // <<< wrong!
         [...]
        }
        

       

      Workaround

      Continue to use the V1 endpoint for the time being. However, this is not a valid workaround for long since these endpoints will soon no longer be accessible but this issue should be reviewed before the deprecation rules out.

            Assignee:
            Unassigned
            Reporter:
            Vinicius Benedini
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: