Skip to content

Latest commit

 

History

History
361 lines (229 loc) · 9.32 KB

File metadata and controls

361 lines (229 loc) · 9.32 KB

\CampaignAPI

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

CreateCampaign

CreateResponse CreateCampaign(ctx).CampaignRequest(campaignRequest).Execute()

Create Campaign

Example

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

Path Parameters

Other Parameters

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

Name Type Description Notes
campaignRequest CampaignRequest The campaign content

Return type

CreateResponse

Authorization

apiKeyAuth

HTTP request headers

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

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

DeleteCampaign

DeleteCampaign200Response DeleteCampaign(ctx, campaignId).Execute()

Delete Campaign

Example

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

Path Parameters

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

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

Name Type Description Notes

Return type

DeleteCampaign200Response

Authorization

apiKeyAuth

HTTP request headers

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

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

EditCampaign

Campaign EditCampaign(ctx, campaignId).CampaignRequest(campaignRequest).Execute()

Edit Campaign

Example

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

Path Parameters

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

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

Name Type Description Notes
campaignRequest CampaignRequest

Return type

Campaign

Authorization

apiKeyAuth

HTTP request headers

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

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

GetAllCampaigns

[]Campaign GetAllCampaigns(ctx).Offset(offset).Limit(limit).Search(search).Execute()

Get All Campaigns

Example

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

Path Parameters

Other Parameters

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

Return type

[]Campaign

Authorization

apiKeyAuth

HTTP request headers

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

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

GetCampaignById

Campaign GetCampaignById(ctx, campaignId).Execute()

Get Campaign By Id

Example

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

Path Parameters

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

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

Name Type Description Notes

Return type

Campaign

Authorization

apiKeyAuth

HTTP request headers

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

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