Skip to content

assignMemberToTeams ​

Assigns a single User to one (or more) MI Team(s) of a Company given a valid Membership-specific API Key. Can optionally send the user a notification that will appear in MI app's Notification Centre as well as native push notifications (if enabled for device).

Request ​

http
POST /rest/company/membership/teams/assign

Headers ​

HeaderRequiredDescription
x-nextinteract-company-api-keyYesAdmin-specific API key UUID provided to company

Parameters ​

ParameterTypeRequiredDescription
userIdNumberYesUserId to assign to given Team(s)
teamsArray of NumbersYesArray of one or more TeamIds to assign (returned via getPublicMITeams API)
sendNotificationBooleanNoFlag to indicate a notification is to be sent. Defaults to false
notificationMsgString[1024]NoOptional message to send to user. If sendNotification=true and notificationMsg is not provided then the default message used in SAM Team Assignment Notifications will be used

EXAMPLE WITHOUT NOTIFICATION

json
{
        "userId" : 8,
        "teams" : [6, 7]
}
json
{
        "userId" : 8,
        "teams" : [6, 7],
        "sendNotification" : true
}
json
{
        "userId" : 8,
        "teams" : [6, 7],
        "sendNotification" : true,
        "notificationMsg" : "You have been assigned more content blah de blah"
}

Response ​

200 OK ​

json
[
    {
        "teamId": 6,
        "teamName": "Property Investments"
    },
    {
        "teamId": 7,
        "teamName": "Equity Investments"
    }
]

Errors ​

ExceptionDescription
WSInvalidParameterExceptionSee Error Definitions
WSRecordNotFoundExceptionSee Error Definitions
WSCompanyApiKeyNotActiveExceptionSee Error Definitions
WSCompanyNotActiveExceptionSee Error Definitions
WSUserNotFoundExceptionSee Error Definitions
WSUserNotActiveExceptionSee Error Definitions
WSConnectionStatusNotActiveExceptionSee Error Definitions
WSIncorrectApiKeyTypeExceptionSee Error Definitions
WSCompanyServiceExceptionSee Error Definitions
WSMembershipServiceExceptionSee Error Definitions