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

REST API GET title parameter not working with UTF-8 characters

      NOTE: This bug report is for Confluence Cloud. Using Confluence Server? See the corresponding bug report.

      Summary

      REST API GET title parameter doesn't work with UTF-8 characters

      Steps to Reproduce

      1. Create a page with the "Обзор" title
      2. Run the following cURL
        curl -u admin:admin -X GET "http://localhost:8090/confluence/rest/api/content?title=Обзор&spaceKey=<space-key>"
        

      Expected Results

      The GET command returns all the page's information.

      Actual Results

      The code doesn't work and returns:

      {"results":[],"start":0,"limit":25,"size":0,"_links":{"self":"http://localhost:8090/confluence/rest/api/content?spaceKey=GP&title=%C3%90%C2%9E%C3%90%C2%B1%C3%90%C2%B7%C3%90%C2%BE%C3%91%C2%80","base":"http://localhost:8090/confluence","context":"/confluence"}}
      

      Notes

      POST cURL works for the "Обзор" word:

      curl -u admin:admin -X POST -H 'Content-Type: application/json' -d'{"type":"page","title":"1. Обзор","space":{"key":"GP"},"body":{"storage":{"value":"<p>This is a new page</p>","representation":"storage"}}}' http://localhost:8090/confluence/rest/api/content/
      

      Workaround

      Use the pageid= instead of the title=

      curl -u admin:admin -X GET "http://localhost:8090/confluence/rest/api/content?pageid=10813474&spaceKey=GP"
      

          Form Name

            [CONFCLOUD-42670] REST API GET title parameter not working with UTF-8 characters

            Atlassian Update – 2019/Oct/15

            Hi Everyone,

            We have recently reviewed this issue and the overall interest in the problem. As the issue hasn't collect votes, watchers, comments, or support cases from many customers during its lifetime, it's very low on our priority list, and will not be fixed in the foreseeable future. That's why we've decided to resolve it as Timed Out.

            Although we're aware the issue is still important to those of you who were involved in the conversations around it, we want to be clear in managing your expectations. The Confluence team is focusing on issues that have broad impact and high value, reflected by the number of comments, votes, support cases, and customers interested. Please consult the Atlassian Bugfix Policy for more details.

            We understand how disappointing this decision may be, but we hope you'll appreciate our transparent approach and communication.
            Atlassian will continue to watch this issue for further updates, so please feel free to share your thoughts in the comments.

            Thank you,
            Ryan Talusan
            Confluence Cloud Ecosystem

            Ryan Talusan added a comment - Atlassian Update – 2019/Oct/15 Hi Everyone, We have recently reviewed this issue and the overall interest in the problem. As the issue hasn't collect votes, watchers, comments, or support cases from many customers during its lifetime, it's very low on our priority list, and will not be fixed in the foreseeable future. That's why we've decided to resolve it as Timed Out . Although we're aware the issue is still important to those of you who were involved in the conversations around it, we want to be clear in managing your expectations. The Confluence team is focusing on issues that have broad impact and high value, reflected by the number of comments, votes, support cases, and customers interested. Please consult the Atlassian Bugfix Policy for more details. We understand how disappointing this decision may be, but we hope you'll appreciate our transparent approach and communication. Atlassian will continue to watch this issue for further updates, so please feel free to share your thoughts in the comments. Thank you, Ryan Talusan Confluence Cloud Ecosystem

            I've observed the following during development in relation to UTF-8 Titles:

            1) Initial GET fails as shown above after creating via the REST API (no results returned even though it should match)

            2) Retrying the exact same request succeeds (it fixes itself). I have also observed a glitch in the Confluence UI itself - create an article as shown above via REST. But instead of calling a get after browse it in the UI. What I've seen on my instance is in the UI its title is corrupt as ????? but refreshing the page fixes it. After doing the refresh the GET works as well.

            3) Posting an Update to the content of the article with a UTF-8 title permanently corrupts the title. Refreshing and retrying does not correct it.

            I have made sure to set the following headers:
            Accept: application/json;charset=UTF-8
            Content-Type: application/json;charset=UTF-8

            I've also made sure that the title the query param is properly URL encoded, but the problem persists. This only happens with the title - any UTF-8 characters in the article content are fine.

            In my case, I am querying by title to see if an article exists yet as part of determining whether to do an create vs update for a given block of content, so I can't query by the page id because it is not known if it exists yet. As such, the suggested workaround of using page id does not work for me.

            I observed this on Confluence 5.9.7. I upgraded my instance to 5.9.10 and it did not fix the problem.

            Aaron Knight added a comment - I've observed the following during development in relation to UTF-8 Titles: 1) Initial GET fails as shown above after creating via the REST API (no results returned even though it should match) 2) Retrying the exact same request succeeds (it fixes itself). I have also observed a glitch in the Confluence UI itself - create an article as shown above via REST. But instead of calling a get after browse it in the UI. What I've seen on my instance is in the UI its title is corrupt as ????? but refreshing the page fixes it. After doing the refresh the GET works as well. 3) Posting an Update to the content of the article with a UTF-8 title permanently corrupts the title. Refreshing and retrying does not correct it. I have made sure to set the following headers: Accept: application/json;charset=UTF-8 Content-Type: application/json;charset=UTF-8 I've also made sure that the title the query param is properly URL encoded, but the problem persists. This only happens with the title - any UTF-8 characters in the article content are fine. In my case, I am querying by title to see if an article exists yet as part of determining whether to do an create vs update for a given block of content, so I can't query by the page id because it is not known if it exists yet. As such, the suggested workaround of using page id does not work for me. I observed this on Confluence 5.9.7. I upgraded my instance to 5.9.10 and it did not fix the problem.

              Unassigned Unassigned
              gviana Guilherme V. (Inactive)
              Affected customers:
              1 This affects my team
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: