Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bryanbrunetti/exdesk
Elixir library for accessing the Desk.com API
https://github.com/bryanbrunetti/exdesk
Last synced: 3 months ago
JSON representation
Elixir library for accessing the Desk.com API
- Host: GitHub
- URL: https://github.com/bryanbrunetti/exdesk
- Owner: bryanbrunetti
- Created: 2015-11-13T04:39:34.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-14T21:55:40.000Z (almost 7 years ago)
- Last Synced: 2024-10-18T09:06:45.321Z (3 months ago)
- Language: Elixir
- Homepage:
- Size: 14.6 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Elixir library for the Desk.com API. (Third Party APIs)
README
# ExDesk
A library for accessing [The Desk.com API](http://dev.desk.com).
I used this as a project to help with learning Elixir and is very much a work in progress. Feel free to comment and or contribute :)
## Installation
The package can be installed via:
1. Add `exdesk` to your list of dependencies in `mix.exs`:
def deps do
[{:exdesk, "~> 0.1.0"}]
end2. Ensure exdesk is started before your application:
def application do
[applications: [:exdesk]]
end## Usage and examples
To configure the authorization globally, you can either call `ExDesk.configure`:
ExDesk.configure(
site_name: "yoursite.desk.com",
email: "[email protected]",
password: "yourpassword"
)
Or set a `EXDESK_CONFIG` environment variable with site_name, email and password separated by commas.
* this environment variable will override all config calls from within the application.
$ EXDESK_CONFIG=test.desk.com,[email protected],yourpassword iex -S mix
Or you can scope to config to the current process:
ExDesk.configure(:process,
site_name: "yoursite.desk.com",
email: "[email protected]",
password: "yourpassword"
)All responses will be a `Map` of the response from This will return a `Map` of the JSON response described here:
[http://dev.desk.com/API/using-the-api]( http://dev.desk.com/API/using-the-api )Fetching a list of the first ten cases:
ExDesk.list("cases", [per_page: 10, sort_field: "created_at", sort_direction: "asc"])
Creating a new resource:ExDesk.create("labels", [name: "A Label", description: "a description", types: ["case"], enabled: true, color: "purple"])
Fetching a single resource:
ExDesk.show("cases/12345")
Searching for a resource:ExDesk.list("labels/search", [name: "Feedback"])
Updating a resource:ExDesk.update("labels/12345", [color: "red"])
Deleting a resource:ExDesk.delete("labels/12345")