Skip to content

NandosUK/talon_go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for talon

Use the Talon.One API to integrate with your application and to manage applications and campaigns:

Determining the base URL of the endpoints

The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at https://yourbaseurl.talon.one/, the URL for the updateCustomerSessionV2 endpoint is https://yourbaseurl.talon.one/v2/customer_sessions/{Id}

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version:
  • Package version: 8.0.0
  • Build package: org.openapitools.codegen.languages.GoClientExperimentalCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import sw "./talon"

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identifield by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Getting Started

Integration API

Note: The Integration API's V1 Update customer session and Update customer profile endpoints are now deprecated. Use their V2 instead. See Migrating to V2 for more information.

package main

import (
	"context"
	"encoding/json"
	"fmt"

	talon "github.com/talon-one/talon_go/v8"
)

func main() {
	configuration := talon.NewConfiguration()
	// Set API base path
	configuration.Servers = talon.ServerConfigurations{
		{
			// Notice that there is no trailing '/'
			URL:         "https://yourbaseurl.talon.one",
			Description: "Talon.One's API base URL",
		},
	}
	// If you wish to inject a custom implementation of HTTPClient
	// configuration.HTTPClient = &customHTTPClient

	integrationClient := talon.NewAPIClient(configuration)

	// Create integration authentication context using api key
	integrationAuthContext := context.WithValue(context.Background(), talon.ContextAPIKeys, map[string]talon.APIKey{
		"Authorization": {
			Prefix: "ApiKey-v1",
			Key:    "fd1fd219b1e953a6b2700e8034de5bfc877462ae106127311ddd710978654312",
		},
	})

	// Instantiating a NewCustomerSessionV2 struct
	newCustomerSession := talon.NewCustomerSessionV2{
		// You can use either struct literals
		ProfileId:   talon.PtrString("DEADBEEF"),
		CouponCodes: &[]string{"Cool-Stuff!"},
	}

	// Or alternatively, using the relevant setter in a later stage in the code
	newCustomerSession.SetCartItems([]talon.CartItem{
		{
			Name:     talon.PtrString("Pad Thai - Veggie"),
			Sku:      "pad-332",
			Quantity: 1,
			Price:    talon.PtrFloat32(5.5),
			Category: talon.PtrString("Noodles"),
		},
		{
			Name:     talon.PtrString("Chang"),
			Sku:      "chang-br-42",
			Quantity: 1,
			Price:    talon.PtrFloat32(2.3),
			Category: talon.PtrString("Beverages"),
		},
	})

	// Instantiating a new IntegrationRequest
	integrationRequest := talon.IntegrationRequest{
		CustomerSession: newCustomerSession,
	}

	// Optional list of requested information to be present on the response.
  // See docs/IntegrationRequest.md for full list of supported values
	// integrationRequest.SetResponseContent([]string{
	// 	"customerSession",
	// 	"customerProfile",
	// 	"loyalty",
	// })

	// Create/update a customer session using `UpdateCustomerSessionV2` function
	integrationState, _, err := integrationClient.IntegrationApi.
		UpdateCustomerSessionV2(integrationAuthContext, "deetdoot_2").
		Body(integrationRequest).
		Execute()

	if err != nil {
		fmt.Printf("ERROR while calling UpdateCustomerSessionV2: %s\n", err)
		return
	}
	fmt.Printf("%#v\n", integrationState)

	// Parsing the returned effects list, please consult https://developers.talon.one/Integration-API/handling-effects-v2 for the full list of effects and their corresponding properties
	for _, effect := range integrationState.GetEffects() {
		effectType := effect.GetEffectType()
		switch {
		case "setDiscount" == effectType:
			// Initiating right props instance according to the effect type
			effectProps := talon.SetDiscountEffectProps{}
			if err := decodeHelper(effect.GetProps(), &effectProps); err != nil {
				fmt.Printf("ERROR while decoding 'setDiscount' props: %s\n", err)
				continue
			}

			// Access the specific effect's properties
			fmt.Printf("Set a discount '%s' of %2.3f\n", effectProps.GetName(), effectProps.GetValue())
		case "acceptCoupon" == effectType:
			// Initiating right props instance according to the effect type
			effectProps := talon.AcceptCouponEffectProps{}
			if err := decodeHelper(effect.GetProps(), &effectProps); err != nil {
				fmt.Printf("ERROR while decoding props: %s\n", err)
				continue
			}

			// Work with AcceptCouponEffectProps' properties
			// ...
		default:
			fmt.Printf("Encounter unknown effect type: %s\n", effectType)
		}
	}
}

// quick decoding of props-map into our library structures using JSON marshaling,
// or alternatively using a library like https://github.com/mitchellh/mapstructure
func decodeHelper(propsMap map[string]interface{}, v interface{}) error {
	propsJSON, err := json.Marshal(propsMap)
	if err != nil {
		return err
	}
	return json.Unmarshal(propsJSON, v)
}

Management API

package main

import (
	"context"
	"fmt"

	talon "github.com/talon-one/talon_go/v8"
)

func main() {
	configuration := talon.NewConfiguration()
	// Set API base path
	configuration.Servers = talon.ServerConfigurations{
		{
			// Notice that there is no trailing '/'
			URL:         "https://yourbaseurl.talon.one",
			Description: "Talon.One's API base URL",
		},
	}
	// If you wish to inject a custom implementation of HTTPClient
	// configuration.HTTPClient = &customHTTPClient

	managementClient := talon.NewAPIClient(configuration)

	// Create integration authentication context using the logged-in session
	managerAuthContext := context.WithValue(context.Background(), talon.ContextAPIKeys, map[string]talon.APIKey{
		"Authorization": talon.APIKey{
			Prefix: "ManagementKey-v1",
			Key:    "2f0dce055da01ae595005d7d79154bae7448d319d5fc7c5b2951fadd6ba1ea07",
		},
	})

	// Calling `GetApplication` function with the desired id (7)
	application, response, err := managementClient.ManagementApi.
		GetApplication(managerAuthContext, 7).
		Execute()

	if err != nil {
		fmt.Printf("ERROR while calling GetApplication: %s\n", err)
		return
	}

	fmt.Printf("%#v\n\n", application)
	fmt.Printf("%#v\n\n", response)
}

Documentation for API Endpoints

All URIs are relative to https://yourbaseurl.talon.one

Class Method HTTP request Description
IntegrationApi CreateAudienceV2 Post /v2/audiences Create audience
IntegrationApi CreateCouponReservation Post /v1/coupon_reservations/{couponValue} Create coupon reservation
IntegrationApi CreateReferral Post /v1/referrals Create referral code for an advocate
IntegrationApi CreateReferralsForMultipleAdvocates Post /v1/referrals_for_multiple_advocates Create referral codes for multiple advocates
IntegrationApi DeleteAudienceMembershipsV2 Delete /v2/audiences/{audienceId}/memberships Delete audience memberships
IntegrationApi DeleteAudienceV2 Delete /v2/audiences/{audienceId} Delete audience
IntegrationApi DeleteCouponReservation Delete /v1/coupon_reservations/{couponValue} Delete coupon reservations
IntegrationApi DeleteCustomerData Delete /v1/customer_data/{integrationId} Delete customer's personal data
IntegrationApi GenerateLoyaltyCard Post /v1/loyalty_programs/{loyaltyProgramId}/cards Generate loyalty card
IntegrationApi GetCustomerInventory Get /v1/customer_profiles/{integrationId}/inventory List customer data
IntegrationApi GetCustomerSession Get /v2/customer_sessions/{customerSessionId} Get customer session
IntegrationApi GetLoyaltyBalances Get /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/balances Get customer's loyalty points
IntegrationApi GetLoyaltyCardBalances Get /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/balances Get card's point balances
IntegrationApi GetLoyaltyCardPoints Get /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/points List card's unused loyalty points
IntegrationApi GetLoyaltyCardTransactions Get /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/transactions List card's transactions
IntegrationApi GetLoyaltyProgramProfilePoints Get /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/points List customer's unused loyalty points
IntegrationApi GetLoyaltyProgramProfileTransactions Get /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/transactions List customer's loyalty transactions
IntegrationApi GetReservedCustomers Get /v1/coupon_reservations/customerprofiles/{couponValue} List customers that have this coupon reserved
IntegrationApi LinkLoyaltyCardToProfile Post /v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/link_profile Link customer profile to card
IntegrationApi ReopenCustomerSession Put /v2/customer_sessions/{customerSessionId}/reopen Reopen customer session
IntegrationApi ReturnCartItems Post /v2/customer_sessions/{customerSessionId}/returns Return cart items
IntegrationApi SyncCatalog Put /v1/catalogs/{catalogId}/sync Sync cart item catalog
IntegrationApi TrackEventV2 Post /v2/events Track event
IntegrationApi UpdateAudienceCustomersAttributes Put /v2/audience_customers/{audienceId}/attributes Update profile attributes for all customers in audience
IntegrationApi UpdateAudienceV2 Put /v2/audiences/{audienceId} Update audience name
IntegrationApi UpdateCustomerProfileAudiences Post /v2/customer_audiences Update multiple customer profiles' audiences
IntegrationApi UpdateCustomerProfileV2 Put /v2/customer_profiles/{integrationId} Update customer profile
IntegrationApi UpdateCustomerProfilesV2 Put /v2/customer_profiles Update multiple customer profiles
IntegrationApi UpdateCustomerSessionV2 Put /v2/customer_sessions/{customerSessionId} Update customer session
ManagementApi ActivateUserByEmail Post /v1/users/activate Enable user by email address
ManagementApi AddLoyaltyCardPoints Put /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/add_points Add points to card
ManagementApi AddLoyaltyPoints Put /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/add_points Add points to customer profile
ManagementApi CopyCampaignToApplications Post /v1/applications/{applicationId}/campaigns/{campaignId}/copy Copy the campaign into the specified Application
ManagementApi CreateAccountCollection Post /v1/collections Create account-level collection
ManagementApi CreateAchievement Post /v1/applications/{applicationId}/campaigns/{campaignId}/achievements Create achievement
ManagementApi CreateAdditionalCost Post /v1/additional_costs Create additional cost
ManagementApi CreateAttribute Post /v1/attributes Create custom attribute
ManagementApi CreateBatchLoyaltyCards Post /v1/loyalty_programs/{loyaltyProgramId}/cards/batch Create loyalty cards
ManagementApi CreateCampaignFromTemplate Post /v1/applications/{applicationId}/create_campaign_from_template Create campaign from campaign template
ManagementApi CreateCollection Post /v1/applications/{applicationId}/campaigns/{campaignId}/collections Create campaign-level collection
ManagementApi CreateCoupons Post /v1/applications/{applicationId}/campaigns/{campaignId}/coupons Create coupons
ManagementApi CreateCouponsAsync Post /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_async Create coupons asynchronously
ManagementApi CreateCouponsDeletionJob Post /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_deletion_jobs Creates a coupon deletion job
ManagementApi CreateCouponsForMultipleRecipients Post /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_with_recipients Create coupons for multiple recipients
ManagementApi CreateInviteEmail Post /v1/invite_emails Resend invitation email
ManagementApi CreateInviteV2 Post /v2/invites Invite user
ManagementApi CreatePasswordRecoveryEmail Post /v1/password_recovery_emails Request a password reset
ManagementApi CreateSession Post /v1/sessions Create session
ManagementApi CreateStore Post /v1/applications/{applicationId}/stores Create store
ManagementApi DeactivateUserByEmail Post /v1/users/deactivate Disable user by email address
ManagementApi DeductLoyaltyCardPoints Put /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/deduct_points Deduct points from card
ManagementApi DeleteAccountCollection Delete /v1/collections/{collectionId} Delete account-level collection
ManagementApi DeleteAchievement Delete /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId} Delete achievement
ManagementApi DeleteCampaign Delete /v1/applications/{applicationId}/campaigns/{campaignId} Delete campaign
ManagementApi DeleteCollection Delete /v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId} Delete campaign-level collection
ManagementApi DeleteCoupon Delete /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId} Delete coupon
ManagementApi DeleteCoupons Delete /v1/applications/{applicationId}/campaigns/{campaignId}/coupons Delete coupons
ManagementApi DeleteLoyaltyCard Delete /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId} Delete loyalty card
ManagementApi DeleteReferral Delete /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId} Delete referral
ManagementApi DeleteStore Delete /v1/applications/{applicationId}/stores/{storeId} Delete store
ManagementApi DeleteUser Delete /v1/users/{userId} Delete user
ManagementApi DeleteUserByEmail Post /v1/users/delete Delete user by email address
ManagementApi DestroySession Delete /v1/sessions Destroy session
ManagementApi DisconnectCampaignStores Delete /v1/applications/{applicationId}/campaigns/{campaignId}/stores Disconnect stores
ManagementApi ExportAccountCollectionItems Get /v1/collections/{collectionId}/export Export account-level collection's items
ManagementApi ExportAchievements Get /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}/export Export achievement customer data
ManagementApi ExportAudiencesMemberships Get /v1/audiences/{audienceId}/memberships/export Export audience members
ManagementApi ExportCampaignStores Get /v1/applications/{applicationId}/campaigns/{campaignId}/stores/export Export stores
ManagementApi ExportCollectionItems Get /v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/export Export campaign-level collection's items
ManagementApi ExportCoupons Get /v1/applications/{applicationId}/export_coupons Export coupons
ManagementApi ExportCustomerSessions Get /v1/applications/{applicationId}/export_customer_sessions Export customer sessions
ManagementApi ExportCustomersTiers Get /v1/loyalty_programs/{loyaltyProgramId}/export_customers_tiers Export customers' tier data
ManagementApi ExportEffects Get /v1/applications/{applicationId}/export_effects Export triggered effects
ManagementApi ExportLoyaltyBalance Get /v1/loyalty_programs/{loyaltyProgramId}/export_customer_balance Export customer loyalty balance to CSV
ManagementApi ExportLoyaltyBalances Get /v1/loyalty_programs/{loyaltyProgramId}/export_customer_balances Export customer loyalty balances
ManagementApi ExportLoyaltyCardBalances Get /v1/loyalty_programs/{loyaltyProgramId}/export_card_balances Export all card transaction logs
ManagementApi ExportLoyaltyCardLedger Get /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/export_log Export card's ledger log
ManagementApi ExportLoyaltyCards Get /v1/loyalty_programs/{loyaltyProgramId}/cards/export Export loyalty cards
ManagementApi ExportLoyaltyLedger Get /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/export_log Export customer's transaction logs
ManagementApi ExportPoolGiveaways Get /v1/giveaways/pools/{poolId}/export Export giveaway codes of a giveaway pool
ManagementApi ExportReferrals Get /v1/applications/{applicationId}/export_referrals Export referrals
ManagementApi GetAccessLogsWithoutTotalCount Get /v1/applications/{applicationId}/access_logs/no_total Get access logs for Application
ManagementApi GetAccount Get /v1/accounts/{accountId} Get account details
ManagementApi GetAccountAnalytics Get /v1/accounts/{accountId}/analytics Get account analytics
ManagementApi GetAccountCollection Get /v1/collections/{collectionId} Get account-level collection
ManagementApi GetAchievement Get /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId} Get achievement
ManagementApi GetAdditionalCost Get /v1/additional_costs/{additionalCostId} Get additional cost
ManagementApi GetAdditionalCosts Get /v1/additional_costs List additional costs
ManagementApi GetAllAccessLogs Get /v1/access_logs List access logs
ManagementApi GetApplication Get /v1/applications/{applicationId} Get Application
ManagementApi GetApplicationApiHealth Get /v1/applications/{applicationId}/health_report Get Application health
ManagementApi GetApplicationCustomer Get /v1/applications/{applicationId}/customers/{customerId} Get application's customer
ManagementApi GetApplicationCustomerFriends Get /v1/applications/{applicationId}/profile/{integrationId}/friends List friends referred by customer profile
ManagementApi GetApplicationCustomers Get /v1/applications/{applicationId}/customers List application's customers
ManagementApi GetApplicationCustomersByAttributes Post /v1/applications/{applicationId}/customer_search List application customers matching the given attributes
ManagementApi GetApplicationEventTypes Get /v1/applications/{applicationId}/event_types List Applications event types
ManagementApi GetApplicationEventsWithoutTotalCount Get /v1/applications/{applicationId}/events/no_total List Applications events
ManagementApi GetApplicationSession Get /v1/applications/{applicationId}/sessions/{sessionId} Get Application session
ManagementApi GetApplicationSessions Get /v1/applications/{applicationId}/sessions List Application sessions
ManagementApi GetApplications Get /v1/applications List Applications
ManagementApi GetAttribute Get /v1/attributes/{attributeId} Get custom attribute
ManagementApi GetAttributes Get /v1/attributes List custom attributes
ManagementApi GetAudienceMemberships Get /v1/audiences/{audienceId}/memberships List audience members
ManagementApi GetAudiences Get /v1/audiences List audiences
ManagementApi GetAudiencesAnalytics Get /v1/audiences/analytics List audience analytics
ManagementApi GetCampaign Get /v1/applications/{applicationId}/campaigns/{campaignId} Get campaign
ManagementApi GetCampaignAnalytics Get /v1/applications/{applicationId}/campaigns/{campaignId}/analytics Get analytics of campaigns
ManagementApi GetCampaignByAttributes Post /v1/applications/{applicationId}/campaigns_search List campaigns that match the given attributes
ManagementApi GetCampaignGroup Get /v1/campaign_groups/{campaignGroupId} Get campaign access group
ManagementApi GetCampaignGroups Get /v1/campaign_groups List campaign access groups
ManagementApi GetCampaignTemplates Get /v1/campaign_templates List campaign templates
ManagementApi GetCampaigns Get /v1/applications/{applicationId}/campaigns List campaigns
ManagementApi GetChanges Get /v1/changes Get audit logs for an account
ManagementApi GetCollection Get /v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId} Get campaign-level collection
ManagementApi GetCollectionItems Get /v1/collections/{collectionId}/items Get collection items
ManagementApi GetCouponsWithoutTotalCount Get /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/no_total List coupons
ManagementApi GetCustomerActivityReport Get /v1/applications/{applicationId}/customer_activity_reports/{customerId} Get customer's activity report
ManagementApi GetCustomerActivityReportsWithoutTotalCount Get /v1/applications/{applicationId}/customer_activity_reports/no_total Get Activity Reports for Application Customers
ManagementApi GetCustomerAnalytics Get /v1/applications/{applicationId}/customers/{customerId}/analytics Get customer's analytics report
ManagementApi GetCustomerProfile Get /v1/customers/{customerId} Get customer profile
ManagementApi GetCustomerProfileAchievementProgress Get /v1/applications/{applicationId}/achievement_progress/{integrationId} List customer achievements
ManagementApi GetCustomerProfiles Get /v1/customers/no_total List customer profiles
ManagementApi GetCustomersByAttributes Post /v1/customer_search/no_total List customer profiles matching the given attributes
ManagementApi GetEventTypes Get /v1/event_types List event types
ManagementApi GetExports Get /v1/exports Get exports
ManagementApi GetLoyaltyCard Get /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId} Get loyalty card
ManagementApi GetLoyaltyCardTransactionLogs Get /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/logs List card's transactions
ManagementApi GetLoyaltyCards Get /v1/loyalty_programs/{loyaltyProgramId}/cards List loyalty cards
ManagementApi GetLoyaltyPoints Get /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId} Get customer's full loyalty ledger
ManagementApi GetLoyaltyProgram Get /v1/loyalty_programs/{loyaltyProgramId} Get loyalty program
ManagementApi GetLoyaltyProgramTransactions Get /v1/loyalty_programs/{loyaltyProgramId}/transactions List loyalty program transactions
ManagementApi GetLoyaltyPrograms Get /v1/loyalty_programs List loyalty programs
ManagementApi GetLoyaltyStatistics Get /v1/loyalty_programs/{loyaltyProgramId}/statistics Get loyalty program statistics
ManagementApi GetReferralsWithoutTotalCount Get /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/no_total List referrals
ManagementApi GetRoleV2 Get /v2/roles/{roleId} Get role
ManagementApi GetRuleset Get /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId} Get ruleset
ManagementApi GetRulesets Get /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets List campaign rulesets
ManagementApi GetStore Get /v1/applications/{applicationId}/stores/{storeId} Get store
ManagementApi GetUser Get /v1/users/{userId} Get user
ManagementApi GetUsers Get /v1/users List users in account
ManagementApi GetWebhook Get /v1/webhooks/{webhookId} Get webhook
ManagementApi GetWebhookActivationLogs Get /v1/webhook_activation_logs List webhook activation log entries
ManagementApi GetWebhookLogs Get /v1/webhook_logs List webhook log entries
ManagementApi GetWebhooks Get /v1/webhooks List webhooks
ManagementApi ImportAccountCollection Post /v1/collections/{collectionId}/import Import data into existing account-level collection
ManagementApi ImportAllowedList Post /v1/attributes/{attributeId}/allowed_list/import Import allowed values for attribute
ManagementApi ImportAudiencesMemberships Post /v1/audiences/{audienceId}/memberships/import Import audience members
ManagementApi ImportCampaignStores Post /v1/applications/{applicationId}/campaigns/{campaignId}/stores/import Import stores
ManagementApi ImportCollection Post /v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/import Import data into existing campaign-level collection
ManagementApi ImportCoupons Post /v1/applications/{applicationId}/campaigns/{campaignId}/import_coupons Import coupons
ManagementApi ImportLoyaltyCards Post /v1/loyalty_programs/{loyaltyProgramId}/import_cards Import loyalty cards
ManagementApi ImportLoyaltyCustomersTiers Post /v1/loyalty_programs/{loyaltyProgramId}/import_customers_tiers Import customers into loyalty tiers
ManagementApi ImportLoyaltyPoints Post /v1/loyalty_programs/{loyaltyProgramId}/import_points Import loyalty points
ManagementApi ImportPoolGiveaways Post /v1/giveaways/pools/{poolId}/import Import giveaway codes into a giveaway pool
ManagementApi ImportReferrals Post /v1/applications/{applicationId}/campaigns/{campaignId}/import_referrals Import referrals
ManagementApi InviteUserExternal Post /v1/users/invite Invite user from identity provider
ManagementApi ListAccountCollections Get /v1/collections List collections in account
ManagementApi ListAchievements Get /v1/applications/{applicationId}/campaigns/{campaignId}/achievements List achievements
ManagementApi ListAllRolesV2 Get /v2/roles List roles
ManagementApi ListCatalogItems Get /v1/catalogs/{catalogId}/items List items in a catalog
ManagementApi ListCollections Get /v1/applications/{applicationId}/campaigns/{campaignId}/collections List collections in campaign
ManagementApi ListCollectionsInApplication Get /v1/applications/{applicationId}/collections List collections in Application
ManagementApi ListStores Get /v1/applications/{applicationId}/stores List stores
ManagementApi NotificationActivation Put /v1/notifications/{notificationId}/activation Activate or deactivate notification
ManagementApi OktaEventHandlerChallenge Get /v1/provisioning/okta Validate Okta API ownership
ManagementApi PostAddedDeductedPointsNotification Post /v1/loyalty_programs/{loyaltyProgramId}/notifications/added_deducted_points Create notification about added or deducted loyalty points
ManagementApi PostCatalogsStrikethroughNotification Post /v1/applications/{applicationId}/catalogs/notifications/strikethrough Create strikethrough notification
ManagementApi PostPendingPointsNotification Post /v1/loyalty_programs/{loyaltyProgramId}/notifications/pending_points Create notification about pending loyalty points
ManagementApi RemoveLoyaltyPoints Put /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/deduct_points Deduct points from customer profile
ManagementApi ResetPassword Post /v1/reset_password Reset password
ManagementApi ScimCreateUser Post /v1/provisioning/scim/Users Create SCIM user
ManagementApi ScimDeleteUser Delete /v1/provisioning/scim/Users/{userId} Delete SCIM user
ManagementApi ScimGetResourceTypes Get /v1/provisioning/scim/ResourceTypes List supported SCIM resource types
ManagementApi ScimGetSchemas Get /v1/provisioning/scim/Schemas List supported SCIM schemas
ManagementApi ScimGetServiceProviderConfig Get /v1/provisioning/scim/ServiceProviderConfig Get SCIM service provider configuration
ManagementApi ScimGetUser Get /v1/provisioning/scim/Users/{userId} Get SCIM user
ManagementApi ScimGetUsers Get /v1/provisioning/scim/Users List SCIM users
ManagementApi ScimPatchUser Patch /v1/provisioning/scim/Users/{userId} Update SCIM user attributes
ManagementApi ScimReplaceUserAttributes Put /v1/provisioning/scim/Users/{userId} Update SCIM user
ManagementApi SearchCouponsAdvancedApplicationWideWithoutTotalCount Post /v1/applications/{applicationId}/coupons_search_advanced/no_total List coupons that match the given attributes (without total count)
ManagementApi SearchCouponsAdvancedWithoutTotalCount Post /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search_advanced/no_total List coupons that match the given attributes in campaign (without total count)
ManagementApi TransferLoyaltyCard Put /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/transfer Transfer card data
ManagementApi UpdateAccountCollection Put /v1/collections/{collectionId} Update account-level collection
ManagementApi UpdateAchievement Put /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId} Update achievement
ManagementApi UpdateAdditionalCost Put /v1/additional_costs/{additionalCostId} Update additional cost
ManagementApi UpdateAttribute Put /v1/attributes/{attributeId} Update custom attribute
ManagementApi UpdateCampaign Put /v1/applications/{applicationId}/campaigns/{campaignId} Update campaign
ManagementApi UpdateCollection Put /v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId} Update campaign-level collection's description
ManagementApi UpdateCoupon Put /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId} Update coupon
ManagementApi UpdateCouponBatch Put /v1/applications/{applicationId}/campaigns/{campaignId}/coupons Update coupons
ManagementApi UpdateLoyaltyCard Put /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId} Update loyalty card status
ManagementApi UpdateReferral Put /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId} Update referral
ManagementApi UpdateRoleV2 Put /v2/roles/{roleId} Update role
ManagementApi UpdateStore Put /v1/applications/{applicationId}/stores/{storeId} Update store
ManagementApi UpdateUser Put /v1/users/{userId} Update user

Documentation For Models

Documentation For Authorization

api_key_v1

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: Authorization and passed in as the auth context for each request.

management_key

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: Authorization and passed in as the auth context for each request.

manager_auth

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: Authorization and passed in as the auth context for each request.

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author