# README
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.
Overview
This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.
- API version: 2018.08
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://docs.dyspatch.io
Installation
Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional
Install the latest version of the client project:
go get -u github.com/getdyspatch/dyspatch-golang
Installing a versioned client:
go get gopkg.in/getdyspatch/dyspatch-golang.v1
Importing a versioned client:
import "gopkg.in/getdyspatch/dyspatch-golang.v1"
Read more at gopkg.in
Getting Started
package main
import (
"fmt"
"github.com/antihax/optional"
"github.com/getdyspatch/dyspatch-golang"
"golang.org/x/net/context"
)
func main() {
cfg := dyspatch_client.NewConfiguration()
accept := "application/vnd.dyspatch.2018.08+json" // Accept header used in this API version
auth := context.WithValue(context.Background(), dyspatch_client.ContextAPIKey, dyspatch_client.APIKey{
Key: "DYSPATCH_API_KEY",
Prefix: "Bearer", // Omit if not necessary.
})
api := dyspatch_client.NewAPIClient(cfg)
opts := dyspatch_client.TemplatesGetOpts{Cursor: optional.NewString("")}
templates, resp, err := api.TemplatesApi.TemplatesGet(auth, accept, &opts)
if err != nil {
fmt.Println(err)
}
for _, template := range templates.Data {
fmt.Println(template.Name)
}
}
Documentation for API Endpoints
All URIs are relative to https://api.dyspatch.io
Class | Method | HTTP request | Description |
---|---|---|---|
LocalizationsApi | LocalizationsLocalizationIdGet | Get /localizations/{localizationId} | Get Localization Object by ID |
TemplatesApi | TemplatesGet | Get /templates | List Templates |
TemplatesApi | TemplatesTemplateIdGet | Get /templates/{templateId} | Get Template by ID |
Documentation For Models
- ApiError
- CompiledRead
- Cursor
- LocalizationMetaRead
- LocalizationRead
- TemplateMetaRead
- TemplateRead
- TemplatesRead
Documentation For Authorization
Bearer
- Type: API key
Example
auth := context.WithValue(context.Background(), dyspatch_client.ContextAPIKey, dyspatch_client.APIKey{
Key: "DYSPATCH_API_KEY",
Prefix: "Bearer",
})
r, err := client.Service.Operation(auth, accept, args) // Service: TemplatesApi or LocalizationsApi
Author
# Functions
CacheExpires helper function to determine remaining time before repeating a request.
NewAPIClient creates a new API client.
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKey takes an APIKey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
# Structs
APIClient manages communication with the Dyspatch API API v2018.08 In most cases there should be only one, shared, APIClient.
No description provided by the author
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
No description provided by the author
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
No description provided by the author
No description provided by the author
Information about paginated results.
GenericOpenAPIError Provides access to the body, error and model on returned errors.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author