list self memberships
| API Support | Available since | Last updated | Output |
|---|---|---|---|
| 5.0100 | 6.0000 | xml, json |
Description
Get the memberships for the member that is currently authenticated.
Usage
Use this service when you need to know both the identity and memberships of the user that is currently authenticated. This is often the case, immediately after a user has authenticated and only the session ID or access token is known.
If you already know the username or member ID, you can use the /members/{member}/memberships instead.
Parameters
| Name | Description | Required | Type | Default value |
|---|---|---|---|---|
| archived | Whether to return archived projects/groups only | no | boolean | false |
| inherited | Whether to return inherited memberships | no | boolean | false |
| subgroups | Whether to return memberships from subgroups | no | boolean | true |
archived
By default, this service only returns memberships to groups and projects which are not archived.
Use archived=true to only list the memberships to archived groups and projects.
inherited
When a user is a member of a group, they automatically have guest access to the parent project and ancestor projects. However, unless they are added to the parent projects they are not considered members of those projects.
For example, a membership to australia-nsw-sydney provides guest project membership to both australia and australia-nsw parent projects.
Set the inherited parameter to true to include the guest project memberships inherited from child group membership.
Inherited memberships do not have the created , email-listed, notification or id attributes:
<membership status="normal" role="guest" inherited="true">
subgroups
The subgroups parameter controls whether to include groups that the member has access to because they are a member of one their subgroups.
By default, this parameter is true so these groups are included. Set this parameter to false, if you do not want to include these groups.
Unless inherited=true, setting subgroups=false returns only the groups and projects that the user is directly a member of.
Permission
The user must be authenticated.
Response
The response includes the <member> and the <membership> elements are sorted alphabetically based on the name of the group.
<memberships>
<member ... />
<membership ... >
<group|project ... />
<details> ... </details>
</membership>
<membership ... > ... </membership>
...
</memberships>Or in JSON as:
{
"member": { ... },
"memberships": [ { ... }, ... ]
}See /members/{member}/memberships for examples.
Error Handling
| Code | Cause / Description |
|---|---|
| 0x1029 | A member is not logged in |
| 0x102A | Member not found |