Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
RingCentral Developers is a cloud communications platform which can be accessed via more than 70 APIs. The platform's main capabilities include technologies that enable: Voice, SMS/MMS, Fax, Glip Team Messaging, Data and Configurations.
If you are having difficulty using this SDK, or working with the RingCentral API, please visit our developer community forums for help and to get quick answers to your questions. If you wish to contact the RingCentral Developer Support team directly, please submit a help ticket from our developer website.
gem install ringcentral-sdk
If for some reason eventmachine
failed to install, please check this.
ringcentral
gemThe ringcentral
gem is using RingCentral's legacy API which was End-of-Lifed in 2018. Everyone is recommended to move to the REST API.
If you have both the ringcentral
and ringcentral-sdk
gems installed, you will run into a collision error when attempting to initialize the ringcentral-sdk
RingCentral SDK.
The solution is gem uninstall ringcentral
https://developer.ringcentral.com/api-docs/latest/index.html
require 'ringcentral'
rc = RingCentral.new('clientID', 'clientSecret', 'serverURL')
rc.authorize(jwt: 'jwt-token')
# get
r = rc.get('/restapi/v1.0/account/~/extension/~')
expect(r).not_to be_nil
expect('101').to eq(r.body['extensionNumber'])
rc.get('/restapi/v1.0/account/~/extension', { hello: 'world' })
rc.post('/restapi/v1.0/account/~/extension/~/sms', payload: body, params: { hello: 'world' })
rc.get('/restapi/v1.0/account/~/extension', { hello: ['world1', 'world2'] })
Above will be translated to /restapi/v1.0/account/~/extension?hello=world1&hello=world2
.
Access token expires. You need to call rc.refresh()
before it expires.
If you want the SDK to do auto refresh please rc.auto_refresh = true
before authorization.
Let's say you already have a token. Then you can load it like this: rc.token = your_token_object
.
The benefit of loading a preexisting token is you don't need to go through any authorization flow.
If what you have is a JSON string instead of a Ruby object, you need to convert it first: JSON.parse(your_token_string)
.
If you only have a string for the access token instead of for the whole object, you can set it like this:
rc.token = { access_token: 'the token string' }
r = rc.post('/restapi/v1.0/account/~/extension/~/sms', payload: {
to: [{phoneNumber: ENV['RINGCENTRAL_RECEIVER']}],
from: {phoneNumber: ENV['RINGCENTRAL_SENDER']},
text: 'Hello world'
})
rc.post('/restapi/v1.0/account/~/extension/~/fax',
payload: { to: [{ phoneNumber: ENV['RINGCENTRAL_RECEIVER'] }] },
files: [
['spec/test.txt', 'text/plain'],
['spec/test.png', 'image/png']
]
)
r = rc.post('/restapi/v1.0/account/~/extension/~/sms',
payload: {
to: [{ phoneNumber: ENV['RINGCENTRAL_RECEIVER'] }],
from: { phoneNumber: ENV['RINGCENTRAL_SENDER'] },
text: 'hello world'
},
files: [
['spec/test.png', 'image/png']
]
)
events = [
'/restapi/v1.0/account/~/extension/~/message-store',
]
subscription = WS.new(rc, events, lambda { |message|
puts message
})
subscription.subscribe()
There are two main cases that a subscription will be terminated:
In order to keep a subscription running 24 * 7, you need to re-subscribe when the connection is closed.
subscription.on_ws_closed = lambda { |event|
# make sure that there is no network issue and re-subscribe
subscription.subscribe()
}
bundle install
Rename .env.sample
to .env
.
Edit .env
file to specify credentials.
RINGCENTRAL_RECEIVER
is a phone number to receive SMS, Fax..etc.
Run bundle exec rspec
MIT
FAQs
Unknown package
We found that test-rc-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.