ringcentral-sdk 1.0.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +60 -29
- data/ringcentral-sdk.gemspec +3 -3
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe02638e7afc1f2ad5041efe64e0b95ebdf8fe9c6db1864084111c2b0573b394
|
4
|
+
data.tar.gz: 0c541dcef1b054aa05e1fbb45674feec1a4fcdfcf187678fa493b584709e70e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b6841a808a47bd519218fc1755fabb83b274a126d013b988fbe1b35aeb178fe0c559c66d2abfc787f78421ce206601a431040c85c5ea3dcc8d9f679583670ab
|
7
|
+
data.tar.gz: 630981efaa1bfd0e659828ccfc5d487348343fd77b5d926c3352ac3e9cf0a1d5cbc93a77c8145da23dfb27374637cdd67e16d22fb06d9e03e3a267567f3b7d80
|
data/README.md
CHANGED
@@ -1,18 +1,42 @@
|
|
1
|
-
# RingCentral SDK for Ruby
|
1
|
+
# Official RingCentral SDK for Ruby
|
2
2
|
|
3
|
-
[](https://ringcentral.github.io/ringcentral-ruby/)
|
4
4
|
[](https://twitter.com/RingCentralDevs)
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
**[RingCentral Developers](https://developer.ringcentral.com/api-products)** is
|
7
|
+
a cloud communications platform which can be accessed via more than 70 APIs. The
|
8
|
+
platform's main capabilities include technologies that enable:
|
9
|
+
**[Voice](https://developer.ringcentral.com/api-products/voice),
|
10
|
+
[SMS/MMS](https://developer.ringcentral.com/api-products/sms),
|
11
|
+
[Fax](https://developer.ringcentral.com/api-products/fax),
|
12
|
+
[Glip Team Messaging](https://developer.ringcentral.com/api-products/team-messaging),
|
13
|
+
[Data and Configurations](https://developer.ringcentral.com/api-products/configuration)**.
|
8
14
|
|
9
|
-
|
15
|
+
## Additional resources
|
10
16
|
|
17
|
+
- [RingCentral API Reference](https://developer.ringcentral.com/api-docs/latest/index.html) -
|
18
|
+
an interactive reference for the RingCentral API that allows developers to
|
19
|
+
make API calls with no code.
|
20
|
+
- [Document](https://ringcentral.github.io/ringcentral-ruby/) - an interactive
|
21
|
+
reference for the SDK code documentation.
|
11
22
|
|
12
23
|
## Getting help and support
|
13
24
|
|
14
|
-
If you are having difficulty using this SDK, or working with the RingCentral
|
25
|
+
If you are having difficulty using this SDK, or working with the RingCentral
|
26
|
+
API, please visit our
|
27
|
+
[developer community forums](https://community.ringcentral.com/spaces/144/) for
|
28
|
+
help and to get quick answers to your questions. If you wish to contact the
|
29
|
+
RingCentral Developer Support team directly, please
|
30
|
+
[submit a help ticket](https://developers.ringcentral.com/support/create-case)
|
31
|
+
from our developer website.
|
15
32
|
|
33
|
+
## Official VS. Community maintained SDKs
|
34
|
+
|
35
|
+
This is the **official** RingCentral SDK for the Ruby programming language.
|
36
|
+
While there are other Ruby SDKs for RingCentral, those are maintained by the
|
37
|
+
community. We’re including this clarification to help avoid confusion, as some
|
38
|
+
SDKs have similar names. That said, we truly appreciate and welcome community
|
39
|
+
contributions and alternative SDKs.
|
16
40
|
|
17
41
|
## Installation
|
18
42
|
|
@@ -20,23 +44,27 @@ If you are having difficulty using this SDK, or working with the RingCentral API
|
|
20
44
|
gem install ringcentral-sdk
|
21
45
|
```
|
22
46
|
|
23
|
-
If for some reason `eventmachine` failed to install, please check
|
47
|
+
If for some reason `eventmachine` failed to install, please check
|
48
|
+
[this](https://stackoverflow.com/a/31516586/862862).
|
24
49
|
|
50
|
+
There is a gem with a similar name "ringcentral_sdk". That gem is not maintained
|
51
|
+
by us.
|
25
52
|
|
26
53
|
### Name collision with `ringcentral` gem
|
27
54
|
|
28
|
-
The `ringcentral` gem is using RingCentral's legacy API which was End-of-Lifed
|
55
|
+
The `ringcentral` gem is using RingCentral's legacy API which was End-of-Lifed
|
56
|
+
in 2018. Everyone is recommended to move to the REST API.
|
29
57
|
|
30
|
-
If you have both the `ringcentral` and `ringcentral-sdk` gems installed, you
|
58
|
+
If you have both the `ringcentral` and `ringcentral-sdk` gems installed, you
|
59
|
+
will run into a collision error when attempting to initialize the
|
60
|
+
`ringcentral-sdk` RingCentral SDK.
|
31
61
|
|
32
62
|
The solution is `gem uninstall ringcentral`
|
33
63
|
|
34
|
-
|
35
64
|
## Documentation
|
36
65
|
|
37
66
|
https://developer.ringcentral.com/api-docs/latest/index.html
|
38
67
|
|
39
|
-
|
40
68
|
## Usage
|
41
69
|
|
42
70
|
```ruby
|
@@ -51,6 +79,9 @@ expect(r).not_to be_nil
|
|
51
79
|
expect('101').to eq(r.body['extensionNumber'])
|
52
80
|
```
|
53
81
|
|
82
|
+
## Samples
|
83
|
+
|
84
|
+
For more code samples, please refer to the test cases in `spec` folder.
|
54
85
|
|
55
86
|
## How to specify query parameters
|
56
87
|
|
@@ -72,29 +103,31 @@ rc.post('/restapi/v1.0/account/~/extension/~/sms', payload: body, params: { hell
|
|
72
103
|
rc.get('/restapi/v1.0/account/~/extension', { hello: ['world1', 'world2'] })
|
73
104
|
```
|
74
105
|
|
75
|
-
Above will be translated to
|
76
|
-
|
106
|
+
Above will be translated to
|
107
|
+
`/restapi/v1.0/account/~/extension?hello=world1&hello=world2`.
|
77
108
|
|
78
109
|
### Token Refresh
|
79
110
|
|
80
|
-
Access token expires. You need to call `rc.refresh()` before it expires.
|
81
|
-
|
82
|
-
|
111
|
+
Access token expires. You need to call `rc.refresh()` before it expires. If you
|
112
|
+
want the SDK to do auto refresh please `rc.auto_refresh = true` before
|
113
|
+
authorization.
|
83
114
|
|
84
115
|
### Load pre-existing token
|
85
116
|
|
86
|
-
Let's say you already have a token. Then you can load it like this:
|
87
|
-
The benefit of loading a preexisting token is
|
117
|
+
Let's say you already have a token. Then you can load it like this:
|
118
|
+
`rc.token = your_token_object`. The benefit of loading a preexisting token is
|
119
|
+
you don't need to go through any authorization flow.
|
88
120
|
|
89
|
-
If what you have is a JSON string instead of a Ruby object, you need to convert
|
121
|
+
If what you have is a JSON string instead of a Ruby object, you need to convert
|
122
|
+
it first: `JSON.parse(your_token_string)`.
|
90
123
|
|
91
|
-
If you only have a string for the access token instead of for the whole object,
|
124
|
+
If you only have a string for the access token instead of for the whole object,
|
125
|
+
you can set it like this:
|
92
126
|
|
93
127
|
```ruby
|
94
128
|
rc.token = { access_token: 'the token string' }
|
95
129
|
```
|
96
130
|
|
97
|
-
|
98
131
|
### Send SMS
|
99
132
|
|
100
133
|
```ruby
|
@@ -105,7 +138,6 @@ r = rc.post('/restapi/v1.0/account/~/extension/~/sms', payload: {
|
|
105
138
|
})
|
106
139
|
```
|
107
140
|
|
108
|
-
|
109
141
|
### Send fax
|
110
142
|
|
111
143
|
```ruby
|
@@ -118,7 +150,6 @@ payload: { to: [{ phoneNumber: ENV['RINGCENTRAL_RECEIVER'] }] },
|
|
118
150
|
)
|
119
151
|
```
|
120
152
|
|
121
|
-
|
122
153
|
### Send MMS
|
123
154
|
|
124
155
|
```ruby
|
@@ -134,7 +165,6 @@ r = rc.post('/restapi/v1.0/account/~/extension/~/sms',
|
|
134
165
|
)
|
135
166
|
```
|
136
167
|
|
137
|
-
|
138
168
|
## Subscriptions
|
139
169
|
|
140
170
|
### WebSocket Subscriptions
|
@@ -153,10 +183,13 @@ subscription.subscribe()
|
|
153
183
|
|
154
184
|
There are two main cases that a subscription will be terminated:
|
155
185
|
|
156
|
-
- Absolute time out. The maximum time for a subscription to run is 24 hours.
|
157
|
-
|
186
|
+
- Absolute time out. The maximum time for a subscription to run is 24 hours.
|
187
|
+
After that, the websocket connection will be closed by the server.
|
188
|
+
- Network issue. It could be your local network issue or the server's network
|
189
|
+
issue. In either case, your websocket connection will be closed
|
158
190
|
|
159
|
-
In order to keep a subscription running 24 * 7, you need to re-subscribe when
|
191
|
+
In order to keep a subscription running 24 * 7, you need to re-subscribe when
|
192
|
+
the connection is closed.
|
160
193
|
|
161
194
|
```ruby
|
162
195
|
subscription.on_ws_closed = lambda { |event|
|
@@ -165,7 +198,6 @@ subscription.on_ws_closed = lambda { |event|
|
|
165
198
|
}
|
166
199
|
```
|
167
200
|
|
168
|
-
|
169
201
|
## How to test
|
170
202
|
|
171
203
|
```
|
@@ -180,7 +212,6 @@ Edit `.env` file to specify credentials.
|
|
180
212
|
|
181
213
|
Run `bundle exec rspec`
|
182
214
|
|
183
|
-
|
184
215
|
## License
|
185
216
|
|
186
217
|
MIT
|
data/ringcentral-sdk.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
Gem::Specification.new do |gem|
|
2
2
|
gem.name = 'ringcentral-sdk'
|
3
|
-
gem.version = '1.
|
3
|
+
gem.version = '1.1.1'
|
4
4
|
gem.authors = ['Tyler Liu']
|
5
5
|
gem.email = ['tyler.liu@ringcentral.com']
|
6
|
-
gem.description = 'Ruby SDK for you to access RingCentral platform
|
7
|
-
gem.summary = 'RingCentral Ruby SDK.'
|
6
|
+
gem.description = 'Ruby SDK for you to access RingCentral platform APIs. This is the **official** RingCentral SDK for the Ruby programming language. While there are other Ruby SDKs for RingCentral, those are maintained by the community. We\'re including this clarification to help avoid confusion, as some SDKs have similar names. That said, we truly appreciate and welcome community contributions and alternative SDKs.'
|
7
|
+
gem.summary = 'The **official** RingCentral Ruby SDK.'
|
8
8
|
gem.homepage = 'https://github.com/ringcentral/ringcentral-ruby'
|
9
9
|
gem.license = 'MIT'
|
10
10
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ringcentral-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyler Liu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -110,7 +110,11 @@ dependencies:
|
|
110
110
|
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: 0.11.3
|
113
|
-
description: Ruby SDK for you to access RingCentral platform
|
113
|
+
description: Ruby SDK for you to access RingCentral platform APIs. This is the **official**
|
114
|
+
RingCentral SDK for the Ruby programming language. While there are other Ruby SDKs
|
115
|
+
for RingCentral, those are maintained by the community. We're including this clarification
|
116
|
+
to help avoid confusion, as some SDKs have similar names. That said, we truly appreciate
|
117
|
+
and welcome community contributions and alternative SDKs.
|
114
118
|
email:
|
115
119
|
- tyler.liu@ringcentral.com
|
116
120
|
executables: []
|
@@ -148,7 +152,7 @@ requirements: []
|
|
148
152
|
rubygems_version: 3.4.10
|
149
153
|
signing_key:
|
150
154
|
specification_version: 4
|
151
|
-
summary: RingCentral Ruby SDK.
|
155
|
+
summary: The **official** RingCentral Ruby SDK.
|
152
156
|
test_files:
|
153
157
|
- spec/fax_spec.rb
|
154
158
|
- spec/mms_spec.rb
|