README.md in ribose-0.2.0 vs README.md in ribose-0.3.0
- old
+ new
@@ -29,59 +29,63 @@
```
## Configure
We need to setup Ribose API configuration before we can perform any request
-throughout this client, and to request an API Key please contact Ribose Inc.
-Once you have your API key then you can configure it by adding an initializer
-with the following code
+throughout this client
+First, obtain an API token [as per this Github wiki](https://github.com/riboseinc/ribose-api/wiki/Obtaining-the-API-Token).
+Using the token, configure the client by adding an initializer with the
+following code:
+
```ruby
Ribose.configure do |config|
config.api_token = "SECRET_API_TOKEN"
config.user_email = "your-email@example.com"
- # There are also some default configurations, normally you do not need to
- # change those unless you have some very specific use case scenario.
+ # There are also some default configurations. Normally you do not need to
+ # change those unless you have some very specific use cases.
#
# config.debug_mode = false
# config.api_host = "www.ribose.com"
end
```
-Or
+Or:
```ruby
Ribose.configuration.api_token = "SECRET_API_TOKEN"
Ribose.configuration.user_email = "your-email@example.com"
```
## Usage
### App Data
-Ribose API provides an easier way to retrieve the list of App data, and to
-retrieve the list of app data we can use the `AppData.all` interface.
+#### List app data
+App data can be retrieved using the `AppData.all` interface.
+
```ruby
Ribose::AppData.all
```
### App Relation
#### List app relations
-To retrieve the list of app relations we can use the `AppRelation.all` interface
+To retrieve the list of app relations, we can use the `AppRelation.all`
+interface.
```ruby
Ribose::AppRelation.all
```
#### Fetch an app relation
To retrieve the details for a specific app relation, we can use the following
-interface
+interface.
```ruby
Ribose::AppRelation.fetch(app_relation_id)
```
@@ -117,11 +121,12 @@
```
#### Fetch a setting
To fetch the details for any specific settings we can use the `Setting.fetch`
-interface and it will return the details for that setting.
+interface with the specific Setting ID, and it will return the details for that
+setting.
```ruby
Ribose::Setting.fetch(setting_id)
```
@@ -131,83 +136,121 @@
Ribose::Setting.update(setting_id, **new_updated_attributes_hash)
```
### Spaces
-#### List user's spaces
+#### List user's Spaces
-To list user's spaces we can use the `Space.all` interface, and it will retrieve
-all of the spaces for the currently configured user.
+To list a user's Spaces we can use the `Space.all` interface, and it will
+retrieve all of the Spaces for the currently configured user.
```ruby
Ribose::Space.all
```
-#### Fetch a user space
+#### Fetch a user Space
-To retrieve the details for a space we can use the `Space.fetch(space_id)`.
+To retrieve the details for a Space we can use the `Space.fetch(space_id)`.
```ruby
Ribose::Space.fetch(space_id)
```
-#### Create a user space
+#### Create a user Space
-To create a new user space we can use
+To create a new user Space,
```ruby
Ribose::Space.create(
- access: "private",
+ access: "private",
space_category_id: 12,
- name: "The amazing Ribose Space",
- description: "Description about your space"
+ name: "The amazing Ribose Space",
+ description: "Description about your Space"
)
```
-#### Update a user space
+#### Update a user Space
```ruby
Ribose::Space.update("space_uuid", name: "New updated name", **other_attributes)
```
-#### Remove a user space
+#### Remove a user Space
-To remove an existing space and we can use the following interface
+To remove an existing Space,
```ruby
Ribose::Space.remove(space_uuid, confirmation: true)
```
### Members
-The members endpoint are space specific, to retrieve the member details under
-any specific space we can use this interface.
+The members endpoint are Space-specific.
-### List of Members
+To retrieve the member details under any specific Space, we can use this
+interface.
-To retrieve the list of members, we can use the following interface.
+#### List space members
+To retrieve the list of members,
+
```ruby
Ribose::Member.all(space_id, options)
```
+#### Delete a space member
+
+```ruby
+Ribose::Member.delete(space_id, member_id, options)
+```
+
+#### Fetch Member Role
+
+```ruby
+Ribose::MemberRole.fetch(space_id, member_id, options)
+```
+
+#### Assign a role to member
+
+```ruby
+Ribose::MemberRole.assign(space_id, member_id, role_id)
+```
+
### Files
#### List of Files
-To retrieves the files for any specific space we can use the following interface
+To retrieve the list of files for any specific Space,
```ruby
Ribose::SpaceFile.all(space_id, options)
```
-### Create a file upload
+#### Fetch a file details
```ruby
+Ribose::SpaceFile.fetch(space_id, file_id, options = {})
+```
+
+#### Create a file upload
+
+```ruby
Ribose::SpaceFile.create(space_id, file: "The complete file path", **attributes)
```
+#### Update a space file
+
+```ruby
+Ribose::SpaceFile.update(space_id, file_id, new_file_attributes = {})
+```
+
+#### Remove a space file
+
+```ruby
+Ribose::SpaceFile.delete(space_id, file_id)
+```
+
### Conversations
#### Listing Space Conversations
```ruby
@@ -250,93 +293,91 @@
#### Create a new message
```ruby
Ribose::Message.create(
- space_id: space_uuid,
+ space_id: space_uuid,
conversation_id: conversation_uuid,
- contents: "Provide your message body here",
+ contents: "Provide your message body here",
)
```
#### Update an existing message
```ruby
Ribose::Message.update(
- space_id: space_uuid,
- message_id: message_uuid,
+ space_id: space_uuid,
+ message_id: message_uuid,
conversation_id: conversation_uuid,
- contents: "The new content for message",
+ contents: "The new content for message",
)
```
#### Remove a message
```ruby
Ribose::Message.remove(
- space_id: space_uuid,
- message_id: message_uuid,
+ space_id: space_uuid,
+ message_id: message_uuid,
conversation_id: conversation_uuid,
)
```
### Feeds
#### List user feeds
-To retrieve the list of user feeds, we can use the `Feed.all` interface
+To retrieve the list of user feeds,
```ruby
Ribose::Feed.all
```
### Widgets
#### List widgets
-To retrieve the list of widgets we can use the `Widget.all` interface
+To retrieve the list of widgets,
```ruby
Ribose::Widget.all
```
### Stream
#### List of stream notifications
-To retrieve the list of notifications we can use the `Stream.all` interface
+To retrieve the list of notifications,
```ruby
Ribose::Stream.all
```
### Leaderboard
#### Retrieve the current leadership board
-To retrieve the current leadership board, we can use the `Leaderboard.all`
-interface and it will return the details.
+To retrieve the current leadership board,
```ruby
Ribose::Leaderboard.all
```
### Connections
-### List of connections
+#### List of connections
To retrieve the list of connections, we can use the `Connection.all` interface
and it will return the connection as `Sawyer::Resource`.
```ruby
Ribose::Connection.all
```
#### Connection suggestions
-To retrieve the list of connection suggestions we can use the following
-interface and it will retrieve the suggested users.
+To retrieve the list of user connection suggestions,
```ruby
Ribose::Connection.suggestions
```
@@ -346,11 +387,11 @@
```ruby
Ribose::ConnectionInvitation.all
```
-#### List space invitations
+#### List Space invitations
```ruby
Ribose::SpaceInvitation.all
```
@@ -385,124 +426,129 @@
```ruby
Ribose::ConnectionInvitation.cancel(invitation_id)
```
-#### Invite user to a space
+#### Invite user to a Space
```ruby
Ribose::SpaceInvitation.create(
- state: "0",
- space_id: "123_456_789",
+ state: "0",
+ space_id: "123_456_789",
invitee_id: "456_789_012",
- type: "Invitation::ToSpace",
- body: "Please join to this amazing space",
+ type: "Invitation::ToSpace",
+ body: "Please join to this amazing Space",
)
```
-#### Create space invitation - Mass
+#### Create Space invitation - Mass
```ruby
Ribose::SpaceInvitation.mass_create(
space_id,
- emails: ["email-one@example.com"],
+ emails: ["email-one@example.com"],
role_ids: ["role-for-email-address-in-sequance"],
- body: "The complete message body for the invitation",
+ body: "The complete message body for the invitation",
)
```
-#### Update a space invitation
+#### Update a Space invitation
```ruby
Ribose::SpaceInvitation.update(invitation_id, new_attributes_hash)
```
-#### Accept a space invitation
+#### Accept a Space invitation
```ruby
Ribose::SpaceInvitation.accept(invitation_id)
```
-#### Resend a space invitation
+#### Resend a Space invitation
```ruby
Ribose::SpaceInvitation.resend(invitation_id)
```
-#### Reject a space invitation
+#### Reject a Space invitation
```ruby
Ribose::SpaceInvitation.reject(invitation_id)
```
-#### Cancel a space invitation
+#### Cancel a Space invitation
```ruby
Ribose::SpaceInvitation.cancel(invitation_id)
```
### Join Space Request
-#### List join space requests
+#### List Join Space Requests
```ruby
Ribose::JoinSpaceRequest.all
```
-#### Create a join space request
+#### Fetch a join space request
```ruby
+Ribose::JoinSpaceRequest.fetch(request_id)
+```
+
+#### Create a Join Space Request
+
+```ruby
Ribose::JoinSpaceRequest.create(
- state: 0,
- space_id: 123_456_789,
- type: "Invitation::JoinSpaceRequest",
- body: "Hi, I would like to join to your space",
+ state: 0,
+ Space_id: 123_456_789,
+ type: "Invitation::JoinSpaceRequest",
+ body: "Hi, I would like to join to your Space",
)
```
-#### Accept a join space request
+#### Accept a Join Space Request
```ruby
Ribose::JoinSpaceRequest.accept(invitation_id)
```
-#### Reject a join space requests
+#### Reject a Join Space Requests
```ruby
Ribose::JoinSpaceRequest.reject(invitation_id)
```
-#### Update an join space requests
+#### Update an Join Space Requests
```ruby
Ribose::JoinSpaceRequest.update(invitation_id, new_attributes_hash)
```
### Calendar
#### List user calendars
-To retrieve the list of user calendar, we can use the `Calendar.all` and it will
-fetch the calendar details for the currently configured user.
+To retrieve the list of calendars accessible to the current user,
```ruby
Ribose::Calendar.all
```
-#### Fetch a calendar
+#### Fetch a calendar events
```ruby
-Ribose::Calendar.fetch(calendar_id)
+Ribose::Calendar.fetch(calendar_ids, start: Data.today, length: 7)
```
#### Create a calendar
```ruby
Ribose::Calendar.create(
owner_type: "User",
- owner_id: "The Owner UUID",
- name: "The name for the calendar",
+ owner_id: "The Owner UUID",
+ name: "The name for the calendar",
)
```
#### Delete a calendar
@@ -520,13 +566,13 @@
#### Activate a signup request
```ruby
Ribose::User.activate(
- email: "user@example.com",
+ email: "user@example.com",
password: "ASecureUserPassword",
- otp: "OTP Recived via the Email",
+ otp: "OTP Recived via the Email",
)
```
### Wikis
@@ -548,18 +594,18 @@
Ribose::Wiki.create(
space_id, name: "Wiki Name", tag_list: "sample", **other_attributes_hash
)
```
-### Update a wiki page
+#### Update a wiki page
```ruby
Ribose::Wiki.update(
space_id, wiki_id, **updated_attributes_hash
)
```
-### Remove a wiki page
+#### Remove a wiki page
```ruby
Ribose::Wiki.delete(space_id, wiki_id)
```