Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

49 Commits

Repository files navigation

IO.Dyspatch - the C# library 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 C# SDK is automatically generated by the OpenAPI Generator project:

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

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.6
  • Mono/Xamarin >=vNext

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

Installation

Generate the DLL using your preferred tool (e.g. dotnet build)

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

usingIO.Dyspatch.Api;usingIO.Dyspatch.Client;usingIO.Dyspatch.Model;

Getting Started

usingSystem.Collections.Generic;usingSystem.Diagnostics;usingIO.Dyspatch.Api;usingIO.Dyspatch.Client;usingIO.Dyspatch.Model;namespaceExample{publicclassExample{publicstaticvoidMain(){Configurationconfig=newConfiguration();config.BasePath="https://api.dyspatch.io";// Configure API key authorization: Bearerconfig.ApiKey.Add("Authorization","YOUR_API_KEY");// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed// config.ApiKeyPrefix.Add("Authorization", "Bearer");varapiInstance=newDraftsApi(config);vardraftId=draftId_example;// string | A draft IDvarlanguageId=languageId_example;// string | A language ID (eg: en-US)varaccept=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\"try{// Remove a localizationapiInstance.DeleteLocalization(draftId,languageId,accept);}catch(ApiExceptione){Debug.Print("Exception when calling DraftsApi.DeleteLocalization: "+e.Message);Debug.Print("Status Code: "+e.ErrorCode);Debug.Print(e.StackTrace);}}}}

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
DraftsApiDeleteLocalizationDELETE /drafts/{draftId}/localizations/{languageId}Remove a localization
DraftsApiGetDraftByIdGET /drafts/{draftId}Get Draft by ID
DraftsApiGetDraftLocalizationKeysGET /drafts/{draftId}/localizationKeysGet localization keys
DraftsApiGetDraftsGET /draftsList Drafts
DraftsApiGetLocalizationForDraftGET /drafts/{draftId}/localizationsGet localizations on a draft
DraftsApiSaveLocalizationPUT /drafts/{draftId}/localizations/{languageId}Create or update a localization
DraftsApiSetTranslationPUT /drafts/{draftId}/localizations/{languageId}/translationsSet translations for language
DraftsApiSubmitDraftForApprovalPOST /drafts/{draftId}/publishRequestSubmit the draft for approval
LocalizationsApiGetLocalizationByIdGET /localizations/{localizationId}Get Localization Object by ID
TemplatesApiGetTemplateByIdGET /templates/{templateId}Get Template by ID
TemplatesApiGetTemplatesGET /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 C#

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages