Simple Elixir wrapper for Uploadcare API
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"}
]
end
config :uploadcare_ex,
public_key: "public_key",
private_key: "private_key"
By default Uploadcare.Simple auth-scheme is used.
config :uploadcare_ex,
...
accept_header: "application/vnd.uploadcare-v0.5+json",
store: "0",
retry_period: 1_000,
retry_expiry: 5_000
retry_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.
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.
- 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
UploadcareEx is released under the MIT License.