Get all accounts and/or projects?`

Jeremy McAnally's Avatar

Jeremy McAnally

27 Feb, 2012 12:51 AM

From the docs/the API functionality, appears that I should be able to send a request to something like http://api.lighthouseapp.com/users/{user_id}/memberships.json and get all the user's memberships across all accounts (assuming their token allows it). I get all that information if I send the request to a specific account (e.g., if I use myaccount.lhapp.com rather than www or api or whatever), but it would be really useful if I could send it to some "general URL" like www.lighthouseapp.com rather than myaccount.lighthouseapp.com to get a user's memberships (basically I need a list of all their projects).

  1. 1 Posted by Nicole on 27 Feb, 2012 10:35 PM

    Nicole's Avatar

    Jeremy -

    Does http://my.lighthouseapp.com/users/{user_id}/memberships.json give you the results you're looking for?

    Let us know.

    Thanks,
    Nicole

  2. 2 Posted by Jeremy McAnally on 28 Feb, 2012 12:16 AM

    Jeremy McAnally's Avatar

    Hi Nicole,
    That was actually my first instinct, but it keeps giving me an error that
    that API key isn't valid for that account. I also tried www but it said
    that account doesn't exist (obviously).

    I think "my" is probably *supposed* to be where I'd do that, but either my
    token is funky or it's a bug!

    Thanks,
    Jeremy

  3. 3 Posted by Hobson on 28 Feb, 2012 07:13 PM

    Hobson's Avatar

    Hi Jeremy,

    It's not currently possible to query membership information for users besides yourself. It's important to remember that users belong to themselves, and not an account, so having ownership rights on a Lighthouse account does not afford any special access to Lighthouse user resources. Now, in the case of this endpoint, I think it would be reasonable to show memberships for public/shared projects, but that's something we'll need to add. I can make a ticket to address this, and let you know here when it's done or we have more information.

    Hope this helps,

    -hobson

  4. 4 Posted by Jeremy McAnally on 28 Feb, 2012 07:32 PM

    Jeremy McAnally's Avatar

    That doesn't make sense because if I know one of their accounts, I can get all of their memberships for all accounts by hitting the /users/:id/memberships action.

     All I need is the project or account memberships for the user whose token I'm using. I have their token already. Being able to hit the "my" subdomain for that info seems perfectly logical.

    -j

    Sent from my iPhone

  5. 5 Posted by Hobson on 29 Feb, 2012 08:21 PM

    Hobson's Avatar

    Yes, it's correct to use your own subdomain for API calls, and if you're using the token of the user whose membership you're querying, then you should be able to see all of their memberships. You are correct that this info is available from the web site but not the API, so this seems like a simple oversight. As I said, we can correct this, so I'll make a ticket and we'll let you know when it's fixed.

    Thanks for bringing this to our attention,

    -hobson

  6. Nicole closed this discussion on 02 Jul, 2012 09:05 PM.

Discussions are closed to public comments.
If you need help with Lighthouse please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac