ExIntercom

Build StatusInline docshex.pm version

Elixir library for the Intercom API

Currently has very limited functionality with read-only access.

Roadmap

Documentation

http://hexdocs.pm/exintercom

Installation

  1. Add exintercom to your list of dependencies in mix.exs:
  def deps do
    [{:exintercom, "~> 0.1.0"}]
  end
  1. Ensure exintercom is started before your application:

    def application do
     [applications: [:exintercom]]
    end
  2. Add Intercom credentials to config.exs:

    config :exintercom,
     app_id: "...",
     app_key: "..."
     client_id: "..." # Optional, for OAuth only
     client_secret: "..." # Optional, for OAuth only

If no config set, env variables will be used instead with the following names:

  app_id        -> INTERCOM_APP_ID
  app_key       -> INTERCOM_APP_KEY
  client_id     -> INTERCOM_CLIENT_ID
  client_secret -> INTERCOM_CLIENT_SECRET
  1. Do mix deps.get

Usage

iex> ExIntercom.Conversation.find_all
[%{"assignee" => %{"id" => "...", "type" => "..."}, ...]

iex> ExIntercom.Conversation.find(id: "1")
%{...}

iex> ExIntercom.User.find(id: "1")
%{...}

iex> ExIntercom.oauth_url("http://your_callback_url.com", "your_state")
https://app.intercom.io/oauth?...