Post

1 follower Follow
0
Avatar

Leaving a space

I can't get the delete function in spaceMember working.

I use the PHP library and do the following:

$api->spaceMember->delete($space['space_id'], $user['user_id']);

The ID's are correct but I get the following message: PodioAuthorizationError

What am I doing wrong?

Peter van den Broek Answered

Please sign in to leave a comment.

4 comments

0
Avatar

You do not have permission to perform that operation. How are you authenticated? Is the user you are authenticated as an admin of the space? If you catch the exception you can get a human-readable error message.

Andreas Haugstrup Pedersen 0 votes
Comment actions Permalink
0
Avatar

I'm authenticated as myself, I loop over all available spaces, join them, perform some action and after this I want to leave those spaces again.

So it's only my own user that has to leave the space after joining it. 

Peter van den Broek 0 votes
Comment actions Permalink
0
Avatar

I get the following message: Only available for clients with a trust level of 2 or higher

Peter van den Broek 0 votes
Comment actions Permalink
0
Avatar

Hi Peter

This is a bit of a tricky case. We have to walk a fine line between allowing full functionality through our API and at the same time protect our users against rogue API clients. We are open by default, so unless we have a specific reason to limit access to an API method, we leave it open. However we do keep a small set of API operations off limits to most API clients. This list mostly includes API operations that deleting main objects like workspaces, but also includes leaving workspaces and removing members. This is to limit the amount of damage a third party API client can do even if they obtain the users consent through the normal OAuth flow.

A way forward could be to explain in more detail what you are trying to achieve. Normally I wouldn't expect a user to join and then leave a workspace in short succession. If you want to keep it confidential you can contact us at support@podio.com.

Christian

Christian Holm 0 votes
Comment actions Permalink