Post

2 followers Follow
0
Avatar

Getting spaces that users belong to

I am working on creating a connector for our product that connects to our Podio organization and returns all the org users and the spaces that each user are in. I cannot find an easy way to get the user->spaces relationship using the API. The best way so far I have found is to get a list of all the spaces in the org, then iterate through this list and get each space, then get the members of that space, then I would have to figure out how to associate each space back to an individual user. 

Please tell me there is an easier way to get all the spaces that a user has access to.

Bryan Bible Answered

Please sign in to leave a comment.

10 comments

0
Avatar

Excellent!! Don't know how I missed that one. So if I want to target a specific user then do I just pass it in as a query string?

e.g. ?user_id=123456

Bryan Bible 0 votes
0
Avatar

You can only get this list for the user you are authenticated as. The data is private and not shared among users.

Andreas Haugstrup Pedersen 0 votes
0
Avatar

So that takes me back to square 1. My connector needs to get the list of spaces for every user in our Org. We are a Compliance and Governance software company and part of our internal procedures are to review our customers and partners access to our podio workspaces. I am able to get the list of users in our Org and now I need to be able to get each users entitlements (spaces and role in the space). My connector logs in as an Org admin and I am trying to find an easier way to get the data that what I outlined in my initial posting. Does one exist?

Bryan Bible 0 votes
0
Avatar

Christian,

Thanks for the new REST API, I tested this and it works great except it is quite slow compared to the other REST API calls. Is this just inherent in the way it has to gather the data?

Bryan Bible 0 votes
0
Avatar

Hi Bryan

It should be quite fast. I had a look at the metrics and I can see that the calls you have been making have an average response time of 15ms. In my book that is pretty quick and I doubt we can make it much quicker.

Are you sure you are not making calls in a loop or there is some other issue?

Christian Holm 0 votes
0
Avatar

Christian,Yes that is plenty fast, perhaps there is something in my code that is causing the slowness. I will continue to check there.

Thanks again for this great solution!

Bryan

Bryan Bible 0 votes
0
Avatar

Christian,

I did some timings for that call from my class and I am seeing ~700ms per user for this call:

 spaceMemberURL = api_url + "/org/" + org_id + "/member/" + user_id + "/space_member/";

Here are some of my timings:

2013-01-30 16:11:14,708 DEBUG QuartzScheduler_Worker-2 openconnector.PodioConnector:141 - Before space_member

2013-01-30 16:11:15,433 DEBUG QuartzScheduler_Worker-2 openconnector.PodioConnector:143 - After space_member

2013-01-30 16:11:15,433 DEBUG QuartzScheduler_Worker-2 openconnector.PodioConnector:141 - Before space_member

2013-01-30 16:11:16,155 DEBUG QuartzScheduler_Worker-2 openconnector.PodioConnector:143 - After space_member

2013-01-30 16:11:16,155 DEBUG QuartzScheduler_Worker-2 openconnector.PodioConnector:141 - Before space_member

2013-01-30 16:11:16,886 DEBUG QuartzScheduler_Worker-2 openconnector.PodioConnector:143 - After space_member

2013-01-30 16:11:16,887 DEBUG QuartzScheduler_Worker-2 openconnector.PodioConnector:141 - Before space_member

2013-01-30 16:11:17,616 DEBUG QuartzScheduler_Worker-2 openconnector.PodioConnector:143 - After space_member

 

Was just wondering if you could investigate this again on your end?

Thanks,

Bryan Bible

Bryan Bible 0 votes
0
Avatar

I am very sure it is fast. It must be something on your end. Make sure you set the access token, so it doesn't need to get a new token for each request.

Christian Holm 0 votes