Skip to content

Commit

Permalink
Add documentation about user avatar.
Browse files Browse the repository at this point in the history
  • Loading branch information
ppostma committed Jan 25, 2024
1 parent 1749ab0 commit 04f4e4d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ This gem provides a Ruby library for communicating with the [Kentaa API](https:/
- [Sites](#sites)
- [Teams](#teams)
- [Users](#users)
- [Avatar](#user-avatar)
- [Pagination](#pagination)
- [Error handling](#error-handling)
- [Development](#development)
Expand Down Expand Up @@ -479,6 +480,28 @@ user.last_name # => "Doe"

See also the [Kentaa API docs](https://developer.kentaa.nl/kentaa-api/#users) and [Kentaa::Api::Resources::User](lib/kentaa/api/resources/user.rb) for all available properties.

#### User avatar

```ruby
# Get User avatar
avatar = user.avatar

avatar.avatar_url # => "https://cdn.kentaa.nl/avatars/avatar/1/thumb_8ce42aeb3bbb1b4964e621b42691f13d4dfa3f21.jpg"

# Create a User avatar
avatar = user.avatar.create(
io: File.open("photo.jpeg"),
content_type: "image/jpeg"
)

avatar.avatar_url # => "https://cdn.kentaa.nl/avatars/avatar/1/thumb_8ce42aeb3bbb1b4964e621b42691f13d4dfa3f21.jpg"

# Delete a User avatar
user.avatar.delete
```

See also the [Kentaa API docs](https://developer.kentaa.nl/kentaa-api/#user-avatars) and [Kentaa::Api::Resources::Avatar](lib/kentaa/api/resources/avatar.rb) for all available properties.

### Pagination

All List actions return paginated results in an [Enumerable](https://ruby-doc.org/core/Enumerable.html) object. The default page size is 25, but you can can customize this by setting the `per_page` parameter.
Expand Down

0 comments on commit 04f4e4d

Please sign in to comment.