FilePreviews
Provides an interface to the FilePreviews API.
For the API's documentation please check http://filepreviews.io/docs/.
Usage
{:ok, filepreviews} = FilePreviews.new("API_KEY", "API_SECRET")
Generate
{status, response} = FilePreviews.generate("http://example.com/file.pdf")
Note: - status
is either :ok or :error. - response
is a Map converted from the JSON response from FilePreviews.
Options
params = %{metadata: ["exif"], pages: "1"}
{status, response} = FilePreviews.generate("http://example.com/file.pdf", params)
Retrieve
{status, response} = FilePreviews.generate("42764e04-9094-467c-96b3-49d31ff4423d")
Summary↑
api_key() | Returns the API Key |
api_secret() | Returns the API Secret |
generate(url, params \\ %{}) | Generates a preview for a given URL and params |
new(config) | Starts FilePreviews process with the config |
new(api_key, api_secret) | Starts FilePreviews process with the given api_key and api_secret |
retrieve(id) | Retrieves a preview with a given ID |
version() |
Types ↑
status :: :ok | :error
Functions
Specs:
- api_key :: binary
Returns the API Key.
Specs:
- api_secret :: binary
Returns the API Secret.
Specs:
- generate(binary, map) :: FilePreviews.response
Generates a preview for a given URL and params.
Specs:
- new(FilePreviews.Config.t) :: {FilePreviews.status, pid}
Starts FilePreviews process with the config.
Specs:
- new(binary, binary) :: {FilePreviews.status, pid}
Starts FilePreviews process with the given api_key and api_secret.
Specs:
- retrieve(binary) :: FilePreviews.response
Retrieves a preview with a given ID.