History import via webhook

Switching to Fleep from another instant messaging client can be a little painful because of all the historical data you’ve got stored there. But no fear, you can import your content over to Fleep with the help of import webhook, which is an integration that allows you import and post old message histories into Fleep.

Here’s what you need to know:

  • First open the Conversation you’d like to import messages to and create a new import hook by entering the command: /create_hook_import
  • Find the hook URL from Conversation Settings > Integrations popup and copy it from Active integrations list to your script
    How to check import hook link in Fleep.
  • Messages can be appended only to the end of the flow
  • You should sort messages by posted time before starting import
  • You can import 100 messages per call.
  • If less than 100 messages is sent then conversation is pushed to members
  • Message header will appear in format: <sender_name> via <hook_name>
import requests
import json
import time

    headers = {"Content-Type": "application/json"},
    data = json.dumps({'messages': [
        { 'message_key' : None, 'message' : 'whatever',
          'posted_time' : int(time.time()), 'sender_name' : 'tester'},
        { 'message_key' : 'a1', 'message' : 'what if',
          'posted_time' : int(time.time()), 'sender_name' : 'asko'},
        { 'message_key' : 'a1', 'message' : 'what if i can get',
          'posted_time' : int(time.time()), 'sender_name' : 'asko'} ]}))