Dyspatch Ruby API Client

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.

This SDK is automatically generated by the Swagger Codegen project:

  • API version: 2019.10
  • Package version: 3.0.1
  • Build package: io.swagger.codegen.languages.RubyClientCodegen

For more information, please visit https://docs.dyspatch.io

Installation

RubyGems

Install from Rubygems:

gem install dyspatch_client

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-3.0.1.gem

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

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 'dyspatch_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 'dyspatch_client'

# Setup authorization
DyspatchClient.configure do |config|
  # Configure API key authorization: Bearer
  config.api_key['Authorization'] = 'YOUR API KEY'
  config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = DyspatchClient::DraftsApi.new

draft_id = 'draft_id_example' # String | A draft ID

target_language = 'target_language_example' # String | The type of templating language to compile as. Should only be used for visual templates.


begin
  # Get Draft by ID
  result = api_instance.drafts_draft_id_get(draft_id, target_language)
  p result
rescue DyspatchClient::ApiError => e
  puts "Exception when calling DraftsApi->drafts_draft_id_get: #{e}"
end

Documentation for API Endpoints

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

Class Method HTTP request Description
DyspatchClient::DraftsApi drafts_draft_id_get GET /drafts/draftId Get Draft by ID
DyspatchClient::DraftsApi drafts_draft_id_localization_keys_get GET /drafts/draftId/localizationKeys Get Localization Keys
DyspatchClient::DraftsApi drafts_draft_id_localizations_get GET /drafts/draftId/localizations Get Localizations on a Draft
DyspatchClient::DraftsApi drafts_draft_id_localizations_language_id_delete DELETE /drafts/draftId/localizations/languageId Remove a Localization
DyspatchClient::DraftsApi drafts_draft_id_localizations_language_id_put PUT /drafts/draftId/localizations/languageId Create or Update a Localization
DyspatchClient::DraftsApi drafts_draft_id_localizations_language_id_translations_put PUT /drafts/draftId/localizations/languageId/translations Set Translations for Language
DyspatchClient::DraftsApi drafts_draft_id_publish_request_post POST /drafts/draftId/publishRequest Submit the Draft for Approval
DyspatchClient::DraftsApi drafts_get GET /drafts List Drafts
DyspatchClient::LocalizationsApi localizations_localization_id_get GET /localizations/localizationId Get Localization Object by ID
DyspatchClient::TemplatesApi templates_get GET /templates List Templates
DyspatchClient::TemplatesApi templates_template_id_get GET /templates/templateId Get Template by ID

Documentation for Models

Documentation for Authorization

Bearer

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