All URIs are relative to https://api.dyspatch.io
| Method | HTTP request | Description |
|---|---|---|
| DeleteLocalization | Delete /drafts/{draftId}/localizations/{languageId} | Remove a localization |
| GetDraftById | Get /drafts/{draftId} | Get Draft by ID |
| GetDraftLocalizationKeys | Get /drafts/{draftId}/localizationKeys | Get localization keys |
| GetDrafts | Get /drafts | List Drafts |
| GetLocalizationForDraft | Get /drafts/{draftId}/localizations | Get localizations on a draft |
| SaveLocalization | Put /drafts/{draftId}/localizations/{languageId} | Create or update a localization |
| SetTranslation | Put /drafts/{draftId}/localizations/{languageId}/translations | Set translations for language |
| SubmitDraftForApproval | Post /drafts/{draftId}/publishRequest | Submit the draft for approval |
DeleteLocalization(ctx, draftId, languageId, accept)
Remove a localization
Deletes the localization with the given language ID if it exists
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| draftId | string | A draft ID | |
| languageId | string | A language ID (eg: en-US) | |
| accept | 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" |
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DraftRead GetDraftById(ctx, draftId, targetLanguage, accept)
Get Draft by ID
Gets a draft object with the matching ID. The "compiled" field will contain the template in the default, unlocalized form.
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| draftId | string | A draft ID | |
| targetLanguage | string | The type of templating language to compile as. Should only be used for visual templates. | |
| accept | 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" |
- Content-Type: Not defined
- Accept: application/vnd.dyspatch.2020.11+json, /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]LocalizationKeyRead GetDraftLocalizationKeys(ctx, draftId, accept)
Get localization keys
Returns the list of values that need to be translated for the draft. Set the Accept header to application/vnd.dyspatch.2020.11+json to get a JSON object, or text/vnd.dyspatch.2020.11+x-gettext-translation to get the POT file.
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| draftId | string | A draft ID | |
| accept | 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" |
- Content-Type: Not defined
- Accept: application/vnd.dyspatch.2020.11+json, text/vnd.dyspatch.2020.11+x-gettext-translation
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DraftsRead GetDrafts(ctx, accept, optional)
List Drafts
Returns all drafts for your organization.
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| accept | 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" | |
| optional | *GetDraftsOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a GetDraftsOpts struct
| Name | Type | Description | Notes |
|---|
cursor | optional.String| A cursor value used to retrieve a specific page from a paginated result set. | status | optional.String| Filter the list of drafts by a particular status |
- Content-Type: Not defined
- Accept: application/vnd.dyspatch.2020.11+json, /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]LocalizationMetaRead GetLocalizationForDraft(ctx, draftId, accept)
Get localizations on a draft
Returns localization metadata for the draft
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| draftId | string | A draft ID | |
| accept | 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" |
- Content-Type: Not defined
- Accept: application/vnd.dyspatch.2020.11+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SaveLocalization(ctx, draftId, languageId, accept, inlineObject)
Create or update a localization
Inserts a localization or sets the name on an existing localization that already uses the languageId
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| draftId | string | A draft ID | |
| languageId | string | A language ID (eg: en-US) | |
| accept | 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" | |
| inlineObject | InlineObject |
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SetTranslation(ctx, draftId, languageId, accept, requestBody)
Set translations for language
Completely replaces any existing translations for the given language with those provided in request body. Variables embedded in keys or values are expected to be in the format %(my_variable)s and will automatically convert to the correct Dyspatch format depending on the type of template. Accepts key/value pairs in JSON format or in gettext PO file format. For JSON set Content-Type header to application/json. For gettext PO format set Content-Type header to text/x-gettext-translation.
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| draftId | string | A draft ID | |
| languageId | string | A language ID (eg: en-US) | |
| accept | 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" | |
| requestBody | map[string]string |
(empty response body)
- Content-Type: application/json
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SubmitDraftForApproval(ctx, draftId, accept)
Submit the draft for approval
Moves the draft into submitted state.
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| draftId | string | A draft ID | |
| accept | 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" |
(empty response body)
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]