Skip to content

TheSMSWorks/smsw-ruby-sdk

Repository files navigation

openapi_client

OpenapiClient - the Ruby gem for the The SMS Works API

The SMS Works provides a low-cost, reliable SMS API for developers. Pay only for delivered texts, all failed UK messages are refunded.

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.9.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit https://thesmsworks.co.uk/contact

Installation

Build a gem

To build the Ruby code into a gem:

gem build openapi_client.gemspec

Then either install the gem locally:

gem install ./openapi_client-1.0.0.gem

(for development, run gem install --dev ./openapi_client-1.0.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'openapi_client', '~> 1.0.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'openapi_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'openapi_client'

# Setup authorization
OpenapiClient.configure do |config|
  # Configure API key authorization: JWT
  config.api_key['JWT'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['JWT'] = 'Bearer'
end

api_instance = OpenapiClient::BatchMessagesApi.new
messages = { ... } # Object | An array of messages

begin
  result = api_instance.batch_any_post(messages)
  p result
rescue OpenapiClient::ApiError => e
  puts "Exception when calling BatchMessagesApi->batch_any_post: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.thesmsworks.co.uk/v1

Class Method HTTP request Description
OpenapiClient::BatchMessagesApi batch_any_post POST /batch/any
OpenapiClient::BatchMessagesApi batch_batchid_get GET /batch/{batchid}
OpenapiClient::BatchMessagesApi batch_schedule_post POST /batch/schedule
OpenapiClient::BatchMessagesApi batch_send_post POST /batch/send
OpenapiClient::BatchMessagesApi batches_schedule_batchid_delete DELETE /batches/schedule/{batchid}
OpenapiClient::CreditsApi credits_balance_get GET /credits/balance
OpenapiClient::MessagesApi message_schedule_post POST /message/schedule
OpenapiClient::MessagesApi message_send_post POST /message/send
OpenapiClient::MessagesApi messages_failed_post POST /messages/failed
OpenapiClient::MessagesApi messages_inbox_post POST /messages/inbox
OpenapiClient::MessagesApi messages_messageid_delete DELETE /messages/{messageid}
OpenapiClient::MessagesApi messages_messageid_get GET /messages/{messageid}
OpenapiClient::MessagesApi messages_post POST /messages
OpenapiClient::MessagesApi messages_schedule_get GET /messages/schedule
OpenapiClient::MessagesApi messages_schedule_messageid_delete DELETE /messages/schedule/{messageid}
OpenapiClient::MessagesApi send_flash_message POST /message/flash
OpenapiClient::OneTimePasswordApi otp_messageid_get GET /otp/{messageid}
OpenapiClient::OneTimePasswordApi otp_send_post POST /otp/send
OpenapiClient::OneTimePasswordApi otp_verify_post POST /otp/verify
OpenapiClient::UtilsApi utils_errors_errorcode_get GET /utils/errors/{errorcode}
OpenapiClient::UtilsApi utils_test_get GET /utils/test

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

JWT

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

About

Ruby client SDK for The SMS Works API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •