Class MicrosoftTeamsFunctions

java.lang.Object
flexagon.fd.services.groovy.functions.BaseFunctions
flexagon.fd.services.groovy.functions.MicrosoftTeamsFunctions
Direct Known Subclasses:
WebhookMicrosoftTeamsFunctions

public class MicrosoftTeamsFunctions extends BaseFunctions
Utility functions for Microsoft Teams
Since:
5.4
  • Field Details

  • Constructor Details

    • MicrosoftTeamsFunctions

      public MicrosoftTeamsFunctions(LogFunctions pFLOG)
  • Method Details

    • getGroovyKey

      public String getGroovyKey()
      Specified by:
      getGroovyKey in class BaseFunctions
    • cleanup

      public void cleanup()
      Specified by:
      cleanup in class BaseFunctions
    • sendTeamsWebhookMessage

      public void sendTeamsWebhookMessage(String pWebhookUrl, String pMessageTitle, String pMessageText, String pIconURL) throws FlexCheckedException
      Sends a Microsoft Teams message to an Incoming Webhook associated to a team channel.
      Parameters:
      pWebhookUrl - - The URL to send the message to
      pMessageTitle - - Optional Title of the message
      pMessageText - The text for the message content. Can be plain text or html.
      pIconURL - The URL for the icon of the sender of the message.
      Throws:
      FlexCheckedException - All exceptions
      Since:
      5.5.0.2 See https://docs.microsoft.com/en-us/outlook/actionable-messages/message-card-reference for information about Message Cards.
    • sendTeamsWebhookMessage

      public void sendTeamsWebhookMessage(String pWebhookUrl, Object pMessage) throws FlexCheckedException
      Sends a Microsoft Teams message to a team channel.
      Parameters:
      pWebhookUrl -
      pMessage -
      Throws:
      FlexNotFoundException - When no Teams Account found for given code
      FlexCheckedException - All other exceptions
      Since:
      5.5.0.2
    • createCalendarEvent

      public void createCalendarEvent(String pTeamsMessagingAccountCode, JSONObject pCalendarEvent, String pUser) throws FlexCheckedException
      Creates a calendar Event Requires a Teams Messaging Integration Account.
      Parameters:
      pTeamsMessagingAccountCode - - The messaging account code for the Teams account.
      pCalendarEvent - - JSON based on off of the website https://learn.microsoft.com/en-us/graph/api/user-post-events?view=graph-rest-1.0&tabs=http
      pUser - - Optional user's calendar to create the event on. If null, the event is created for the Teams Messaging Integration Account user.
      Throws:
      FlexCheckedException
      Since:
      6.5.0.9