segmentio/integrations — pull request #159 by rcerf (2014-07-24 03:54:33+00:00)
Title: Add/closeio

Here's an integration of close.io.

A few things to note:
- The integration requires the presence of an email for an identify(..), group(..), or track(..) call.
- When identify(..) is called, I first query for the Lead, which is the parent of a Contact, by using the user's email. If that query doesn't return a result, I then query the Close.io Lead endpoint for the company name. If there is a result from the company name query, I create a contact representing that user under that company.
- When group(..) is called, I query for the group using an email address.

Ok, that should do it. Let me know what I can improve on in this integration.