
Security News
Researcher Exposes Zero-Day Clickjacking Vulnerabilities in Major Password Managers
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
This Ruby library allows you to use TextKey's REST API calls server-side from a Ruby backend.
To ensure a secure environment, you don't want to use APIs directly from the front-end, but rather through web-services inside your Ruby backend.
To get more detailed information on the TextKey API Services or to investigate the API in more detail, you can refer to the following:
Add this line to your application's Gemfile:
gem 'textkey_rest'
Or install it from the command line:
$ gem install textkey_rest
From the root directory, run the following:
$ gem build textkey_rest.gemspec
Then you can install it yourself locally:
$ gem install ./textkey_rest-X.X.X.gem
The simple use case is to create a textkey object, call the appropriate API method and handle the returned object payload. The class will handle the details between the request and response and will return an object to work with.
For example, here is a use case to check if a user has already been registered using the doesRegistrationUserIDExist API Call.
# TestDoesRegistrationUserIdExist.rb
#
require 'json'
require 'textkey_rest'
# Setup
apiKey = "PUT API KEY HERE"
# Create the textkey object
textkey = TextKeyRest.new(apiKey, false)
# Setup the API parameters
userID = "BobSmithUID"
isHashed = "TRUE"
# Make the API Call
response = textkey.perform_DoesRegistrationUserIDExist(userID, isHashed)
# Pull out the data from the response
response_obj = JSON.parse(response)
response_data = response_obj['d']
# Display the response
puts "TextKey Results:"
puts JSON.pretty_generate response_data
The basic initialize step consists of including the REST Library and then creating a textkey object.
require 'json'
require 'textkey_rest'
# Setup
apiKey = "PUT API KEY HERE"
# Create the textkey object
textkey = TextKeyRest.new(apiKey, false)
Once initialized, you can now make a call out to the specific TextKey API using the textkey object you just created.
# Setup the API parameters
userID = "BobSmithUID"
isHashed = "TRUE"
# Make the API Call
response = textkey.perform_DoesRegistrationUserIDExist(userID, isHashed)
The API call will return back a JSON string with all of the API fields included. It is wrapped in the d parent element so that wrapper should be removed.
# Pull out the data from the response
response_obj = JSON.parse(response)
response_data = response_obj['d']
# Display the response
puts "TextKey Results:"
puts JSON.pretty_generate response_data
NOTE: If there is an error, the errorDescr field of the returned JSON payload will contain a value.
There is sample/test code in the test Folder for each TextKey API call using the shared library. Just set your API Key in the configuration.rb file in the test folder. To run all of the tests, run TestAll.rb.
Issues
Please discuss issues and features on Github Issues. We'll be happy to answer to your questions and improve the SDK based on your feedback.
Pull requests
You are welcome to fork this SDK and to make pull requests on Github. We'll review each of them, and integrate in a future release if they are relevant.
FAQs
Unknown package
We found that textkey_rest demonstrated a not healthy version release cadence and project activity because the last version was released 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
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers

Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.

Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.