Skip to main content
Version: 2026.0

teams

This class establishes the JDITO connection to send various Microsoft Graph API requests from the designer

Methods

addApp

addApp(pTeamId, pAppId): void

Adds an app to a team

Works with an application token Requires this permission: Group.ReadWrite.All

Parameters

pTeamId
string | number | boolean

the TeamId to which the application should be assigned

pAppId
string | number | boolean

the AppId, the App which should be assigned to the team (To be found in TeamsAdminCenter, provided the App has been provided for the organization)

Returns

void

Throws

AditoException


addExternalMembers

addExternalMembers(pTeamId, pExternalUsers): Map<any, any>

Adds any number of new external members to the transferred team

Works with an application token Requires these permissions: Group.ReadWrite.All and Directory.ReadWrite.All

Parameters

pTeamId
string | number | boolean

The TeamId to which the members are to be added

pExternalUsers

the ExternalUserConfigs of the users to be added

Returns

Map<any, any>

the failed Ids; null if all successful

Throws

AditoException


addInternalMembers

addInternalMembers(pTeamId, pInternalUsers): Map<any, any>

Adds any number of new internal members to the team

Works with an application token Requires one of these permissions: Group.ReadWrite.All, Directory.ReadWrite.All

Parameters

pTeamId
string | number | boolean

The TeamId to which the members are to be added

pInternalUsers

The userconfigs, the user to be added

Returns

Map<any, any>

the failed Ids; null if all successful

Throws

AditoException


archiveTeam

archiveTeam(pTeamId): void

Archive the team and delete the Azure group

INFO: When Office 365 groups are deleted, they are moved to a temporary container and can be restored within 30 days. After this period they are permanently deleted Archive team before deleting group, because bug in teams leads to the team still being available

Works with an application token Requires one of these permissions: Group.ReadWrite.All, Directory.ReadWrite.All (archive + delete)

Parameters

pTeamId
string | number | boolean

the TeamId of the team to be deleted or archived

Returns

void

Throws

AditoException


changeRole

changeRole(pTeamId, pUserConfig): void

Changes the role of a team member. If the team member is an owner, he is removed from the owners. If he is only a member, he will be added to the Owners

Works with an application token Requires one of these permissions: Group.ReadWrite.All, Directory.ReadWrite.All

Parameters

pTeamId
string | number | boolean

the TeamId in which the member is a member

pUserConfig

the UserConfig of the member

Returns

void

Throws

AditoException


createChannel

createChannel(pChannelConfig): void

Creates a new channel in a specific team

Works with an application token Requires one of these permissions: Group.ReadWrite.All, Directory.ReadWrite.All

Parameters

pChannelConfig

The ChannelConfig object

Returns

void

Throws

AditoException


createChannelConfig

createChannelConfig(pTeamId, pDisplayName): ChannelConfig

Create and return a config object for GraphAPI calls to create channels

Parameters

pTeamId
string | number | boolean
pDisplayName
string | number | boolean

Returns

ChannelConfig


createExternalUserConfig

createExternalUserConfig(pEmail): ExternalUserConfig

Create and return a config object for GraphAPI calls to add external members

Parameters

pEmail
string | number | boolean

Returns

ExternalUserConfig


createGroupConfig

createGroupConfig(pDisplayName, pMailNickName, pOwnerIds): GroupConfig

Create and return a config object for GraphAPi calls to create teams

Parameters

pDisplayName
string | number | boolean
pMailNickName
string | number | boolean
pOwnerIds
string[]

Returns

GroupConfig


createInternalUserConfig

createInternalUserConfig(pAzureUserId): InternalUserConfig

Create and return a config object for GraphAPI calls to add internal members

Parameters

pAzureUserId
string | number | boolean

Returns

InternalUserConfig


createTeam

createTeam(pGroupConfig, pTeamConfig): Map<any, any>

Creates a new Azure Active Directory group, adds its owner and creates a MicrosoftTeams team

Works with an application token Requires this permission: Group.ReadWrite.All

Parameters

pGroupConfig

The GroupConfig object

pTeamConfig

The TeamConfig object

Returns

Map<any, any>

the Id, DisplayName, GeneralChannelId and WebUrl of the created team in a ScriptableMap

Throws

AditoException


createTeamConfig

createTeamConfig(): TeamConfig

Create and return a config object for GraphAPI calls to create teams

Returns

TeamConfig


getAllArchivedTeams

getAllArchivedTeams(pSearchValue): Map<any, any>

Lists all archived teams

INFO: Through the GraphAPI you can not call specific resources in Java and a call without specific resource is not allowed => CustomRequest

Works with an application token Requires one of these permissions: Group.Read.All, Directory.Read.All, Group.ReadWrite.All, Directory.ReadWrite.All

Without search term, this query returns up to 100 results The search term starts only from the beginning of the string: 'B' returns only teams with the initial letter 'B...'.

Parameters

pSearchValue
string | number | boolean

a search term after all teams are filtered; can be null

Returns

Map<any, any>

The Id's and DisplayNames of all archived teams

Throws

AditoException


getAllChannels

getAllChannels(pTeamId, pSearchValue): Map<any, any>

Delivers all channels from one team

Works with an application token Requires one of these permissions: Group.Read.All, Group.ReadWrite.All, Directory.Read.All, Directory.ReadWrite.All

INFO: Without search term, this query may return more than 100 results The search term starts only from the beginning of the string: 'B' returns only channels with the initial letter 'B...'.

Parameters

pTeamId
string | number | boolean

the TeamId of which team, the channels are to be delivered

pSearchValue
string | number | boolean

a search term by which all channels are filtered; can be null

Returns

Map<any, any>

a ScriptableMap with Id and names of the channels

Throws

AditoException


getAllDocuments

getAllDocuments(pTeamId, pChannelName): any

Delivers all documents of the handed over team and handed over channels have been sent.

INFO: The permissions "Group.ReadWrite.All" and "Group.Create" do not seem to be compatible. You have to remove "Group.Create" for this to work => bug in GraphAPI.

Works with an application token Requires one of these permissions: Files.Read.All, Files.ReadWrite.All, Sites.Read.All, Sites.ReadWrite.All

Parameters

pTeamId
string | number | boolean

The TeamId from which the documents are to be retrieved

pChannelName
string | number | boolean

the name of the channel from which the files should be retrieved; Channel Name = Sharepoint Folder Name

Returns

any

A RhinoObject, that all documents of the passed channel are stored in a JsonArray construct with relevant data

Throws

AditoException


getAllMembers

getAllMembers(pTeamId): Map<any, any>

Returns all members from a given team

Works with an application token Requires one of these permissions: GroupMember.Read.All, Group.Read.All, GroupMember.ReadWrite.All, Group.ReadWrite.All, Directory.Read.All

Parameters

pTeamId
string | number | boolean

the TeamId from which the members are to be returned

Returns

Map<any, any>

a ScriptableMap with Id(key) and displayName(value) from all members of the team

Throws

AditoException


getAllOwners

getAllOwners(pTeamId): Map<any, any>

Returns all owners from a handed over team

Works with an application token Requires one of these permissions: Group.Read.All, Group.ReadWrite.All, Directory.Read.All, Directory.AccessAsUser.All

Parameters

pTeamId
string | number | boolean

the TeamId from which the members are to be returned

Returns

Map<any, any>

a ScriptableMap with Id(key) and displayName(value) from all members of the team

Throws

AditoException


getAllTeams

getAllTeams(pSearchValue): Map<any, any>

Returns all groups that also have a team in MicrosoftTeams.

INFO: For this you need a $filter query. The filter "resourceProvisioningOptions" is so far only available with the beta endpoint => CustomRequest No permissions on MSDocs here; it is assumed that it works with an application token and the permission Group.Read.All Without search term, this query returns up to 100 results The search term starts only from the beginning of the string: 'B' returns only teams with the initial letter 'B...'.

Works with an application token Requires one of these permissions: Group.Read.All, Directory.Read.All, Group.ReadWrite.All, Directory.ReadWrite.All

Parameters

pSearchValue
string | number | boolean

a search term after all teams are filtered; can be null

Returns

Map<any, any>

a ScriptableMap with Id's(key) and DisplayNames(value) from all teams

Throws

AditoException


getAnswerForMessageId

getAnswerForMessageId(pTeamId, pChannelId, pMessageId): any

Returns the answers for a given id of a message.

INFO: This request is currently in beta! => Works only with CustomRequest Protected API => User-Token

Works with a user token Requires this permission: ChannelMessage.Read.All

Example:

Parameters

pTeamId
string | number | boolean

The TeamId in which the channel is located, whose messages are retrieved

pChannelId
string | number | boolean

The ChannelId from which the message was retrieved

pMessageId
string | number | boolean

The id of the message, we want to load the answers

Returns

any

A RhinoObject with all answers

Throws

AditoException


Example

import { teams, logging } from "@aditosoftware/jdito-types";

var teamsId = "18c204da-4632-4840-8096-ee8dc765cae9";
var channelId = "19:_mEqssJ0Q9me5CiRoXwbgVCbMGpTk4-837HfNPYFRpc1@thread.tacv2";
var messageId = "1676983133368";
var answers = teams.getAnswerForMessageId(teamsId, channelId, messageId);
logging.log(JSON.stringify(answers));

getChannelMessages

getChannelMessages(pTeamId, pChannelId, pAmount): any

Returns the channel messages of a handed over channel, without answers, as Json Array

INFO: This request is currently in beta! => Works only with CustomRequest Protected API => User-Token

Works with a user token Requires this permission: ChannelMessage.Read.All

Only Plain Text Messages will be loaded

See getChannelMessages(String pTeamId, String pChannelId, int pAmount, boolean pIncludeFormattedMessages)

Parameters

pTeamId
string | number | boolean

The TeamId in which the channel is located, whose messages are retrieved

pChannelId
string | number | boolean

The ChannelId from which the messages are retrieved

pAmount
number

The number of messages that are retrieved - defaultValue=20

Returns

any

A RhinoObject with a link for the next messages and with all messages, with relevant data from the passed channel

Deprecated

This API is deprecated.

Throws

AditoException

getChannelMessages(pTeamId, pChannelId, pAmount, pIncludeFormattedMessages): any

Returns the channel messages of a handed over channel, without answers, as Json Array

INFO: This request is currently in beta! => Works only with CustomRequest Protected API => User-Token

Works with a user token Requires this permission: ChannelMessage.Read.All

Only Plain Text Messages will be loaded

See getChannelMessages(String pTeamId, String pChannelId, int pAmount, boolean pIncludeFormattedMessages)

Parameters

pTeamId
string | number | boolean

The TeamId in which the channel is located, whose messages are retrieved

pChannelId
string | number | boolean

The ChannelId from which the messages are retrieved

pAmount
number

The number of messages that are retrieved - defaultValue=20

pIncludeFormattedMessages
undefined

Include Messages with HTML content, otherwise only TEXT

Returns

any

A RhinoObject with a link for the next messages and with all messages, with relevant data from the passed channel

Deprecated

This API is deprecated.

Throws

AditoException

getChannelMessages(pTeamId, pChannelId, pAmount, pIncludeFormattedMessages): any

Returns the channel messages of a handed over channel, without answers, as Json Array

INFO: This request is currently in beta! => Works only with CustomRequest Protected API => User-Token

Works with a user token Requires this permission: ChannelMessage.Read.All

Parameters

pTeamId
string | number | boolean

The TeamId in which the channel is located, whose messages are retrieved

pChannelId
string | number | boolean

The ChannelId from which the messages are retrieved

pAmount
number

The number of messages that are retrieved - defaultValue=20

pIncludeFormattedMessages
boolean

Include Messages with HTML content, otherwise only TEXT

Returns

any

A RhinoObject with a link for the next messages and with all messages, with relevant data from the passed channel

Throws

AditoException


getGeneralChannelId

getGeneralChannelId(pTeamId): string

Supplies from a team the Id of the general channel

Works with an application token Requires one of these permissions: Group.Read.All, Group.ReadWrite.All, Directory.Read.All, Directory.ReadWrite.All

Parameters

pTeamId
string | number | boolean

the TeamId from which the id of the general channel should be delivered

Returns

string

The id of the general channel

Throws

AditoException


getInternalAzureId

getInternalAzureId(pUserUpn): string

Returns the Azure user ID of the passed UserUPN

Works with an application token Requires one of these permissions: User.Read.All, User.ReadWrite.All, Directory.Read.All, Directory.ReadWrite.All

Parameters

pUserUpn
string | number | boolean

the UserPrincipableName of the user

Returns

string

the AzureId as string

Throws

AditoException


getNextChannelMessages

getNextChannelMessages(pNextLinkUrl, pAmount): any

Delivers the next messages

INFO: Top Parameter is already contained in the pURL, it is used by the previous query, but is still needed

Works with a user token Requires this permission: ChannelMessage.Read.All

Only Plain Text Messages will be loaded

See getNextChannelMessages(String pNextLinkUrl, int pAmount, boolean pIncludeFormattedMessages)

Parameters

pNextLinkUrl
string | number | boolean

the Url to retrieve the next messages; is obtained from the function getChannelMessages in the response

pAmount
number

The number of messages that are retrieved - defaultValue=20

Returns

any

A RhinoObject with a link for the next messages and with all further messages, with relevant data

Deprecated

This API is deprecated.

Throws

AditoException

getNextChannelMessages(pNextLinkUrl, pAmount, pIncludeFormattedMessages): any

Delivers the next messages

INFO: Top Parameter is already contained in the pURL, it is used by the previous query, but is still needed

Works with a user token Requires this permission: ChannelMessage.Read.All

Only Plain Text Messages will be loaded

See getNextChannelMessages(String pNextLinkUrl, int pAmount, boolean pIncludeFormattedMessages)

Parameters

pNextLinkUrl
string | number | boolean

the Url to retrieve the next messages; is obtained from the function getChannelMessages in the response

pAmount
number

The number of messages that are retrieved - defaultValue=20

pIncludeFormattedMessages
undefined

Include Messages with HTML content, otherwise only TEXT

Returns

any

A RhinoObject with a link for the next messages and with all further messages, with relevant data

Deprecated

This API is deprecated.

Throws

AditoException

getNextChannelMessages(pNextLinkUrl, pAmount, pIncludeFormattedMessages): any

Delivers the next messages

INFO: Top Parameter is already contained in the pURL, it is used by the previous query, but is still needed

Works with a user token Requires this permission: ChannelMessage.Read.All

Parameters

pNextLinkUrl
string | number | boolean

the Url to retrieve the next messages; is obtained from the function getChannelMessages in the response

pAmount
number

The number of messages that are retrieved - defaultValue=20

pIncludeFormattedMessages
boolean

Include Messages with HTML content, otherwise only TEXT

Returns

any

A RhinoObject with a link for the next messages and with all further messages, with relevant data

Throws

AditoException


getPresence

getPresence(pUserObjectId): any

Returns a users presence/status. Use getInternalAzureId to get the objectId for a users upn

Works with a user token Requires one of these permissions: Presence.Read.All, Presence.ReadWrite.All

Parameters

pUserObjectId
string | number | boolean

The users object id

Returns

any

A json object with nodes id, availability, activity

Throws

AditoException


getPresences

getPresences(pUserObjectIds): any

Returns presence/status for a list of users. Use getInternalAzureId to get the objectId for a users upn

Works with a user token Requires one of these permissions: Presence.Read.All, Presence.ReadWrite.All

Parameters

pUserObjectIds
string[]

The users object ids as array

Returns

any

A json object in which the node "value" contains an array whose nodes contain id, availability, activity or null if the parameter is empty

Throws

AditoException


getWebUrl

getWebUrl(pTeamId): string

Delivers the WebUrl of a team.

Works with an application token Requires one of these permissions: Group.Read.All, Directory.Read.All, Group.ReadWrite.All, Directory.ReadWrite.All

Parameters

pTeamId
string | number | boolean

the TeamId from which the WebUrl is to be retrieved

Returns

string

the WebUrl as string

Throws

AditoException


removeExternalMembers

removeExternalMembers(pTeamId, pExternalUsers): Map<any, any>

Removes external members from the transferred team

Works with an application token Requires one of these permissions: Group.ReadWrite.All, Directory.ReadWrite.All

Parameters

pTeamId
string | number | boolean

the TeamId from which the members should be removed

pExternalUsers

The external userconfigs, the user to be removed

Returns

Map<any, any>

the failed Ids; null if all successful

Throws

AditoException


removeInternalMembers

removeInternalMembers(pTeamId, pInternalUsers): Map<any, any>

Removes internal members from the transferred team

Works with an application token Requires one of these permissions: Group.ReadWrite.All, Directory.ReadWrite.All

Parameters

pTeamId
string | number | boolean

the TeamId from which the members should be removed

pInternalUsers

The userconfigs, the users to be removed

Returns

Map<any, any>

the failed Ids; null if all successful

Throws

AditoException


sendAnswerToBotRequest

sendAnswerToBotRequest(pMessage, pRecipientId, pRecipientName, pServiceUrl, pConversationId, pMessageId): void

Sends a response to the BotRequest.

Parameters

pMessage
string | number | boolean

The message to be sent as reply

pRecipientId
string | number | boolean

The id of the recipient of the message

pRecipientName
string | number | boolean

The name of the recipient of the message

pServiceUrl
string | number | boolean

The ServiceUrl; This is what you get in the request that comes in

pConversationId
string | number | boolean

The ConversationId of this conversation is also given in the request

pMessageId
string | number | boolean

The id of the message to which you want to reply

Returns

void

Throws

AditoException


sendNotification

sendNotification(pServiceUrl, pChannelId, pMessage): void

Sends a notification/message on behalf of the bot to the General Channel

INFO: ChannelId = ConversationId For this notification you need a Bot-OAuth2 token. You can't get it from GraphAPI or ScribeJava => Normal HttpRequest to the Botframework token endpoint

Parameters

pServiceUrl
string | number | boolean

The ServiceUrl that was used for the initial request (to be found in the DB)

pChannelId
string | number | boolean

the ChannelId of the channel to which you want to send

pMessage
string | number | boolean

The message/notification to be sent

Returns

void

Throws

AditoException


sendNotificationAsCard

sendNotificationAsCard(pServiceUrl, pChannelId, pMessage, pUser, pUrlToProject): void

Sends a notification/message as a card on behalf of the bot to the General Channel

INFO: ChannelId = ConversationId For this notification you need a Bot-OAuth2 token. You can't get it from GraphAPI or ScribeJava => Normal HttpRequest to the Botframework token endpoint

Parameters

pServiceUrl
string | number | boolean

The ServiceUrl that was used for the initial request (to be found in the DB)

pChannelId
string | number | boolean

the ChannelId of the channel to which you want to send

pMessage
string | number | boolean

The message/notification to be sent

pUser
string | number | boolean

The user who have changed something

pUrlToProject
string | number | boolean

The url to the project itself

Returns

void

Throws

AditoException


unarchiveTeam

unarchiveTeam(pTeamId): void

Restores a team and the Azure group This only works for 30 days from the time the team is deleted. After that it is automatically deleted for good

INFO: The team remains in the "hidden teams

Works with an application token Requires one of these permissions: Group.ReadWrite.All, Directory.ReadWrite.all (unarchive + restore)

Parameters

pTeamId
string | number | boolean

the TeamId of the team to be restored

Returns

void

Throws

AditoException