Skip to content

filepreviews/filepreviews-elixir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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