Skip to content

Latest commit

 

History

History
142 lines (88 loc) · 3.79 KB

File metadata and controls

142 lines (88 loc) · 3.79 KB

\EventAPI

All URIs are relative to https://api.sendx.io/api/v1/rest

Method HTTP request Description
CreateRevenueEvent Post /events/revenue Record a revenue event for a specific contact
PushCustomEvent Post /events/custom Push a custom event associated with a contact

CreateRevenueEvent

EventResponse CreateRevenueEvent(ctx).RevenueEventRequest(revenueEventRequest).Execute()

Record a revenue event for a specific contact

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/sendx/sendx-go-sdk"
)

func main() {
	revenueEventRequest := *openapiclient.NewRevenueEventRequest("john.doe@example.com", float32(123.23), "INR", "app", int32(1669990400)) // RevenueEventRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.EventAPI.CreateRevenueEvent(context.Background()).RevenueEventRequest(revenueEventRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventAPI.CreateRevenueEvent``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateRevenueEvent`: EventResponse
	fmt.Fprintf(os.Stdout, "Response from `EventAPI.CreateRevenueEvent`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
revenueEventRequest RevenueEventRequest

Return type

EventResponse

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]

PushCustomEvent

EventResponse PushCustomEvent(ctx).CustomEventRequest(customEventRequest).Execute()

Push a custom event associated with a contact

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/sendx/sendx-go-sdk"
)

func main() {
	customEventRequest := *openapiclient.NewCustomEventRequest("abandoned_cart", "john.doe@example.com", map[string]string{"key": "Inner_example"}, int32(1669990400)) // CustomEventRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.EventAPI.PushCustomEvent(context.Background()).CustomEventRequest(customEventRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventAPI.PushCustomEvent``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PushCustomEvent`: EventResponse
	fmt.Fprintf(os.Stdout, "Response from `EventAPI.PushCustomEvent`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
customEventRequest CustomEventRequest

Return type

EventResponse

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]