Skip to content
Talon.One API SDK for Go
Go Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.swagger-codegen
api
docs
.gitignore
.swagger-codegen-ignore
.travis.yml
README.md
api_integration.go
api_management.go
client.go
configuration.go
git_push.sh
go_config.json
model_access_log_entry.go
model_account.go
model_account_analytics.go
model_account_entity.go
model_account_limits.go
model_api_error.go
model_application.go
model_application_api_health.go
model_application_api_key.go
model_application_customer.go
model_application_customer_entity.go
model_application_customer_search.go
model_application_entity.go
model_application_event.go
model_application_session.go
model_application_session_entity.go
model_attribute.go
model_attribute_query.go
model_binding.go
model_campaign.go
model_campaign_analytics.go
model_campaign_copy.go
model_campaign_entity.go
model_campaign_search.go
model_campaign_set.go
model_campaign_set_branch_node.go
model_campaign_set_leaf_node.go
model_campaign_set_node.go
model_cart_item.go
model_cart_item_adjustment.go
model_change.go
model_code_generator_settings.go
model_coupon.go
model_coupon_constraints.go
model_coupon_rejection_reason.go
model_coupon_reservations.go
model_coupon_search.go
model_coupon_value.go
model_create_application_api_key.go
model_customer_activity_report.go
model_customer_analytics.go
model_customer_profile.go
model_customer_profile_search_query.go
model_customer_session.go
model_email_entity.go
model_entity.go
model_environment.go
model_error_response.go
model_error_source.go
model_event.go
model_event_type.go
model_export.go
model_feature_flag.go
model_feature_flags.go
model_features_feed.go
model_func_arg_def.go
model_function_def.go
model_import.go
model_import_coupons.go
model_inline_response_200.go
model_inline_response_200_1.go
model_inline_response_200_10.go
model_inline_response_200_11.go
model_inline_response_200_12.go
model_inline_response_200_13.go
model_inline_response_200_14.go
model_inline_response_200_15.go
model_inline_response_200_16.go
model_inline_response_200_17.go
model_inline_response_200_18.go
model_inline_response_200_19.go
model_inline_response_200_2.go
model_inline_response_200_20.go
model_inline_response_200_21.go
model_inline_response_200_22.go
model_inline_response_200_23.go
model_inline_response_200_24.go
model_inline_response_200_25.go
model_inline_response_200_26.go
model_inline_response_200_27.go
model_inline_response_200_28.go
model_inline_response_200_3.go
model_inline_response_200_4.go
model_inline_response_200_5.go
model_inline_response_200_6.go
model_inline_response_200_7.go
model_inline_response_200_8.go
model_inline_response_200_9.go
model_integration_entity.go
model_integration_event.go
model_integration_profile_entity.go
model_integration_state.go
model_ledger_entry.go
model_library_attribute.go
model_limit_config.go
model_login_params.go
model_loyalty.go
model_loyalty_ledger.go
model_loyalty_ledger_entry.go
model_loyalty_membership.go
model_loyalty_points.go
model_loyalty_program.go
model_loyalty_program_balance.go
model_loyalty_program_ledgers.go
model_loyalty_sub_ledger.go
model_manager_config.go
model_meta.go
model_misc_update_user_latest_feature.go
model_multi_application_entity.go
model_mutable_entity.go
model_new_account.go
model_new_account_sign_up.go
model_new_application.go
model_new_application_api_key.go
model_new_attribute.go
model_new_campaign.go
model_new_campaign_set.go
model_new_coupons.go
model_new_customer_profile.go
model_new_customer_session.go
model_new_event.go
model_new_event_type.go
model_new_feature_flags.go
model_new_import.go
model_new_invitation.go
model_new_invite_email.go
model_new_loyalty_program.go
model_new_password.go
model_new_password_email.go
model_new_referral.go
model_new_role.go
model_new_ruleset.go
model_new_template_def.go
model_new_user.go
model_new_webhook.go
model_referral.go
model_role.go
model_role_assign.go
model_role_membership.go
model_rule.go
model_ruleset.go
model_session.go
model_slot_def.go
model_template_arg_def.go
model_template_def.go
model_update_account.go
model_update_campaign.go
model_update_coupon.go
model_update_coupon_batch.go
model_update_loyalty_program.go
model_update_role.go
model_update_user.go
model_user.go
model_user_entity.go
model_webhook.go
model_webhook_activation_log_entry.go
model_webhook_log_entry.go
response.go

README.md

Go API client for talon

The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the Integration API section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. ### Where is the API? The API is available at the same hostname as these docs. For example, if you are reading this page at https://mycompany.talon.one/docs/api/, the URL for the [updateCustomerProfile][] operation is https://mycompany.talon.one/v1/customer_profiles/id [updateCustomerProfile]: #operation--v1-customer_profiles--integrationId--put

Overview

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

  • API version: 1.0.0
  • Package version: 1.1.2
  • Build package: io.swagger.codegen.languages.GoClientCodegen

Installation

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

import "./talon"

Getting Started

Integration API

package main

import (
	"context"
	"fmt"

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

func main() {
	configuration := talon.NewConfiguration()
	// Set API base path
	configuration.BasePath = "https://mycompany.talon.one"

	integrationClient := talon.NewAPIClient(configuration)
	
	// Create integration authentication context using api key
	integrationContext := context.WithValue(context.Background(), talon.ContextAPIKey, talon.APIKey{
		Prefix: "ApiKey-v1",
		Key:    "fd1fd219b1e953a6b2700e8034de5bfc877462ae106127311ddd710978654312",
	})

	// Integration API example to send a session update
	customerSession := talon.NewCustomerSession{
		ProfileId: "DEADBEEF",
		Coupon:    "",
		Referral:  "",
		State:     "open",
		CartItems: []talon.CartItem{},
		Total:     42.0,
	}

	// Create/update a customer session using `UpdateCustomerSession` function
	integrationState, response, err := integrationClient.IntegrationApi.UpdateCustomerSession(integrationContext, "deetdoot", customerSession)
	if err != nil {
		fmt.Println(err)
	} else {
		fmt.Printf("%+v \n\n", integrationState.Session)
		fmt.Println(response)
	}
}

Management API

package main

import (
	"context"
	"fmt"

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

func main() {
	configuration := talon.NewConfiguration()
	// Set API base path
	configuration.BasePath = "https://mycompany.talon.one"

	// Management API example to load application with id 7
	managementClient := talon.NewAPIClient(configuration)

	session, _, err := managementClient.ManagementApi.CreateSession(context.Background(), talon.LoginParams{
		Email:    "admin@talon.one",
		Password: "50meSecureVeryPa$$w0rd!",
	})
	if err != nil {
		fmt.Println(err)
	} else {
		fmt.Println(session)
	}

	// Create manager authentication context using login
	managerContext := context.WithValue(context.Background(), talon.ContextAPIKey, talon.APIKey{
		Prefix: "Bearer",
		Key:    session.Token,
	})

	// Calling `GetApplication` function with the desired id (7)
	app, response, err := managementClient.ManagementApi.GetApplication(managerContext, 7)
	if err != nil {
		fmt.Println(err)
	} else {
		fmt.Printf("%+v \n\n", app)
		fmt.Println(response)
	}
}

}

Documentation for API Endpoints

All URIs are relative to https://localhost

Class Method HTTP request Description
IntegrationApi CreateCouponReservation Post /v1/coupon_reservations/{couponValue} Create a new coupon reservation
IntegrationApi CreateReferral Post /v1/referrals Create a referral code for an advocate
IntegrationApi DeleteCouponReservation Delete /v1/coupon_reservations/{couponValue} Delete coupon reservations
IntegrationApi DeleteCustomerData Delete /v1/customer_data/{integrationId} Delete the personal data of a customer.
IntegrationApi GetReservedCoupons Get /v1/coupon_reservations/coupons/{integrationId} Get all valid reserved coupons
IntegrationApi GetReservedCustomers Get /v1/coupon_reservations/customerprofiles/{couponValue} Get the users that have this coupon reserved
IntegrationApi TrackEvent Post /v1/events Track an Event
IntegrationApi UpdateCustomerProfile Put /v1/customer_profiles/{integrationId} Update a Customer Profile
IntegrationApi UpdateCustomerSession Put /v1/customer_sessions/{customerSessionId} Update a Customer Session
ManagementApi AddLoyaltyPoints Put /v1/loyalty_programs/{programID}/profile/{integrationID}/add_points Add points in a certain loyalty program for the specified customer
ManagementApi CopyCampaignToApplications Post /v1/applications/{applicationId}/campaigns/{campaignId}/copy Copy the campaign into every specified application
ManagementApi CreateCampaign Post /v1/applications/{applicationId}/campaigns Create a Campaign
ManagementApi CreateCoupons Post /v1/applications/{applicationId}/campaigns/{campaignId}/coupons Create Coupons
ManagementApi CreatePasswordRecoveryEmail Post /v1/password_recovery_emails Request a password reset
ManagementApi CreateRuleset Post /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets Create a Ruleset
ManagementApi CreateSession Post /v1/sessions Create a Session
ManagementApi DeleteCampaign Delete /v1/applications/{applicationId}/campaigns/{campaignId} Delete a Campaign
ManagementApi DeleteCoupon Delete /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId} Delete one Coupon
ManagementApi DeleteCoupons Delete /v1/applications/{applicationId}/campaigns/{campaignId}/coupons Delete Coupons
ManagementApi DeleteReferral Delete /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId} Delete one Referral
ManagementApi DeleteRuleset Delete /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId} Delete a Ruleset
ManagementApi GetAccessLogs Get /v1/applications/{applicationId}/access_logs Get access logs for application
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 GetAccountLimits Get /v1/accounts/{accountId}/limits Get Account Limits
ManagementApi GetAllAccessLogs Get /v1/access_logs Get all access logs
ManagementApi GetAllRoles Get /v1/roles Get all roles.
ManagementApi GetApplication Get /v1/applications/{applicationId} Get Application
ManagementApi GetApplicationApiHealth Get /v1/applications/{applicationId}/health_report Get report of health of application API
ManagementApi GetApplicationCustomer Get /v1/applications/{applicationId}/customers/{customerId} Get Application Customer
ManagementApi GetApplicationCustomers Get /v1/applications/{applicationId}/customers List Application Customers
ManagementApi GetApplicationCustomersByAttributes Post /v1/application_customer_search Get a list of the customer profiles that match the given attributes
ManagementApi GetApplicationEventTypes Get /v1/applications/{applicationId}/event_types List Applications Event Types
ManagementApi GetApplicationEvents Get /v1/applications/{applicationId}/events List Applications Events
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 a custom attribute
ManagementApi GetCampaign Get /v1/applications/{applicationId}/campaigns/{campaignId} Get a Campaign
ManagementApi GetCampaignAnalytics Get /v1/applications/{applicationId}/campaigns/{campaignId}/analytics Get analytics of campaigns
ManagementApi GetCampaignByAttributes Post /v1/applications/{applicationId}/campaigns_search Get a list of all campaigns that match the given attributes
ManagementApi GetCampaignSet Get /v1/applications/{applicationId}/campaign_set List CampaignSet
ManagementApi GetCampaigns Get /v1/applications/{applicationId}/campaigns List your Campaigns
ManagementApi GetChanges Get /v1/changes Get audit log for an account
ManagementApi GetCoupons Get /v1/applications/{applicationId}/campaigns/{campaignId}/coupons List Coupons
ManagementApi GetCouponsByAttributes Post /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search Get a list of the coupons that match the given attributes
ManagementApi GetCouponsByAttributesApplicationWide Post /v1/applications/{applicationId}/coupons_search Get a list of the coupons that match the given attributes in all active campaigns of an application
ManagementApi GetCouponsWithoutTotalCount Get /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/no_total List Coupons
ManagementApi GetCustomerActivityReport Get /v1/applications/{applicationId}/customer_activity_reports/{customerId} Get Activity Report for Single Customer
ManagementApi GetCustomerActivityReports Get /v1/applications/{applicationId}/customer_activity_reports Get Activity Reports for Application Customers
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 Analytics Report for a Customer
ManagementApi GetCustomerProfile Get /v1/customers/{customerId} Get Customer Profile
ManagementApi GetCustomerProfiles Get /v1/customers/no_total List Customer Profiles
ManagementApi GetCustomersByAttributes Post /v1/customer_search/no_total Get a list of the customer profiles that match the given attributes
ManagementApi GetEventTypes Get /v1/event_types List Event Types
ManagementApi GetExports Get /v1/exports Get Exports
ManagementApi GetImports Get /v1/imports Get Imports
ManagementApi GetLoyaltyPoints Get /v1/loyalty_programs/{programID}/profile/{integrationID} get the Loyalty Ledger for this integrationID
ManagementApi GetLoyaltyProgram Get /v1/loyalty_programs/{programID} Get a loyalty program
ManagementApi GetLoyaltyPrograms Get /v1/loyalty_programs List all loyalty Programs
ManagementApi GetReferrals Get /v1/applications/{applicationId}/campaigns/{campaignId}/referrals List Referrals
ManagementApi GetReferralsWithoutTotalCount Get /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/no_total List Referrals
ManagementApi GetRole Get /v1/roles/{roleId} Get information for the specified role.
ManagementApi GetRuleset Get /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId} Get a Ruleset
ManagementApi GetRulesets Get /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets List Campaign Rulesets
ManagementApi GetUser Get /v1/users/{userId} Get a single User
ManagementApi GetUsers Get /v1/users List Users in your 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 RefreshAnalytics Post /v1/refresh_analytics Trigger refresh on stale analytics.
ManagementApi RemoveLoyaltyPoints Put /v1/loyalty_programs/{programID}/profile/{integrationID}/deduct_points Deduct points in a certain loyalty program for the specified customer
ManagementApi ResetPassword Post /v1/reset_password Reset password
ManagementApi SearchCouponsAdvanced Post /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search_advanced Get a list of the coupons that match the given attributes
ManagementApi SearchCouponsAdvancedApplicationWide Post /v1/applications/{applicationId}/coupons_search_advanced Get a list of the coupons that match the given attributes in all active campaigns of an application
ManagementApi SearchCouponsAdvancedApplicationWideWithoutTotalCount Post /v1/applications/{applicationId}/coupons_search_advanced/no_total Get a list of the coupons that match the given attributes in all active campaigns of an application
ManagementApi SearchCouponsAdvancedWithoutTotalCount Post /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search_advanced/no_total Get a list of the coupons that match the given attributes
ManagementApi SetAccountLimits Put /v1/accounts/{accountId}/limits Set account limits
ManagementApi UpdateCampaign Put /v1/applications/{applicationId}/campaigns/{campaignId} Update a Campaign
ManagementApi UpdateCampaignSet Put /v1/applications/{applicationId}/campaign_set Update a Campaign Set
ManagementApi UpdateCoupon Put /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId} Update a Coupon
ManagementApi UpdateCouponBatch Put /v1/applications/{applicationId}/campaigns/{campaignId}/coupons Update a Batch of Coupons
ManagementApi UpdateRuleset Put /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId} Update a Ruleset

Documentation For Models

Documentation For Authorization

api_key_v1

  • Type: API key

Example

auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
	Key: "APIKEY",
	Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)

integration_auth

  • Type: API key

Example

auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
	Key: "APIKEY",
	Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)

manager_auth

  • Type: API key

Example

auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
	Key: "APIKEY",
	Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)

Author

You can’t perform that action at this time.