Appearance
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/assignHeaders ​
| Header | Required | Description |
|---|---|---|
x-nextinteract-company-api-key | Yes | Admin-specific API key UUID provided to company |
Parameters ​
| Parameter | Type | Required | Description |
|---|---|---|---|
userId | Number | Yes | UserId to assign to given Team(s) |
teams | Array of Numbers | Yes | Array of one or more TeamIds to assign (returned via getPublicMITeams API) |
sendNotification | Boolean | No | Flag to indicate a notification is to be sent. Defaults to false |
notificationMsg | String[1024] | No | Optional 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 ​
| Exception | Description |
|---|---|
WSInvalidParameterException | See Error Definitions |
WSRecordNotFoundException | See Error Definitions |
WSCompanyApiKeyNotActiveException | See Error Definitions |
WSCompanyNotActiveException | See Error Definitions |
WSUserNotFoundException | See Error Definitions |
WSUserNotActiveException | See Error Definitions |
WSConnectionStatusNotActiveException | See Error Definitions |
WSIncorrectApiKeyTypeException | See Error Definitions |
WSCompanyServiceException | See Error Definitions |
WSMembershipServiceException | See Error Definitions |