Get Chat Messages
Automatically get Chat Messages on teams.microsoft.com. Read messages from a 1:1 Teams chat by contact name. Finds the person, opens their chat, and returns every currently-loaded message with sender, ISO timestamp and text. Needs no admin or export permission.
Input
contactName requiredDisplay name of the person whose 1:1 chat to open, as it appears in Teams (e.g. "April Deere").
Output
messages requiredcontactName requiredFAQ
Send Chat Message
Send a message in a 1:1 Teams chat by contact name — finds the person, opens their chat, sends the message, then reads the sent message back to confirm it posted.
Edit Chat Message
Edit one of your own previously-sent messages in a 1:1 Teams chat, identified by its message id (mid), replacing its text.
Teams whoami
Report which Microsoft Teams account this browser is signed in as — work or personal: email, name, whether it is a personal (consumer) or work account, and which Teams host it lives on (personal accounts are redirected to teams.live.com). Being signed out is reported as a normal answer (loggedIn false), not an error, so it can be used to check a session — and pick the right Teams host — before running other Teams scripts.
