Skip to content

mbramson/catalog_api

Repository files navigation

CatalogApi

Travis CI

CatalogApi is a library that can be used to make interacting with the catalogapi.com API more straightforward in elixir.

Note: this library is very far from stable at the moment. Once it hits 1.0 it will be stable as per standard semantic versioning practices. Until that point, use at your own risk.

Installation

CatalogApi can be installed by adding catalog_api to your list of dependencies in mix.exs:

def deps do
  [
    {:catalog_api, "~> 0.0.16"}
  ]
end

You will have to set a few values in the config.exs file of applications which consume this library.

  • secret_key: The secret key that was given to you by CatalogApi. This should be available at http://.catalogapi.com/stats/ where is whatever username supplied by CatalogApi.
  • username: The username that was supplied to you by CatalogApi. This is the username of your site itself, not your specific login credential.
  • environment: This can be "dev" or "prod", and corresponds to which endpoint should be hit. See http://.catalogapi.com/docs/environments/ for more documentation.

An example config.exs entry for a development environment might look like:

config :catalog_api,
  secret_key: "ABC1234567890",
  username: "company_name",
  environment: "dev"

Documentation can be found on hexdocs at https://hexdocs.pm/catalog_api.