API Sample Program (Ruby)

Overview

We have prepared a Ruby sample program to illustrate how to use our open API.
The sample program is available on T&D's GitHub account (https://github.com/tandd-lab/webstorage-api-ruby-sample).

The sample program uses a Ruby gem created by a member of our company and is open-source.
The link to the gem can be found in the [README] section of the GitHub repository.

How to Install

gem install ondotori-ruby-client

Sample Program (Ruby)

require "ondotori-ruby-client"
require 'json'  # Use to format and output

params = {
  "api-key" => "apikeyapikeyapikeyapikeyapikeyapikey",  # Enter the obtained API KEY
  "login-id" => "your-login-id",                        # Enter the User ID
  "login-pass" => "your-login-password"                 # Enter the password for the User ID
  }

begin
  client = Ondotori::WebAPI::Client.new(params)
  response = client.current
  puts "#{JSON.pretty_generate(response)}"  # Format and output
rescue Ondotori::WebAPI::Api::Errors::Error => e
  puts "An error has occurred.  #{e.message} #{e.code}"
end

MENU