All URIs are relative to https://api.elasticemail.com/v4
| Method | HTTP request | Description |
|---|---|---|
| CampaignsByNameDelete | Delete /campaigns/{name} | Delete Campaign |
| CampaignsByNameGet | Get /campaigns/{name} | Load Campaign |
| CampaignsByNamePausePut | Put /campaigns/{name}/pause | Pause Campaign |
| CampaignsByNamePut | Put /campaigns/{name} | Update Campaign |
| CampaignsGet | Get /campaigns | Load Campaigns |
| CampaignsPost | Post /campaigns | Add Campaign |
CampaignsByNameDelete(ctx, name).Execute()
Delete Campaign
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
name := "name_example" // string | Name of Campaign to delete
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.CampaignsAPI.CampaignsByNameDelete(context.Background(), name).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CampaignsAPI.CampaignsByNameDelete``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| name | string | Name of Campaign to delete |
Other parameters are passed through a pointer to a apiCampaignsByNameDeleteRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Campaign CampaignsByNameGet(ctx, name).Execute()
Load Campaign
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
name := "name_example" // string | Name of Campaign to get
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CampaignsAPI.CampaignsByNameGet(context.Background(), name).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CampaignsAPI.CampaignsByNameGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CampaignsByNameGet`: Campaign
fmt.Fprintf(os.Stdout, "Response from `CampaignsAPI.CampaignsByNameGet`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| name | string | Name of Campaign to get |
Other parameters are passed through a pointer to a apiCampaignsByNameGetRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CampaignsByNamePausePut(ctx, name).Execute()
Pause Campaign
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
name := "name_example" // string | Name of Campaign to pause
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.CampaignsAPI.CampaignsByNamePausePut(context.Background(), name).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CampaignsAPI.CampaignsByNamePausePut``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| name | string | Name of Campaign to pause |
Other parameters are passed through a pointer to a apiCampaignsByNamePausePutRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Campaign CampaignsByNamePut(ctx, name).Campaign(campaign).Execute()
Update Campaign
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
name := "name_example" // string | Name of Campaign to update
campaign := *openapiclient.NewCampaign("Name_example", *openapiclient.NewCampaignRecipient()) // Campaign | JSON representation of a campaign
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CampaignsAPI.CampaignsByNamePut(context.Background(), name).Campaign(campaign).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CampaignsAPI.CampaignsByNamePut``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CampaignsByNamePut`: Campaign
fmt.Fprintf(os.Stdout, "Response from `CampaignsAPI.CampaignsByNamePut`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| name | string | Name of Campaign to update |
Other parameters are passed through a pointer to a apiCampaignsByNamePutRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
campaign | Campaign | JSON representation of a campaign |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]Campaign CampaignsGet(ctx).Search(search).Offset(offset).Limit(limit).Execute()
Load Campaigns
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
search := "search_example" // string | Text fragment used for searching in Campaign name (using the 'contains' rule) (optional)
offset := int32(20) // int32 | How many items should be returned ahead. (optional)
limit := int32(100) // int32 | Maximum number of returned items. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CampaignsAPI.CampaignsGet(context.Background()).Search(search).Offset(offset).Limit(limit).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CampaignsAPI.CampaignsGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CampaignsGet`: []Campaign
fmt.Fprintf(os.Stdout, "Response from `CampaignsAPI.CampaignsGet`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCampaignsGetRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| search | string | Text fragment used for searching in Campaign name (using the 'contains' rule) | |
| offset | int32 | How many items should be returned ahead. | |
| limit | int32 | Maximum number of returned items. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Campaign CampaignsPost(ctx).Campaign(campaign).Execute()
Add Campaign
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
campaign := *openapiclient.NewCampaign("Name_example", *openapiclient.NewCampaignRecipient()) // Campaign | JSON representation of a campaign
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CampaignsAPI.CampaignsPost(context.Background()).Campaign(campaign).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CampaignsAPI.CampaignsPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CampaignsPost`: Campaign
fmt.Fprintf(os.Stdout, "Response from `CampaignsAPI.CampaignsPost`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCampaignsPostRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| campaign | Campaign | JSON representation of a campaign |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]