All URIs are relative to https://api.elasticemail.com/v4
| Method | HTTP request | Description |
|---|---|---|
| ListsByListnameContactsGet | Get /lists/{listname}/contacts | Load Contacts in List |
| ListsByNameContactsPost | Post /lists/{name}/contacts | Add Contacts to List |
| ListsByNameContactsRemovePost | Post /lists/{name}/contacts/remove | Remove Contacts from List |
| ListsByNameDelete | Delete /lists/{name} | Delete List |
| ListsByNameGet | Get /lists/{name} | Load List |
| ListsByNamePut | Put /lists/{name} | Update List |
| ListsGet | Get /lists | Load Lists |
| ListsPost | Post /lists | Add List |
[]Contact ListsByListnameContactsGet(ctx, listname).Limit(limit).Offset(offset).Execute()
Load Contacts in List
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
listname := "My List 1" // string | Name of your list.
limit := int32(100) // int32 | Maximum number of returned items. (optional)
offset := int32(20) // int32 | How many items should be returned ahead. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ListsAPI.ListsByListnameContactsGet(context.Background(), listname).Limit(limit).Offset(offset).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ListsAPI.ListsByListnameContactsGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListsByListnameContactsGet`: []Contact
fmt.Fprintf(os.Stdout, "Response from `ListsAPI.ListsByListnameContactsGet`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| listname | string | Name of your list. |
Other parameters are passed through a pointer to a apiListsByListnameContactsGetRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
limit | int32 | Maximum number of returned items. | offset | int32 | How many items should be returned ahead. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ContactsList ListsByNameContactsPost(ctx, name).EmailsPayload(emailsPayload).Execute()
Add Contacts to List
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
name := "My List 1" // string | Name of your list.
emailsPayload := *openapiclient.NewEmailsPayload() // EmailsPayload | Provide either rule or a list of emails, not both.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ListsAPI.ListsByNameContactsPost(context.Background(), name).EmailsPayload(emailsPayload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ListsAPI.ListsByNameContactsPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListsByNameContactsPost`: ContactsList
fmt.Fprintf(os.Stdout, "Response from `ListsAPI.ListsByNameContactsPost`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| name | string | Name of your list. |
Other parameters are passed through a pointer to a apiListsByNameContactsPostRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
emailsPayload | EmailsPayload | Provide either rule or a list of emails, not both. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListsByNameContactsRemovePost(ctx, name).EmailsPayload(emailsPayload).Execute()
Remove Contacts from List
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
name := "My List 1" // string | Name of your list.
emailsPayload := *openapiclient.NewEmailsPayload() // EmailsPayload | Provide either rule or a list of emails, not both.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.ListsAPI.ListsByNameContactsRemovePost(context.Background(), name).EmailsPayload(emailsPayload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ListsAPI.ListsByNameContactsRemovePost``: %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 your list. |
Other parameters are passed through a pointer to a apiListsByNameContactsRemovePostRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
emailsPayload | EmailsPayload | Provide either rule or a list of emails, not both. |
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListsByNameDelete(ctx, name).Execute()
Delete List
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
name := "My List 1" // string | Name of your list.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.ListsAPI.ListsByNameDelete(context.Background(), name).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ListsAPI.ListsByNameDelete``: %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 your list. |
Other parameters are passed through a pointer to a apiListsByNameDeleteRequest 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]
ContactsList ListsByNameGet(ctx, name).Execute()
Load List
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
name := "My List 1" // string | Name of your list.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ListsAPI.ListsByNameGet(context.Background(), name).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ListsAPI.ListsByNameGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListsByNameGet`: ContactsList
fmt.Fprintf(os.Stdout, "Response from `ListsAPI.ListsByNameGet`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| name | string | Name of your list. |
Other parameters are passed through a pointer to a apiListsByNameGetRequest 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]
ContactsList ListsByNamePut(ctx, name).ListUpdatePayload(listUpdatePayload).Execute()
Update List
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
name := "My List 1" // string | Name of your list.
listUpdatePayload := *openapiclient.NewListUpdatePayload() // ListUpdatePayload |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ListsAPI.ListsByNamePut(context.Background(), name).ListUpdatePayload(listUpdatePayload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ListsAPI.ListsByNamePut``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListsByNamePut`: ContactsList
fmt.Fprintf(os.Stdout, "Response from `ListsAPI.ListsByNamePut`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| name | string | Name of your list. |
Other parameters are passed through a pointer to a apiListsByNamePutRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
listUpdatePayload | ListUpdatePayload | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]ContactsList ListsGet(ctx).Limit(limit).Offset(offset).Execute()
Load Lists
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
limit := int32(100) // int32 | Maximum number of returned items. (optional)
offset := int32(20) // int32 | How many items should be returned ahead. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ListsAPI.ListsGet(context.Background()).Limit(limit).Offset(offset).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ListsAPI.ListsGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListsGet`: []ContactsList
fmt.Fprintf(os.Stdout, "Response from `ListsAPI.ListsGet`: %v\n", resp)
}Other parameters are passed through a pointer to a apiListsGetRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int32 | Maximum number of returned items. | |
| offset | int32 | How many items should be returned ahead. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ContactsList ListsPost(ctx).ListPayload(listPayload).Execute()
Add List
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
listPayload := *openapiclient.NewListPayload("My List 1") // ListPayload |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ListsAPI.ListsPost(context.Background()).ListPayload(listPayload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ListsAPI.ListsPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListsPost`: ContactsList
fmt.Fprintf(os.Stdout, "Response from `ListsAPI.ListsPost`: %v\n", resp)
}Other parameters are passed through a pointer to a apiListsPostRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| listPayload | ListPayload |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]