Details
-
Suggestion
-
Resolution: Won't Fix
Description
When trying to access the /2.0/addon/linkers resource using the request function defined by Bitbucket's Javascript API from the configuration page of an addon I get the folowing result with a 404 response code:
{{
Unable to find source-code formatter for language: "request_failed", message: "request failed". Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
}} Example code: {code:js} AP.require('request', function(request){ request({ url: '/2.0/addon/linkers', success: function(responseText){ console.log(responseText); }, error: function(responseText){ console.log(responseText); } }); });
However, the documentation on the request function states that the XMLHttpRequest is executed "in the context of the host application", so I assume it should have access to all Bitbucket resources the addon / user has access to, and this should include the addon's own linkers.
When doing a request to the /2.0/addon/linkers resource using a JWT token generated for the addon I do get a valid response.