Skip to main content

 Services

Web services from /about to /webhooks

list member memberships

/members/{member}/memberships [GET]

Description

This service returns the list of group memberships for a given member.

Only memberships with the status “normal” or “invited” are included.

Parameters

NameDescriptionRequiredTypeDefault
archivedWhether to return archived projects/groups onlynobooleanfalse
extendedmemberWhether to return extended information for member (administrators or self only)nobooleanfalse
inheritedWhether to return inherited memberships (guest project memberships inherited from child group membership)nobooleanfalse
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.

extendedmember

When set to true, the member includes the attributes from the extended format such as created, activated, lastlogin and admin.

Only the member themselves or an administrator can use this parameter. The parameter is ignored otherwise.

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 idattributes: 

<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 of 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.

Combining parameters

Assuming a user was a member of group sample-a and sample-b. Group sample-a is archived and is now archive-sample-a and sample-b is a subgroup of sample-c.  

archivedinheritedsubgroupsMemberships returned
falsefalsetruesample-b, sample-c  (default)
falsefalsefalsesample-b
falsetruetruesample-b, sample-c , sample
falsetruefalsesample-bsample
truefalsetruearchive-sample-a
truefalsefalsearchive-sample-a
truetruetruearchive-sample-a, archive-sample, archive
truetruefalsearchive-sample-a, archive-sample, archive

Permission

Only the member herself or an administrator can invoke this service.

Response

The response includes the <member> and the <membership> elements sorted alphabetically based on the name of the group.

<memberships>
  <member id="[member id]"
          firstname="[first name]"
          surname="[surname]"
          username="[username]"
          status="[activated|unactivated|set-password]">
    <fullname>[full name]</fullname>
  </member>
  <membership [id="[membership id]"]
              email-listed="[true|false]"
              notification="[notification]"
              status="normal"
              role="[role]"
              [subgroups="[subgroups]"]
              [created="[date]"]>
    <group|project id="[group id]"
                   name="[group name]"
                   description="[description]"
                   owner="[owner]"
                   [relatedurl="[url]"] />
    <details>
      <field position="1"
             name="[field name]"
             editable="[true|false]"
             [title="[field title]"]
             [type="[field type]"]>
               [field value]
      </field>
      ...
    </details>
  </membership>
  <membership status="invited" ...> ...
  </membership>
  ...
</memberships>

Example

In this example, user Joan Smith belongs to groups acme-asia and acme-australia:

<memberships>
  <member id="123"
          firstname="Joan"
          surname="Smith"
          username="jsmith"
          status="activated">
        <fullname>Joan Smith</fullname>
  </member>
  <membership id="1234"
              email-listed="true"
              notification="immediate"
              status="normal"
              role="manager">
    <group id="4"
           name="acme-asia"
           description="Demo group for Asia" />
  </membership>
  <membership id="9876"
              email-listed="true"
              notification="immediate"
              status="normal"
              role="manager">
    <group id="5"
           name="acme-australia"
           description="Demo group for Australia" />
  </membership>
</memberships>

Or in JSON:

{
  "member": {
    "id": 123,
    "firstname": "Joan",
    "surname": "Smith",
    "username": "jsmith",
    "status": "activated",
    "fullname": "Joan Smith"
  },
  "memberships": [
    {
      "id": 1234,
      "emailListed": true,
      "notification": "immediate",
      "status": "normal",
      "role": "manager",
      "group": {
        "id": 4,
        "name": "acme-asia",
        "description": "Demo group for Asia"
      }
    },
    {
      "id": 9876,
      "emailListed": true,
      "notification": "immediate",
      "status": "normal",
      "role": "manager",
      "group": {
        "id": 5,
        "name": "acme-australia",
        "description": "Demo group for Australia"
      }
    }
  ]
}

Example: subgroup

Example of memberships that include a subgroup.

In the example below, John Smith is a member of acme-asia only because they are a member of acme-japan which is a subgroup of acme-asia:

<memberships>
  <member id="3"
          firstname="John"
          surname="Smith"
          username="jsmith"
          email="jsmith@example.org"
          status="activated">
    <fullname>John Smith</fullname>
  </member>
  <membership id="123"
              email-listed="true"
              notification="immediate"
              status="normal"
              role="reviewer"
              subgroups="acme-japan">
    <group id="4"
           name="acme-asia"
           description="Demo group for Asia" />
  </membership>
  <membership id="987"
              email-listed="true"
              notification="immediate"
              status="normal"
              role="manager">
    <group id="5"
           name="acme-japan"
           description="Demo group for Japan" />
  </membership>
</memberships>

If the subgroups parameter is set to false , the response does not include the acme-asia group:

<memberships>
  <member id="3"
          firstname="John"
          surname="Smith"
          username="jsmith"
          email="jsmith@example.org"
          status="activated">
    <fullname>John Smith</fullname>
  </member>
  <membership id="987"
              email-listed="true"
              notification="immediate"
              status="normal"
              role="manager">
    <group id="5"
           name="acme-japan"
           description="Demo group for Japan" />
  </membership>
</memberships>

Error Handling

No specific error handling.

Created on , last edited on