Add this line to your application’s Gemfile:
gem "ribose"
And then execute:
$ bundle install
Or install it yourself as:
$ gem install ribose
We need to setup Ribose API configuration before we can perform any request throughout this client
First, obtain an API token as per this Github wiki. Using the token, configure the client by adding an initializer with the following code:
Ribose.configure do |config|
config.user_email = "your-email@example.com"
config.user_password = "your-password"
# INFRA_ID is a 7-digit id, which can be found from the network requests
# e.g. ed6af7b for current production environment.
# Note: add the host without the protocols eq: http, https
config.api_host = "app-INFRA_ID.ribose.com"
# 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"
# Deprecated
# config.api_token = "SECRET_API_TOKEN"
# config.api_email = "your-email@example.com"
end
Or:
Ribose.configuration.api_host = "app-INFRA_ID.ribose.com"
Ribose.configuration.user_email = "your-email@example.com"
Ribose.configuration.user_password = "your-password"
```
=======
To retrieve the list of app relations, we can use the AppRelation.all
interface.
Ribose::AppRelation.all
To list user’s settings we can use the Setting.all
interface, and it will return all of the user’s settings.
Ribose::Setting.all
To fetch the details for any specific settings we can use the Setting.fetch
interface with the specific Setting ID, and it will return the details for that setting.
Ribose::Setting.fetch(setting_id)
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.
Ribose::Space.all
To retrieve the details for a Space we can use the Space.fetch(space_id)
.
Ribose::Space.fetch(space_id)
To create a new user Space,
Ribose::Space.create(
access: "private",
space_category_id: 12,
name: "The amazing Ribose Space",
description: "Description about your Space"
)
Ribose::Space.update("space_uuid", name: "New updated name", **other_attributes)
The members endpoint are Space-specific.
To retrieve the member details under any specific Space, we can use this interface.
To retrieve the list of files for any specific Space,
Ribose::SpaceFile.all(space_id, options)
Ribose::SpaceFile.create(space_id, file: "The complete file path", **attributes)
Ribose::FileVersion.fetch(
space_id: space_id, file_id: file_id, version_id: version_id
)
Ribose::Conversation.create(
space_id, name: "Sample conversation", tag_list: "sample, conversation"
)
Ribose::Message.all(space_id: space_uuid, conversation_id: conversation_uuid)
Ribose::Message.create(
space_id: space_uuid,
conversation_id: conversation_uuid,
contents: "Provide your message body here",
)
Ribose::Message.update(
space_id: space_uuid,
message_id: message_uuid,
conversation_id: conversation_uuid,
contents: "The new content for message",
)
To retrieve the list of connections, we can use the Connection.all
interface and it will return the connection as Sawyer::Resource
.
Ribose::Connection.all
To disconnect with an existing connection, we can use Connection.disconnect
interface as following.
This expect us to provide the connection id, and it also support an additional options hash to provide custom options.
Ribose::Connection.disconnect(connection_id, options)
Ribose::ConnectionInvitation.create(
emails: ["email-one@example.com", "email-two@example.com"],
body: "This contains the details message about the invitation",
)
Ribose::SpaceInvitation.create(
state: "0",
space_id: "123_456_789",
invitee_id: "456_789_012",
type: "Invitation::ToSpace",
body: "Please join to this amazing Space",
)
Ribose::SpaceInvitation.mass_create(
space_id,
emails: ["email-one@example.com"],
role_ids: ["role-for-email-address-in-sequance"],
body: "The complete message body for the invitation",
)
Ribose::JoinSpaceRequest.create(
state: 0,
Space_id: 123_456_789,
type: "Invitation::JoinSpaceRequest",
body: "Hi, I would like to join to your Space",
)
To retrieve the list of calendars accessible to the current user,
Ribose::Calendar.all
Ribose::Calendar.create(
owner_type: "User",
owner_id: "The Owner UUID",
name: "The name for the calendar",
)
Ribose::Event.create(
calendar_id,
name: "Sample Event",
date_start: "04/04/2018",
time_start: "4:30pm",
date_finish: "04/04/2018",
time_finish: "5:30pm",
recurring_type: "not_repeat",
until: "never",
repeat_every: "1",
where: "Skype",
description: "Sample event",
all_day: false,
)
Ribose::Event.update(
calendar_id, event_id, new_attributes_hash, options_params
)
Ribose::Wiki.create(
space_id, name: "Wiki Name", tag_list: "sample", **other_attributes_hash
)
We are following Sandi Metz’s Rules for this gem, you can read the description of the rules here All new code should follow these rules. If you make changes in a pre-existing file that violates these rules you should fix the violations as part of your contribution.
First, thank you for contributing! We love pull requests from everyone. By participating in this project, you hereby grant Ribose Inc. the right to grant or transfer an unlimited number of non exclusive licenses or sub-licenses to third parties, under the copyright covering the contribution to use the contribution by all means.
Here are a few technical guidelines to follow:
-
Open an issue to discuss a new feature.
-
Write tests to support your new feature.
-
Make sure the entire test suite passes locally and on CI.
-
Open a Pull Request.
-
Squash your commits after receiving feedback.
-
Party!
This gem is developed, maintained and funded by Ribose Inc.
The gem is available as open source under the terms of the MIT License.