All URIs are relative to https://api.elasticemail.com/v4
| Method | HTTP request | Description |
|---|---|---|
| WebhookByPublicidDelete | Delete /webhook/{publicid} | Delete Webhook |
| WebhookByPublicidGet | Get /webhook/{publicid} | Load Webhook |
| WebhookByPublicidPut | Put /webhook/{publicid} | Update Webhook |
| WebhookGet | Get /webhook | Load Webhooks |
| WebhookPost | Post /webhook | Add Webhook |
WebhookByPublicidDelete(ctx, publicid).Execute()
Delete Webhook
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
publicid := "publicid_example" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.WebhookAPI.WebhookByPublicidDelete(context.Background(), publicid).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WebhookAPI.WebhookByPublicidDelete``: %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. | |
| publicid | string |
Other parameters are passed through a pointer to a apiWebhookByPublicidDeleteRequest 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]
Webhook WebhookByPublicidGet(ctx, publicid).Execute()
Load Webhook
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
publicid := "publicid_example" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.WebhookAPI.WebhookByPublicidGet(context.Background(), publicid).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WebhookAPI.WebhookByPublicidGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `WebhookByPublicidGet`: Webhook
fmt.Fprintf(os.Stdout, "Response from `WebhookAPI.WebhookByPublicidGet`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| publicid | string |
Other parameters are passed through a pointer to a apiWebhookByPublicidGetRequest 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]
Webhook WebhookByPublicidPut(ctx, publicid).WebhookUpdatePayload(webhookUpdatePayload).Execute()
Update Webhook
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
publicid := "publicid_example" // string |
webhookUpdatePayload := *openapiclient.NewWebhookUpdatePayload() // WebhookUpdatePayload |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.WebhookAPI.WebhookByPublicidPut(context.Background(), publicid).WebhookUpdatePayload(webhookUpdatePayload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WebhookAPI.WebhookByPublicidPut``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `WebhookByPublicidPut`: Webhook
fmt.Fprintf(os.Stdout, "Response from `WebhookAPI.WebhookByPublicidPut`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| publicid | string |
Other parameters are passed through a pointer to a apiWebhookByPublicidPutRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
webhookUpdatePayload | WebhookUpdatePayload | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]Webhook WebhookGet(ctx).Limit(limit).Offset(offset).Execute()
Load Webhooks
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.WebhookAPI.WebhookGet(context.Background()).Limit(limit).Offset(offset).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WebhookAPI.WebhookGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `WebhookGet`: []Webhook
fmt.Fprintf(os.Stdout, "Response from `WebhookAPI.WebhookGet`: %v\n", resp)
}Other parameters are passed through a pointer to a apiWebhookGetRequest 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]
Webhook WebhookPost(ctx).WebhookCreatePayload(webhookCreatePayload).Execute()
Add Webhook
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
webhookCreatePayload := *openapiclient.NewWebhookCreatePayload("attachment.txt", "http://address.for.notification.com") // WebhookCreatePayload |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.WebhookAPI.WebhookPost(context.Background()).WebhookCreatePayload(webhookCreatePayload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WebhookAPI.WebhookPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `WebhookPost`: Webhook
fmt.Fprintf(os.Stdout, "Response from `WebhookAPI.WebhookPost`: %v\n", resp)
}Other parameters are passed through a pointer to a apiWebhookPostRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| webhookCreatePayload | WebhookCreatePayload |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]