https://github.com/stevegrossi/lessonly-elixir
An Elixir-flavored wrapper for the Lessonly API
https://github.com/stevegrossi/lessonly-elixir
api-wrapper elixir
Last synced: 18 days ago
JSON representation
An Elixir-flavored wrapper for the Lessonly API
- Host: GitHub
- URL: https://github.com/stevegrossi/lessonly-elixir
- Owner: stevegrossi
- License: mit
- Created: 2016-04-03T20:11:02.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-12-22T15:32:19.000Z (over 9 years ago)
- Last Synced: 2025-11-23T18:05:40.256Z (7 months ago)
- Topics: api-wrapper, elixir
- Language: Elixir
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lessonly
[](https://hex.pm/packages/lessonly)
An Elixir-flavored wrapper for the [Lessonly](http://www.lessonly.com) [API](http://docs.lessonly.com/).
## Installation
Add lessonly to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:lessonly, "~> 0.0.1"}]
end
```
## Usage
```elixir
# Instantiate a client with your subdomain and API key
iex> client = Lessonly.Client.new("test", "t5tNqaykVwN3Hk1VXXNLOKG6snTMnU8U")
# Make requests!
iex> client |> Lessonly.Lessons.all
%{"id" => 29414, "title" => "Test Lesson 1"},
%{"id" => 29415, "title" => "Test Lesson 2"}
iex> client |> Lessonly.User.find(544547)
%{
"custom_user_field_data" => [],
"email" => "test1@lessonly.com",
"ext_uid" => nil,
"id" => 544547,
"name" => "Test User 1",
"resource_type" => "user",
"role" => "admin",
"type" => "user"
}
iex> assignments = %{"assignee_id" => 544547, "due_by" => "2020-12-31"}
iex> client |> Lessonly.Lesson.assign(%{"assignments" => assignments})
%{
"assignments" => [
%{
"assignable_id" => 29415,
"assignable_type" => "Lesson",
"assignee_id" => 544547,
"completed_at" => nil,
"due_by" => "2020-12-31T00:00:00Z",
"ext_uid" => nil,
"id" => 941035,
"reassigned_at" => nil,
"resource_type" => "assignment",
"score" => 0,
"started_at" => nil,
"status" => "Incomplete",
"updated_at" => "2016-04-03T14:55:00Z"
}
],
"type" => "update_lesson_assignments"
}
```