ringcentral-sdk 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/ringcentral.rb +2 -12
- data/ringcentral-sdk.gemspec +1 -1
- data/spec/ringcentral_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61f23b60292f484d9584097099c11c1a7b6c70f8
|
4
|
+
data.tar.gz: 3387fe6b72c09a0d1c512ce75691ac8616015d02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa32028df6faf6bf68834e23b052f9470e06ad7f9233c4d98ffe217bb9a6b26db50d5d10c17d543ae67fbbc8102d460dbfc6e1123b59ea7e2f67c164f7314afb
|
7
|
+
data.tar.gz: 227e26694aa3a084856abe468f4f2676cf358309ca0055d76345bd6141e0a5c8c1d90db844eb733c7f2dafec1de58e02fd3492d5e1c6ab4e8309755037333d00
|
data/README.md
CHANGED
@@ -33,6 +33,12 @@ expect('101').to eq(JSON.parse(r.body)['extensionNumber'])
|
|
33
33
|
```
|
34
34
|
|
35
35
|
|
36
|
+
### Token Refresh
|
37
|
+
|
38
|
+
Access token expires. You need to call `rc.refresh()` before it expores.
|
39
|
+
If you want the SDK to do auto refresh please `rc.auto_refresh = true` before authorization.
|
40
|
+
|
41
|
+
|
36
42
|
### Send SMS
|
37
43
|
|
38
44
|
```ruby
|
data/lib/ringcentral.rb
CHANGED
@@ -5,16 +5,6 @@ require 'concurrent'
|
|
5
5
|
require 'faraday'
|
6
6
|
require 'tmpdir'
|
7
7
|
|
8
|
-
class MockResponse
|
9
|
-
def initialize(body)
|
10
|
-
@body = body
|
11
|
-
end
|
12
|
-
|
13
|
-
def body
|
14
|
-
@body
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
8
|
class RingCentral
|
19
9
|
def self.SANDBOX_SERVER
|
20
10
|
'https://platform.devtest.ringcentral.com'
|
@@ -31,7 +21,7 @@ class RingCentral
|
|
31
21
|
@app_key = app_key
|
32
22
|
@app_secret = app_secret
|
33
23
|
@server = server
|
34
|
-
@auto_refresh =
|
24
|
+
@auto_refresh = false
|
35
25
|
@token = nil
|
36
26
|
@timer = nil
|
37
27
|
@faraday = Faraday.new(url: server) do |faraday|
|
@@ -114,7 +104,7 @@ class RingCentral
|
|
114
104
|
@faraday.post do |req|
|
115
105
|
req.url endpoint
|
116
106
|
req.params = params
|
117
|
-
if files != nil && files.size > 0 # send fax
|
107
|
+
if files != nil && files.size > 0 # send fax or MMS
|
118
108
|
io = StringIO.new(payload.to_json)
|
119
109
|
payload = {}
|
120
110
|
payload[:json] = Faraday::UploadIO.new(io, 'application/json')
|
data/ringcentral-sdk.gemspec
CHANGED
data/spec/ringcentral_spec.rb
CHANGED
@@ -12,7 +12,7 @@ RSpec.describe 'RingCentral' do
|
|
12
12
|
expect('app_key').to eq(rc.app_key)
|
13
13
|
expect('app_secret').to eq(rc.app_secret)
|
14
14
|
expect('https://platform.devtest.ringcentral.com').to eq(rc.server)
|
15
|
-
expect(
|
15
|
+
expect(false).to eq(rc.auto_refresh)
|
16
16
|
end
|
17
17
|
|
18
18
|
it 'test_authorize_uri' do
|