Elixir client library for FilePreviews.io
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
lib
test
.formatter.exs
.gitignore
.travis.yml
LICENSE
README.md
mix.exs
mix.lock

README.md

FilePreviews.io

build-status-image hexpm-version

Elixir client library for FilePreviews.io. Generate image previews and metadata from almost any kind of file.

Installation

{:filepreviews, "~> 1.0.0"}

Usage

{:ok, filepreviews} = FilePreviews.new("API_KEY", "API_SECRET")

Generate

# status is either :ok or :error
# response is a Map converted from the JSON response from FilePreviews.
{status, response} = FilePreviews.generate("http://example.com/file.pdf")

Options

Check out the endpoint docs for all available options.

params = %{metadata: ["exif"], pages: "1"}
{status, response} = FilePreviews.generate("http://example.com/file.pdf", params)

Retrieve

{status, response} = FilePreviews.retrieve("42764e04-9094-467c-96b3-49d31ff4423d")