All URIs are relative to https://api.elasticemail.com/v4
| Method | HTTP request | Description |
|---|---|---|
| SubaccountsByEmailCreditsPatch | Patch /subaccounts/{email}/credits | Add, Subtract Email Credits |
| SubaccountsByEmailDelete | Delete /subaccounts/{email} | Delete SubAccount |
| SubaccountsByEmailGet | Get /subaccounts/{email} | Load SubAccount |
| SubaccountsByEmailSettingsEmailPut | Put /subaccounts/{email}/settings/email | Update SubAccount Email Settings |
| SubaccountsGet | Get /subaccounts | Load SubAccounts |
| SubaccountsPost | Post /subaccounts | Add SubAccount |
SubaccountsByEmailCreditsPatch(ctx, email).SubaccountEmailCreditsPayload(subaccountEmailCreditsPayload).Execute()
Add, Subtract Email Credits
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
email := "mail@example.com" // string | Email address of Sub-Account
subaccountEmailCreditsPayload := *openapiclient.NewSubaccountEmailCreditsPayload(int32(123)) // SubaccountEmailCreditsPayload | Amount of email credits to add or subtract from the current SubAccount email credits pool (positive or negative value)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.SubAccountsAPI.SubaccountsByEmailCreditsPatch(context.Background(), email).SubaccountEmailCreditsPayload(subaccountEmailCreditsPayload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SubAccountsAPI.SubaccountsByEmailCreditsPatch``: %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. | |
| string | Email address of Sub-Account |
Other parameters are passed through a pointer to a apiSubaccountsByEmailCreditsPatchRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
subaccountEmailCreditsPayload | SubaccountEmailCreditsPayload | Amount of email credits to add or subtract from the current SubAccount email credits pool (positive or negative value) |
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SubaccountsByEmailDelete(ctx, email).Execute()
Delete SubAccount
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
email := "mail@example.com" // string | Email address of Sub-Account
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.SubAccountsAPI.SubaccountsByEmailDelete(context.Background(), email).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SubAccountsAPI.SubaccountsByEmailDelete``: %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. | |
| string | Email address of Sub-Account |
Other parameters are passed through a pointer to a apiSubaccountsByEmailDeleteRequest 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]
SubAccountInfo SubaccountsByEmailGet(ctx, email).Execute()
Load SubAccount
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
email := "mail@example.com" // string | Email address of Sub-Account
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.SubAccountsAPI.SubaccountsByEmailGet(context.Background(), email).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SubAccountsAPI.SubaccountsByEmailGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `SubaccountsByEmailGet`: SubAccountInfo
fmt.Fprintf(os.Stdout, "Response from `SubAccountsAPI.SubaccountsByEmailGet`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| string | Email address of Sub-Account |
Other parameters are passed through a pointer to a apiSubaccountsByEmailGetRequest 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]
SubaccountEmailSettings SubaccountsByEmailSettingsEmailPut(ctx, email).SubaccountEmailSettings(subaccountEmailSettings).Execute()
Update SubAccount Email Settings
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
email := "email_example" // string |
subaccountEmailSettings := *openapiclient.NewSubaccountEmailSettings() // SubaccountEmailSettings | Updated Email Settings
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.SubAccountsAPI.SubaccountsByEmailSettingsEmailPut(context.Background(), email).SubaccountEmailSettings(subaccountEmailSettings).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SubAccountsAPI.SubaccountsByEmailSettingsEmailPut``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `SubaccountsByEmailSettingsEmailPut`: SubaccountEmailSettings
fmt.Fprintf(os.Stdout, "Response from `SubAccountsAPI.SubaccountsByEmailSettingsEmailPut`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| string |
Other parameters are passed through a pointer to a apiSubaccountsByEmailSettingsEmailPutRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
subaccountEmailSettings | SubaccountEmailSettings | Updated Email Settings |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]SubAccountInfo SubaccountsGet(ctx).Limit(limit).Offset(offset).Execute()
Load SubAccounts
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.SubAccountsAPI.SubaccountsGet(context.Background()).Limit(limit).Offset(offset).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SubAccountsAPI.SubaccountsGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `SubaccountsGet`: []SubAccountInfo
fmt.Fprintf(os.Stdout, "Response from `SubAccountsAPI.SubaccountsGet`: %v\n", resp)
}Other parameters are passed through a pointer to a apiSubaccountsGetRequest 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]
SubAccountInfo SubaccountsPost(ctx).SubaccountPayload(subaccountPayload).Execute()
Add SubAccount
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
subaccountPayload := *openapiclient.NewSubaccountPayload("mail@example.com", "********") // SubaccountPayload |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.SubAccountsAPI.SubaccountsPost(context.Background()).SubaccountPayload(subaccountPayload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SubAccountsAPI.SubaccountsPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `SubaccountsPost`: SubAccountInfo
fmt.Fprintf(os.Stdout, "Response from `SubAccountsAPI.SubaccountsPost`: %v\n", resp)
}Other parameters are passed through a pointer to a apiSubaccountsPostRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| subaccountPayload | SubaccountPayload |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]