Giter VIP home page Giter VIP logo

teams-chat-backup's Introduction

Microsoft Teams Chat Backup

This project retrieves a full chat history (messages and uploaded files) and renders it as an HTML.

Important notice

The maintainer does no longer have the need for this tool, nor can't find the time to keep it alive. Therefore this repository is set to read-only. If anyone is willing to maintain this utility, feel free to fork this repository.

Requirements

Node.js 10 (or higher). Tested on macOS and Windows, but will most likely run on Linux too.

Setup

Like any other JS project, clone this repo and run the following command to install dependencies:

npm install

Run

To backup a chat, run:

npm run start

This will ask several questions:

Chat ID - this is the identifier of the conversation. To find it:

  1. Go to https://teams.microsoft.com
  2. Go to the chat you'd like to export.
  3. Copy chat ID from URL. It looks like 19:<uuid of one user>-<uuid of other user>@unq.gbl.spaces

Auth token (JWT) - this is needed for calling Microsoft Graph APIs.

  1. Go to https://developer.microsoft.com/en-us/graph/graph-explorer. At the left side, under Authentication, click "Sign In with Microsoft"
  2. After having logged in, on the left side (where you clicked for login), click "modify permissions". Enable Chat.Read and re-login (like it states).
  3. The URL contains the token (#access_token=<long token goes here>). Copy this value. Or make any random call in the sandbox and copy the Authorization request header either from the JS console (without Bearer in front of it) or from the "Access token" tab of the Graph Explorer page.

Target directory name - is the name to use for the export (will be created in the out directory in this project).

Output

An exported chat contains:

  • messages-#####.json: these are the pages of messages. Page 0000 is the most recent one (pages and messages within are in reverse order).
  • image-#####: these are images uploaded in the chat
  • index.html: is the full history rendered into a simple HTML template, referring to the downloaded images. This is the file you want for viewing.

To Do

  • Make an easier way of obtaining a token.
  • Add support for bot messages (for example a form).

teams-chat-backup's People

Contributors

edgraaff avatar dependabot[bot] avatar cicadacinema avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.