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: 2018.08
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen
For more information, please visit https://docs.dyspatch.io
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install dyspatch-client --save
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Please follow the installation instruction and execute the following JS code:
var DyspatchClient = require('dyspatch-client');
var defaultClient = DyspatchClient.ApiClient.instance;
// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = "DYSPATCH_API_KEY"
Bearer.apiKeyPrefix['Authorization'] = "Bearer"
var api = new DyspatchClient.LocalizationsApi()
var localizationId = "loc_12345abcdef"; // {String} A localization ID
var accept = "application/vnd.dyspatch.2018.08+json"; // {String} A version of the API that should be used for the request. For example, to use version \"2018.08\", set the value to \"application/vnd.dyspatch.2018.08+json\"
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.localizationsLocalizationIdGet(localizationId, accept, callback);
All URIs are relative to https://api.dyspatch.io
Class | Method | HTTP request | Description |
---|---|---|---|
DyspatchClient.LocalizationsApi | localizationsLocalizationIdGet | GET /localizations/{localizationId} | Get Localization Object by ID |
DyspatchClient.TemplatesApi | templatesGet | GET /templates | List Templates |
DyspatchClient.TemplatesApi | templatesTemplateIdGet | GET /templates/{templateId} | Get Template by ID |
- DyspatchClient.APIError
- DyspatchClient.CompiledRead
- DyspatchClient.CreatedAt
- DyspatchClient.Cursor
- DyspatchClient.LanguageId
- DyspatchClient.LocalizationId
- DyspatchClient.LocalizationMetaRead
- DyspatchClient.LocalizationName
- DyspatchClient.LocalizationRead
- DyspatchClient.LocalizationUrl
- DyspatchClient.TemplateDescription
- DyspatchClient.TemplateId
- DyspatchClient.TemplateMetaRead
- DyspatchClient.TemplateName
- DyspatchClient.TemplateRead
- DyspatchClient.TemplateUrl
- DyspatchClient.TemplatesRead
- DyspatchClient.UpdatedAt
As in the example below, make sure to add 'Bearer' to the Authorization field.
// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = "DYSPATCH_API_KEY"
Bearer.apiKeyPrefix['Authorization'] = "Bearer"
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header