Giter VIP home page Giter VIP logo

flee-intercom's Introduction

Flee Intercom!

Tired of Intercom jacking up the price on you and want to go somewhere else, but need to drag your sorry data with you? Look no further, I'm here to help. This will help you export your data from Intercom so you can use it in your own personal database, or import it to another chat tool of your choice.

What's this for....exactly?

This will pull back all users, and all conversations attached to those users and stick it in a MySQL database for you to use later when you need to take it and put it somewhere else. This is just boilerplate code you for. You'll need to change what fields you want to save in the code after you clone/fork/copy this repo.

Requirements

  • MySQL 5.6.1+
    • Make sure to set your max_allowed_packet higher than the default of 16MB or your import mail fail. Go for 100MB for kicks.
  • PHP 7+ with cURL and JSON extensions loaded (maybe some others)
  • Half a brain

Installation

  • Get your database up and running.
    • The schema is located in initial_db_schema.sql. You can simply run mysql < initial_db_schema.sql to get your database setup.
    • You'll then need to setup db permissions for your MySQL user.
  • Take the config.sample.php file and rename it to config.php with your appropriate values.
  • Run composer install to get the right packages to make this kitty purr.

Usage

Assuming you've set up your database permissions correctly, you can then run:

php rip_that_data_back_from_them.php

and off it will go :)

There is another script called unsnooze_and_snooze.php that will go through all the conversations you've pulled back and unsnooze them and then snooze them. This is used in some cases with integrations you may have with Intercom where you need conversations to unsnooze and snooze in order for a integration to trigger.

API

Simple test usage is done by running php -S localhost:8000 -t public/. There are 4 routes defined in the public/index.php file.

GET|POST /api/getConversationHistoryByEmailAddress

You need to define the email param and it will return a JSON response of all your data.

GET|POST /getConversationHistoryByEmailAddress

You need to define the email param and it will return a HTML response of all your data with some minimal markup.

GET|POST /downloadFile

You need to define the id and unique_filename_hash param and it will download the file. If you add &image=true to the request, the url will be able to be used in a <img src="<?=$url?>"> tag.

GET|POST /checkEmail

Has a simple form for you to check the data.

There is a simple api that can be used. Just define an api_token in the config.php file. Then on any request, you can have a GET or POST param of api_token to authenticate with the api endpoints. You can also specify Authorization: Bearer [api_token] as a header.

This is just to cover the bare minimum of security. There are much more hardened practices that could be used with this.

Other Notes

This is currently based on Intercom v1.4 API

flee-intercom's People

Contributors

n0nag0n avatar

Stargazers

 avatar

Watchers

 avatar  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.