How to get merge proposal vote details via WS API?
I want to get vote information for a merge proposal, most specifically the set of users that have been requested to review.
I know that this information is available via the votes_collectio
https:/
However, the response from that WS call is
{"total_size": 2, "start": 0, "entries": [], "resource_
As you see the entries array is empty, even though the total_size is 2. So I cannot tell how I am supposed to get the actual data.
If I use python launchpadlib, I can get the votes as I would expect and they are populated, but I need to do this from Javascript using simple WS calls. (I have been trying to figure out how I can sniff the WS calls that launchpadlib actually makes, but since it's https: so far I have been unsuccessful.)
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- 2012-10-31
- Last reply:
- 2012-10-31
| William Grant (wgrant) said : | #1 |
Some types of objects aren't currently available unless you're authenticated. The account's privileges don't matter for those votes, just that you're authenticated as any account at all. However, why are you trying to use the Launchpad API from JavaScript? Launchpad doesn't support JSONP, CORS, or other cross-site request technologies, so you're going to be somewhat limited in terms of the sort of requests you can make from a browser.
You can set httplib2.debuglevel (before using launchpadlib) to see the request details:
$ python
Python 2.7.3 (default, Sep 26 2012, 21:51:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from launchpadlib.
>>> import httplib2
>>> httplib2.debuglevel = 1
>>> lp = Launchpad.
connect: (api.launchpad.net, 443)
send: 'GET /devel/ HTTP/1.1\r\nHost: api.launchpad.
| Chris Hillery (ceejatec) said : | #2 |
Ok, thanks; that's interesting. Why would this particular case require authentication? I can go to the corresponding webpage (https:/
Would it be worth filing a bug requesting that the requirement for authentication be removed for this case?
As to why I'm using Javascript: Because my use case is loading Launchpad information into a Google Docs spreadsheet. The language for programming Google Docs is Javascript. I already have a fairly extensive spreadsheet managing our Launchpad bug information, which is populated via Javascript scripts that just hit Launchpad URLs and consume the JSON output. I wanted to extend this management spreadsheet to track outstanding merge proposals as well, when I hit this wall.
I'm not sure how to proceed here; I don't know how to provide credential information when I'm just hitting a WS URL. I'll keep investigating. Thanks for the information about debugging with httplib2; that may help me answer the question.
Can you help with this problem?
Provide an answer of your own, or ask Chris Hillery for more information if necessary.
