/
team_member_add ()

team_member_add ()

Function prototype

team_member_add (session, team, member, type, [roles])

API Version

2.7.25 and higher

Supported interfaces

SOAP, REST (Since API Version 2.7.32)

Description

Adds an existing USER as member of a TEAM with the specified roles

 

This action can only be done if the caller has the necessary privileges, which are:

Required permissions:

  • The active user is TEAM_EDITOR or TEAM_MANAGER of team

  • The active user has role TEAM_EDITOR or TEAM_MANAGER into a TEAM that is member of team with role TEAM_MANAGER

Otherwise an INSUFFICIENT_PRIVILEGES error will be returned.

Input parameters:

  • session: is the session token obtained in the session_init() call

  • team: reference to the parent TEAM where the TEAM referenced by member is member

  • member: reference to the member that will be appended as member of the team.

  • type: type of member ("USER" or "TEAM")

  • roles: a comma separated list of roles that must be assigned to the TEAM

Output parameters:

  • result:

    • type: type of member added (USER / TEAM)

    • ref: internal reference of the member added. Note that it can be different than the value passed in the member parameter because it could be a reference to an external source (HIS), and the value returned is always the local ID of the member added.

    • validation: This information is generated only if an error of type CONTACT_DATA.VALIDATION happens. See CONTACT DATA VALIDATION for a detailed explanation of the validation information

  • ErrorMsg: If any error occurs, then this value contains a description of the error translated to the current language

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

Request example

team_member_add (“LC53060c6f729de8.42629546”, 5335, 342, "USER", "24")

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

INSUFFICIENT_PRIVILEGES

The active user does not have the appropriate permissions to execute the action

TEAM_NOT_FOUND

The TEAM member reference specified was not found

USER_NOT_FOUND

The member reference specified was not found (if it is a USER member)

WRONG_PARAMS

The value specified in type is not a valid value

 

Related content