UploadcareEx 
Simple Elixir wrapper for Uploadcare API
Installation
The package can be installed by adding uploadcare_ex to your list of dependencies in mix.exs:
def deps do
[
{:uploadcare_ex, "~> 0.1.2"}
]
endConfiguration
Required parameters:
config :uploadcare_ex,
public_key: "public_key",
private_key: "private_key",
accept_header: "application/vnd.uploadcare-v0.5+json"By default Uploadcare.Simple auth-scheme is used.
Optional parameters
config :uploadcare_ex,
...
store: "0",
retry_period: 1_000,
retry_expiry: 5_000retry_period and retry_expiry parameters are used for request retries in case of Uploadcare service server errors. Their default values are 1_000 and 5_000 respectively.
Usage
Check out the API reference for the latest documentation.
Example:
iex> UploadcareEx.file_info("a295f184-0328-4b30-be4d-f215d9cdbed7")
{:ok,
%{
"datetime_removed" => nil,
"datetime_stored" => nil,
...
}
}
iex> UploadcareEx.upload_file("/my/path/image.png")
{:ok, "a295f184-0328-4b30-be4d-f215d9cdbed7"}Note that currently not all api method wrappers are implemented.
Contributing
- Fork it!
-
Create your feature branch (
git checkout -b my-new-feature) -
Commit your changes (
git commit -am 'Add some feature') -
Push to the branch (
git push origin my-new-feature) - Create new Pull Request
License
UploadcareEx is released under the MIT License.