Skip to main content

 Services

Web services from /about to /webhooks

list self memberships

/self/memberships [GET]

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

NameDescriptionRequiredTypeDefault value
archivedWhether to return archived projects/groups onlynobooleanfalse
inheritedWhether to return inherited membershipsnobooleanfalse
subgroupsWhether to return memberships from subgroupsnobooleantrue

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

CodeCause / Description
0x1029A member is not logged in
0x102AMember not found
Created on , last edited on