Skip to content

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 gemrequire'dyspatch_client'# Setup authorizationDyspatchClient.configuredo |config|
# Configure API key authorization: Bearerconfig.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'endapi_instance=DyspatchClient::DraftsApi.newdraft_id='draft_id_example'# String | A draft IDlanguage_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 localizationapi_instance.delete_localization(draft_id,language_id,accept)rescueDyspatchClient::ApiError=>eputs"Exception when calling DraftsApi->delete_localization: #{e}"end

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
DyspatchClient::DraftsApidelete_localizationDELETE /drafts/{draftId}/localizations/{languageId}Remove a localization
DyspatchClient::DraftsApiget_draft_by_idGET /drafts/{draftId}Get Draft by ID
DyspatchClient::DraftsApiget_draft_localization_keysGET /drafts/{draftId}/localizationKeysGet localization keys
DyspatchClient::DraftsApiget_draftsGET /draftsList Drafts
DyspatchClient::DraftsApiget_localization_for_draftGET /drafts/{draftId}/localizationsGet localizations on a draft
DyspatchClient::DraftsApisave_localizationPUT /drafts/{draftId}/localizations/{languageId}Create or update a localization
DyspatchClient::DraftsApiset_translationPUT /drafts/{draftId}/localizations/{languageId}/translationsSet translations for language
DyspatchClient::DraftsApisubmit_draft_for_approvalPOST /drafts/{draftId}/publishRequestSubmit the draft for approval
DyspatchClient::LocalizationsApiget_draft_localization_by_idGET /localizations/{localizationId}/drafts/{draftId}Get Draft Localization Object by ID
DyspatchClient::LocalizationsApiget_published_localization_by_idGET /localizations/{localizationId}Get Localization Object by ID
DyspatchClient::TemplatesApiget_template_by_idGET /templates/{templateId}Get Template by ID
DyspatchClient::TemplatesApiget_templatesGET /templatesList 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

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages