Skip to content

getdyspatch/dyspatch-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dyspatch_client

DyspatchClient - the Ruby gem for the Dyspatch API

Introduction

The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our Implementation Guide for more details on how to implement Dyspatch.

API Client Libraries

Dyspatch provides API Clients for popular languages and web frameworks.

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 2020.11
  • Package version: 6.0.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit https://docs.dyspatch.io

Installation

Build a gem

To build the Ruby code into a gem:

gem build dyspatch_client.gemspec

Then either install the gem locally:

gem install ./dyspatch_client-6.0.0.gem

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

Install from Git

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

gem 'dyspatch_client', :git => 'https://github.com/getdyspatch/dyspatch-ruby.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 'dyspatch_client'

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

api_instance = DyspatchClient::DraftsApi.new
draft_id = 'draft_id_example' # String | A draft ID
language_id = 'language_id_example' # String | A language ID (eg: en-US)
accept = 'accept_example' # String | A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"

begin
  #Remove a localization
  api_instance.delete_localization(draft_id, language_id, accept)
rescue DyspatchClient::ApiError => e
  puts "Exception when calling DraftsApi->delete_localization: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.dyspatch.io

Class Method HTTP request Description
DyspatchClient::DraftsApi delete_localization DELETE /drafts/{draftId}/localizations/{languageId} Remove a localization
DyspatchClient::DraftsApi get_draft_by_id GET /drafts/{draftId} Get Draft by ID
DyspatchClient::DraftsApi get_draft_localization_keys GET /drafts/{draftId}/localizationKeys Get localization keys
DyspatchClient::DraftsApi get_drafts GET /drafts List Drafts
DyspatchClient::DraftsApi get_localization_for_draft GET /drafts/{draftId}/localizations Get localizations on a draft
DyspatchClient::DraftsApi save_localization PUT /drafts/{draftId}/localizations/{languageId} Create or update a localization
DyspatchClient::DraftsApi set_translation PUT /drafts/{draftId}/localizations/{languageId}/translations Set translations for language
DyspatchClient::DraftsApi submit_draft_for_approval POST /drafts/{draftId}/publishRequest Submit the draft for approval
DyspatchClient::LocalizationsApi get_draft_localization_by_id GET /localizations/{localizationId}/drafts/{draftId} Get Draft Localization Object by ID
DyspatchClient::LocalizationsApi get_published_localization_by_id GET /localizations/{localizationId} Get Localization Object by ID
DyspatchClient::TemplatesApi get_template_by_id GET /templates/{templateId} Get Template by ID
DyspatchClient::TemplatesApi get_templates GET /templates List Templates

Documentation for Models

Documentation for Authorization

Bearer

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

About

An OpenAPI generated Dyspatch client in Ruby

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages