/
subscription_member_set ()

subscription_member_set ()

Function prototype

subscription_member_set ( session, member )

API Version

All

Supported interfaces

SOAP, REST (Since API Version 2.7.27)

Description

Links a user/team to a subscription with the selected roles.

The member provided is added as a member of the SUBSCRIPTION

Required permissions: The active user must have role TEAM_MANAGER in the SUBSCRIPTION’s owner TEAM. Otherwise an INSUFFICIENT_PRIVILEGES error will be returned.

Input parameters:

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

  • member: XML with the user/team reference, the role list (with references). The XML structure must contain:

    • ref: A reference to the USER or TEAM. It must be a concatenation of the member type (USER or TEAM) and the reference to the member. Examples:

      • “USER/36277”

      • “TEAM/351”

    • program

      • ref: PROGRAM reference. This field is ignored if a specific SUBSCRIPTION reference is passed. This value is used along with the team node to locate the SUBSCRIPTION is passed in node subscription

    • team

      • ref: Reference of the SUBSCRIPTION's owner TEAM. This field is ignored if a specific SUBSCRIPTION reference is passed in node subscription. This value is used along with the program node to locate the SUBSCRIPTION. If not provided, the active SESSION’s TEAM will be assumed.

    • subscription: reference to the SUBSCRIPTION from which the member will be detached. If not provided, then the SUBSCRIPTION will be determined by the combination of program and team.

    • role_list: List of roles that must be assigned to the member

Output parameters:

  • result: empty

  • 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

subscription_member_set ( “LCAAAAAAAAAAAA”, "<?xml version="1.0" encoding="UTF-8"?> <member> <ref>TEAM/801</ref> <subscription> <ref>762</ref> </subscription> <role_list> <role> <ref>24</ref> </role> </role_list> </member>")

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

SUBSCRIPTION.NOT_FOUND

The SUBSCRIPTION reference provided does not correspond to an existing SUBSCRIPTION

TEAM.NOT_FOUND

The TEAM member reference provided does not correspond to a valid TEAM

USER.NOT_PRESENT

The USER member reference provided does not correspond to a valid USER

INSUFFICIENT_PRIVILEGES

The session user does not have the necessary privileges to manage the members of the SUBSCRIPTION



Related content