Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 1.83 KB

README.md

File metadata and controls

57 lines (39 loc) · 1.83 KB

Hubspot API wrapper in Elixir

Hex.pm Hex.pm Hex.pm Build Status

[Hex] [Docs]

Examples

Hubspot.Contacts.all
#=> %Hubspot.HTTP.Request{endpoint: "/contacts/v1/lists/all/contacts/all",
#     method: :get, query: [], body: ""}

Hubspot.Contacts.all |> Hubspot.request
#=> {:ok, response}

Hubspot.Contacts.all([count: 10, vidOffset: 100]) |> Hubspot.request
#=> {:ok, response}

Installation

To install the released version available in Hex, the package can be installed by adding hubspotex to your list of dependencies in mix.exs:

def deps do
  [{:hubspotex, "~> 0.0.6"}]
end

To install the latest master from a github branch, the package can be installed by adding hubspotex to your list of dependencies in mix.exs:

def deps do
  [{:hubspotex, github: "tmaszk/hubspotex" }]
end

Config

Configure your credentials in config.exs, prod.exs, or runtime.exs depending on your deployment method. Get the values from HubSpot account.

import Config

config :hubspotex, auth_method: "hapikey" # "hapikey" or "token"
config :hubspotex, auth_key: "demo"
config :hubspotex, portal_id: "62515"
config :hubspotex, username: "testapi@hubspot.com"
config :hubspotex, password: "HubSpot"