API call to set new member's role in organisation fails with 'no operation found'
AnsweredI'm trying to assign a member to an organisation using API operation "Organizations: Set organization member role" as described in:
https://developers.podio.com/doc/organizations/set-organization-member-role-935214
PUT /org/{org_id}/member/{user_id}/role
Sets the role for the given user in the given organization. If the user is not a member of the organization, the user will be added, otherwise the role will just be updated.
Parameters
org_id*Required.user_id*Required.
Request
{
"role": The new role, either "regular" or "admin"
}
Unfortunately, the following request
{ method: 'PUT',
url: 'https://api.podio.com/org/107465/member/934579/role',
headers: { Authorization: 'OAuth2 19b...0ea' },
json: { role: 'regular' } }
fails with error message:
{ error_propagate: false,
error_parameters: {},
error_detail: null,
error_description: 'No matching operation could be found. The path \'/org/107465/member/934579/role\' was not found..',
error: 'not_found' }
I access Podio API from Node.js application using direct REST calls, no Podio client libraries involved.
The API request has been sent on behalf of user 697657 that has 'admin role' in organisation 107465. The user 934579 was not a member of org 107465 before this API call, I assume that it should be added to org during the call as defined in the documentation.
I am able retrieve the information about this organization with the admin user's credentials both using Podio API Sandbox and from my own app.
Is there any limitation of using "Set organization member role" call from API?
Thank you
--
Edmundas
-
We removed the Set organization member role operation a while back. Unfortunately we forgot to remove the documentation for it.
It has been replaced by two new methods:
- https://developers.podio.com/doc/organizations/add-organization-admin-50854 to make a user an org admin
- https://developers.podio.com/doc/organizations/remove-organization-admin-50855 to make the user a regular org member again.
Sorry for the confusion.
-
Thanks Casper, I suspected that the operation was removed from the API. I assume that the replacement method "Add organisation admin" cannot add users who do not yet belong to the organisation.
I still have the related problem to solve.
A few months ago you recommended to use request/accept membership API calls as a method to add a new user to a workspace:
https://groups.google.com/d/msg/podio-api/X-zWCFRa9Rw/jdJXS9auELsJ
It's even easier than suggested in this post since "Request Membership" returns the request id that can be immediately used by "Accept Membership", no notifications needed.
However, the above approach works only with the users who already are members of the organization that owns the workspace. For other Podio users the membership request returns error:
error: 'forbidden', error_description: 'The user with id nnn does not have the right view on org with id mmm'
We are looking for a straighforward way to add existing Podio users as external members to a workspace including those from a different organisation. The operation would be performed under credentials of the new member to be added who requests the membership followed by another call under credentials of the admin of the workspace to accept the request.
Similar action can be performed manually using Podio UI but we couldn't find a set of API calls to do the same. The removed "Set organisation member role" operation looked like the right way to achieve it. We don't ask for an operation to add new users to Podio, just a possibility for existing Podio users to access our workspace without the hassle of manual administration.
Any suggestions?
-
We've had reservations about making the API method for adding people to work spaces publicly available , because it could potentially be used for spam. However, we are currently working on a more fine-grained level of control and checking for this method. We hope to be able make this available in a few weeks, and then you will be able to add existing Podio users to any of your work spaces, but not invite new users to Podio - at least not without getting extra permissions, which is something we handle on a case by case basis.
I can't share the documentation with you before we make the method public, but if you want to get an idea of how it works you can look in our Ruby client - we also use this internally, so it already calls the method: https://github.com/podio/podio-rb/blob/master/lib/podio/models/space_invitation.rb#L44
Please sign in to leave a comment.
Comments
4 comments