Flowdock - API: Deleting Inbox items via Flowdock API and Python


Article ID: 107926


Updated On:


CA Flowdock


Flowdock users who are not Enterprise Subscriptions may from time to time want to clean up their Flowdock inbox for various reasons.  Linked to this article is a Python script that deletes Activity' and 'Discussion' message types via the API.


Component: FLODOC


The script is available from this GitHub repository, mbulkeley/Flowdock.  Code in this repository is available as-is and is not supported by the CA Flowdock Customer support team.

The script was written using Python 2.7.12.  The log file path is currently using a Mac directory structure, so may need to be updated to use the Windows path structure when adding where you want the log file to be written.  It has not been run on a Windows environment, but it is Python, so that should be the only difference.

You will need to update the various variable for API Key, Organization and Flow.  You may find your API Key (or token) here, https://www.flowdock.com/account/tokens
The Organization and Flow name can easily be found by clicking on the three vertical dots on an inbox message and selecting copy link.  You can then see the Organization and Flow for sure as the URL follows this pattern:


Setting the log level to 'DEBUG' will list what is going to be deleted, but not delete anything.  There are two that need to be updated.

You may also set it to delete items before a specific date or all items before 'now'.  There a comments in the code for these changes.

It currently only deletes 200 items at a time.  No paging or other looping has been done.

Again, this is available as-is and is not supported by CA.