All URIs are relative to https://api.sendx.io/api/v1/rest
| Method | HTTP request | Description |
|---|---|---|
| CreateCampaign | Post /campaign | Create Campaign |
| DeleteCampaign | Delete /campaign/{campaignId} | Delete Campaign |
| EditCampaign | Put /campaign/{campaignId} | Edit Campaign |
| GetAllCampaigns | Get /campaign | Get All Campaigns |
| GetCampaignById | Get /campaign/{campaignId} | Get Campaign By Id |
CreateResponse CreateCampaign(ctx).CampaignRequest(campaignRequest).Execute()
Create Campaign
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/sendx/sendx-go-sdk"
)
func main() {
campaignRequest := *openapiclient.NewCampaignRequest() // CampaignRequest | The campaign content
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CampaignAPI.CreateCampaign(context.Background()).CampaignRequest(campaignRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CampaignAPI.CreateCampaign``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateCampaign`: CreateResponse
fmt.Fprintf(os.Stdout, "Response from `CampaignAPI.CreateCampaign`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateCampaignRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| campaignRequest | CampaignRequest | The campaign content |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteCampaign200Response DeleteCampaign(ctx, campaignId).Execute()
Delete Campaign
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/sendx/sendx-go-sdk"
)
func main() {
campaignId := "campaignId_example" // string | The ID of the campaign to delete
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CampaignAPI.DeleteCampaign(context.Background(), campaignId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CampaignAPI.DeleteCampaign``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteCampaign`: DeleteCampaign200Response
fmt.Fprintf(os.Stdout, "Response from `CampaignAPI.DeleteCampaign`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| campaignId | string | The ID of the campaign to delete |
Other parameters are passed through a pointer to a apiDeleteCampaignRequest 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]
Campaign EditCampaign(ctx, campaignId).CampaignRequest(campaignRequest).Execute()
Edit Campaign
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/sendx/sendx-go-sdk"
)
func main() {
campaignRequest := *openapiclient.NewCampaignRequest() // CampaignRequest |
campaignId := "campaignId_example" // string | The ID of the campaign to edit
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CampaignAPI.EditCampaign(context.Background(), campaignId).CampaignRequest(campaignRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CampaignAPI.EditCampaign``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `EditCampaign`: Campaign
fmt.Fprintf(os.Stdout, "Response from `CampaignAPI.EditCampaign`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| campaignId | string | The ID of the campaign to edit |
Other parameters are passed through a pointer to a apiEditCampaignRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| campaignRequest | CampaignRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]Campaign GetAllCampaigns(ctx).Offset(offset).Limit(limit).Search(search).Execute()
Get All Campaigns
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/sendx/sendx-go-sdk"
)
func main() {
offset := int32(56) // int32 | Offset for pagination (optional) (default to 0)
limit := int32(56) // int32 | Limit for pagination (optional) (default to 20)
search := "search_example" // string | Search term to filter campaigns (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CampaignAPI.GetAllCampaigns(context.Background()).Offset(offset).Limit(limit).Search(search).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CampaignAPI.GetAllCampaigns``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetAllCampaigns`: []Campaign
fmt.Fprintf(os.Stdout, "Response from `CampaignAPI.GetAllCampaigns`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGetAllCampaignsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| offset | int32 | Offset for pagination | [default to 0] |
| limit | int32 | Limit for pagination | [default to 20] |
| search | string | Search term to filter campaigns |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Campaign GetCampaignById(ctx, campaignId).Execute()
Get Campaign By Id
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/sendx/sendx-go-sdk"
)
func main() {
campaignId := "campaignId_example" // string | The ID of the campaign to retrieve.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CampaignAPI.GetCampaignById(context.Background(), campaignId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CampaignAPI.GetCampaignById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetCampaignById`: Campaign
fmt.Fprintf(os.Stdout, "Response from `CampaignAPI.GetCampaignById`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| campaignId | string | The ID of the campaign to retrieve. |
Other parameters are passed through a pointer to a apiGetCampaignByIdRequest 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]