API: Dead links in Changeset Comments resource (BB-8599)

Issue #7340 resolved
Juha Kuitunen
created an issue

content_rendered field used to have links to changesets (hash) and issues (#{number}) in relative format starting with / and there was missing only https://bitbucket.org prefix. Now you have added a new prefix https://api.bitbucket.org/ to these links even though they are not valid API links, e.g. they lack 1.0/. It seems that you only need to remove api. subdomain from them.

Comments (6)

  1. Michael Frauenholtz staff

    Hi Juha,

    I'm looking into this issue, but I think I need some more information. Can you tell me which API URL you are calling? And if possible can you paste some sample output from that call? Once I know a little more I can try to resolve this.


  2. Juha Kuitunen reporter

    GET https://api.bitbucket.org/1.0/repositories/{accountname}/{repo_slug}/changesets/{raw_node}/comments/

    Tested with http://restbrowser.bitbucket.org/ https://api.bitbucket.org/1.0/repositories/saibotd/bitbeaker/changesets/ac83344dc16bb0d9afcaed3921d4e94ce67b97ca/comments/ has a @mention of user. Result includes these fields

    "content": "Testing... Thanks @ZeroOne3010 :)",
    "content_rendered": "<p>Testing... Thanks <a href="https://api.bitbucket.org/ZeroOne3010" rel="nofollow" title="@ZeroOne3010" class="mention">Ville Saalo</a> :)</p>"

    As you can see content_rendered field has link pointing to https://api.bitbucket.org/ZeroOne3010 when it should be https://bitbucket.org/ZeroOne3010
    If I remember correctly this applies also to commit hashes and issue numbers like this #7340

    Ps. This issue #6474 is semi-related ;)

  3. Michael Frauenholtz staff
    • changed status to open

    Hi Juha,

    Bitbucket has two different URLs to access the API:

    • https://api.bitbucket.org/1.0/
    • https://bitbucket.org/api/1.0/

    They will both access the same data, but the subdomain in the first URL can cause problems like this. I've added a ticket to our internal issue tracker to get this fixed, but for now you should be able to use the second URL and get the correct information.


  4. Log in to comment