Skip to content

Latest commit

 

History

History
576 lines (366 loc) · 14.8 KB

File metadata and controls

576 lines (366 loc) · 14.8 KB

\ListsAPI

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

ListsByListnameContactsGet

[]Contact ListsByListnameContactsGet(ctx, listname).Limit(limit).Offset(offset).Execute()

Load Contacts in List

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
listname string Name of your list.

Other Parameters

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. |

Return type

[]Contact

Authorization

apikey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListsByNameContactsPost

ContactsList ListsByNameContactsPost(ctx, name).EmailsPayload(emailsPayload).Execute()

Add Contacts to List

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name of your list.

Other Parameters

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. |

Return type

ContactsList

Authorization

apikey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListsByNameContactsRemovePost

ListsByNameContactsRemovePost(ctx, name).EmailsPayload(emailsPayload).Execute()

Remove Contacts from List

Example

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)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name of your list.

Other Parameters

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. |

Return type

(empty response body)

Authorization

apikey

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListsByNameDelete

ListsByNameDelete(ctx, name).Execute()

Delete List

Example

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)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name of your list.

Other Parameters

Other parameters are passed through a pointer to a apiListsByNameDeleteRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apikey

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListsByNameGet

ContactsList ListsByNameGet(ctx, name).Execute()

Load List

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name of your list.

Other Parameters

Other parameters are passed through a pointer to a apiListsByNameGetRequest struct via the builder pattern

Name Type Description Notes

Return type

ContactsList

Authorization

apikey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListsByNamePut

ContactsList ListsByNamePut(ctx, name).ListUpdatePayload(listUpdatePayload).Execute()

Update List

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name of your list.

Other Parameters

Other parameters are passed through a pointer to a apiListsByNamePutRequest struct via the builder pattern

Name Type Description Notes

listUpdatePayload | ListUpdatePayload | |

Return type

ContactsList

Authorization

apikey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListsGet

[]ContactsList ListsGet(ctx).Limit(limit).Offset(offset).Execute()

Load Lists

Example

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)
}

Path Parameters

Other Parameters

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.

Return type

[]ContactsList

Authorization

apikey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListsPost

ContactsList ListsPost(ctx).ListPayload(listPayload).Execute()

Add List

Example

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)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiListsPostRequest struct via the builder pattern

Name Type Description Notes
listPayload ListPayload

Return type

ContactsList

Authorization

apikey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]