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 Settings > Integrations.¬†Find Import among the integrations and click on Add.
  • In the window that appears, click on Create.
  • Now, you will see hook URL from -¬†copy it to your script.
    import hook
  • 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

requests.post('https://fleep.io/hook/0PJD2eauRb2xfJaKHr5Rzg',
    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'} ]}))