Skip to content

Latest commit

 

History

History
48 lines (34 loc) · 1.24 KB

README.md

File metadata and controls

48 lines (34 loc) · 1.24 KB

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")