team_membership_list ()

team_membership_list ()

Function prototype

team_membership_list (session, team, with_permissions, [filter], [user])

API Version

All

Supported interfaces

SOAP, REST (Since API Version 2.7.31)

Description

Returns a list of TEAMs in which the specified TEAM is member

Returns a list of parent Teams in which the specified team is member (a child).

If a User reference is provided, then a parent Team will only be included if the user has a Role in the child Team that matches the Roles that the child Team has in the Parent Team.

For example, consider the following situation:

  • A Team named "Cardiology" is member of another Team named "Hospital" with Role "Case Manager"

  • The user 1234 is member of "Cardiology" with Role "Staff"

If we request the memberships of the Team "Cardiology" without specifying a User, then the result will include the Team "Hospital", because "Cardiology" is member of "Hospital".

If we request the memberships of the Team "Cardiology" for the User 1234 , then the result will NOT include the Team "Hospital", because "Cardiology" is member of "Hospital" only with Role "Case Manager", and the User is hasn't that Role in "Cardiology".

Input parameters:

  • session: Session token obtained by calling session_init ()

  • team: TEAM reference about which you want to know the memberships.

  • with_permissions: (default = 1) 

    • 0 = don't send membership roles

    • 1 = send membership roles

  • filter: (optional) comma separated string with a list of Roles. If provided, only memberships where the TEAM has the specified ROLES will be returned. For example: “24,37”

  • user: (optional) If a User reference is provided, then return only the Teams where the User has any Role through the specified Team. Introduced in API Version 2.7.32

Output parameters:

  • result / membership_list: XML with information about the memberships of the TEAM

    • team: Information about a parent TEAM where the requested TEAM is member

      • ref: reference of the parent TEAM

      • code: TEAM CODE. Introduced in API Version 2.7.19

      • name: Name of the TEAM

      • type: Type of TEAM. See TEAM.CATEGORY CODES

      • active: (true/false) Indicates if the current TEAM is active. Introduced in API Version 2.7.19

      • pictures: images of the TEAM. Introduced in API Version 2.7.19

      • assignments: List of ROLES of the TEAM in the parent TEAM

        • role: Information about each ROLE

          • ref: Reference of the ROLE (e.g. 24 = CASE MANAGER)

          • name: Description of the ROLE in the active SESSION language

          • profiles/profile: list of profiles. Some ROLES have a sub-classification in "profiles" (sub-roles). For example, roles "Team Manager" and "Program Manager" are considered profiles of the parent ROLE “Admin”. See ROLE OBJECT.

            • ref: Reference of the ROLE (e.g. 24 = CASE MANAGER)

            • name: Description of the ROLE in the active SESSION language

  • ErrorMsg: any fault in the call, either in the validation of input parameters, errors in the connection to the database or any other error, this parameter returns the error message produced.

  • ErrorCode: If any error occurs, then this value contains any of the standard ERROR CODES

Request example

team_membership_list (“LC53060c6f729de8.42629546”, 51)

Response

The response format is XML when the function has been invoked via the SOAP API, and JSON when it has been invoked via the REST API

Return Error codes

ERROR CODE

 

ERROR CODE

 

INVALID_TOKEN

The session token provided is not valid

TEAM.NOT_FOUND

The TEAM was not found