/ycloud-ruby-sdk

The Ruby SDK of YCloud for YCloud developers.

Primary LanguageRuby

ycloud_api

YCloudApiClient - the Ruby gem for the YCloud API

The YCloud API is organized around REST. Our API is designed to have predictable, resource-oriented URLs, return JSON responses, and use standard HTTP response codes and verbs.

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: v2
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build ycloud_api.gemspec

Then either install the gem locally:

gem install ./ycloud_api-1.0.0.gem

(for development, run gem install --dev ./ycloud_api-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 'ycloud_api', '~> 1.0.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/jiacheo/ycloud-ruby-sdk, then add the following in the Gemfile:

gem 'ycloud_api', :git => 'https://github.com/jiacheo/ycloud-ruby-sdk.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 'ycloud_api'

# Setup authorization
YCloudApiClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = '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['api_key'] = 'Bearer'
end

api_instance = YCloudApiClient::BalanceApi.new

begin
  #Retrieve balance
  result = api_instance.balance_retrieve
  p result
rescue YCloudApiClient::ApiError => e
  puts "Exception when calling BalanceApi->balance_retrieve: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.ycloud.com/v2

Class Method HTTP request Description
YCloudApiClient::BalanceApi balance_retrieve GET /balance Retrieve balance
YCloudApiClient::EmailsApi email_send POST /emails Send an email
YCloudApiClient::SMSApi sms_list GET /sms List SMS records
YCloudApiClient::SMSApi sms_send POST /sms Send an SMS
YCloudApiClient::VerifyApi verification_check POST /verify/verificationChecks Check a verification
YCloudApiClient::VerifyApi verification_send POST /verify/verifications Start a verification
YCloudApiClient::VoicesApi voice_list GET /voices List voice records
YCloudApiClient::VoicesApi voice_send POST /voices Send a voice code
YCloudApiClient::WebhookEndpointsApi webhook_endpoint_create POST /webhookEndpoints Create a webhook endpoint
YCloudApiClient::WebhookEndpointsApi webhook_endpoint_delete DELETE /webhookEndpoints/{id} Delete a webhook endpoint
YCloudApiClient::WebhookEndpointsApi webhook_endpoint_list GET /webhookEndpoints List webhook endpoints
YCloudApiClient::WebhookEndpointsApi webhook_endpoint_retrieve GET /webhookEndpoints/{id} Retrieve a webhook endpoint
YCloudApiClient::WebhookEndpointsApi webhook_endpoint_rotate_secret POST /webhookEndpoints/{id}/rotateSecret Rotate a webhook endpoint secret
YCloudApiClient::WebhookEndpointsApi webhook_endpoint_update PATCH /webhookEndpoints/{id} Update a webhook endpoint
YCloudApiClient::WhatsAppMessagesApi whatsapp_message_retrieve GET /whatsapp/messages/{id} Retrieve a WhatsApp message
YCloudApiClient::WhatsAppMessagesApi whatsapp_message_send POST /whatsapp/messages Send a WhatsApp message
YCloudApiClient::WhatsAppPhoneNumbersApi whatsapp_phone_number_list GET /whatsapp/phoneNumbers List WhatsApp phone numbers
YCloudApiClient::WhatsAppPhoneNumbersApi whatsapp_phone_number_retrieve GET /whatsapp/phoneNumbers/{wabaId}/{phoneNumber} Retrieve a WhatsApp phone number
YCloudApiClient::WhatsAppTemplatesApi whatsapp_template_create POST /whatsapp/templates Create a WhatsApp template
YCloudApiClient::WhatsAppTemplatesApi whatsapp_template_delete_by_name DELETE /whatsapp/templates/{wabaId}/{name} Delete WhatsApp templates by name
YCloudApiClient::WhatsAppTemplatesApi whatsapp_template_list GET /whatsapp/templates List WhatsApp templates
YCloudApiClient::WhatsAppTemplatesApi whatsapp_template_retrieve_by_name_and_language GET /whatsapp/templates/{wabaId}/{name}/{language} Retrieve a WhatsApp template

Documentation for Models

Documentation for Authorization

api_key

  • Type: API key
  • API key parameter name: X-API-Key
  • Location: HTTP header