talon_one
TalonOne - the Ruby gem for the Talon.One API
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
This SDK is automatically generated by the Swagger Codegen project:
- API version: 1.0.0
- Package version: 1.1.2
- Build package: io.swagger.codegen.languages.RubyClientCodegen
Installation
Build a gem
To build the Ruby code into a gem:
gem build talon_one.gemspec
Then either install the gem locally:
gem install ./talon_one-1.1.2.gem
(for development, run gem install --dev ./talon_one-1.1.2.gem
to install the development dependencies)
or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:
gem 'talon_one', '~> 1.1.2'
Install from Git
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
gem 'talon_one', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
Include the Ruby code directly
Include the Ruby code directly using -I
as follows:
ruby -Ilib script.rb
Getting Started
Please follow the installation procedure and then run the following code:
Integration API
# Load the gem
require 'talon_one'
# Setup authorization
TalonOne.configure do |config|
# Configure the API host destination
config.host = 'mycompany.talon.one'
# Configure API key authorization: api_key_v1
config.api_key['Authorization'] = 'ca1890f0ec3bfa8ed4be04e2aec0c606c0df8ad464f17d3ea8b51df12ba60e5d'
config.api_key_prefix['Authorization'] = 'ApiKey-v1'
end
# Integration API example to send a session update
integration_api = TalonOne::IntegrationApi.new
session_integration_id = 'f985583f-fa7d-4098-91dd-99c898ed3cd3' # String | The integration identifier of the session
# NewCustomerSession Object
customer_session = TalonOne::NewCustomerSession.new({
'coupon': 'Kewl',
'total': 100,
'state': 'open'
})
begin
# Create/update a customer session using `update_customer_session` function
result = integration_api.update_customer_session(session_integration_id, customer_session)
# Prints response to the console
puts result
rescue TalonOne::ApiError => e
puts "Exception when calling IntegrationApi->update_customer_session: #{e}"
end
Management API
# Load the gem
require 'talon_one'
# Setup authorization
TalonOne.configure do |config|
# Configure the API host destination
config.host = 'mycompany.talon.one'
end
# Management API example to load application with id 7
management_api = TalonOne::ManagementApi.new
begin
# Acquire session token
login_params = TalonOne::LoginParams.new({
'email': '[email protected]',
'password': 'Demo1234'
})
login_result = management_api.create_session(login_params)
token = login_result.token
# Save token in the configuration for future management API calls
TalonOne.configure do |config|
# Configure API key authorization: manager_auth
config.api_key['Authorization'] = token
config.api_key_prefix['Authorization'] = 'Bearer'
end
# Calling get_application function with the desired id (7)
result = management_api.get_application(7)
# Print result to the console
puts result
rescue TalonOne::ApiError => e
puts "Exception when calling ManagementApi: #{e}"
end
Documentation for API Endpoints
All URIs are relative to https://localhost
Class | Method | HTTP request | Description |
---|---|---|---|
TalonOne::IntegrationApi | create_coupon_reservation | POST /v1/coupon_reservations/couponValue | Create a new coupon reservation |
TalonOne::IntegrationApi | create_referral | POST /v1/referrals | Create a referral code for an advocate |
TalonOne::IntegrationApi | delete_coupon_reservation | DELETE /v1/coupon_reservations/couponValue | Delete coupon reservations |
TalonOne::IntegrationApi | delete_customer_data | DELETE /v1/customer_data/integrationId | Delete the personal data of a customer. |
TalonOne::IntegrationApi | get_reserved_coupons | GET /v1/coupon_reservations/coupons/integrationId | Get all valid reserved coupons |
TalonOne::IntegrationApi | get_reserved_customers | GET /v1/coupon_reservations/customerprofiles/couponValue | Get the users that have this coupon reserved |
TalonOne::IntegrationApi | track_event | POST /v1/events | Track an Event |
TalonOne::IntegrationApi | update_customer_profile | PUT /v1/customer_profiles/integrationId | Update a Customer Profile |
TalonOne::IntegrationApi | update_customer_session | PUT /v1/customer_sessions/customerSessionId | Update a Customer Session |
TalonOne::ManagementApi | add_loyalty_points | PUT /v1/loyalty_programs/programID/profile/integrationID/add_points | Add points in a certain loyalty program for the specified customer |
TalonOne::ManagementApi | copy_campaign_to_applications | POST /v1/applications/applicationId/campaigns/campaignId/copy | Copy the campaign into every specified application |
TalonOne::ManagementApi | create_campaign | POST /v1/applications/applicationId/campaigns | Create a Campaign |
TalonOne::ManagementApi | create_coupons | POST /v1/applications/applicationId/campaigns/campaignId/coupons | Create Coupons |
TalonOne::ManagementApi | create_password_recovery_email | POST /v1/password_recovery_emails | Request a password reset |
TalonOne::ManagementApi | create_ruleset | POST /v1/applications/applicationId/campaigns/campaignId/rulesets | Create a Ruleset |
TalonOne::ManagementApi | create_session | POST /v1/sessions | Create a Session |
TalonOne::ManagementApi | delete_campaign | DELETE /v1/applications/applicationId/campaigns/campaignId | Delete a Campaign |
TalonOne::ManagementApi | delete_coupon | DELETE /v1/applications/applicationId/campaigns/campaignId/coupons/couponId | Delete one Coupon |
TalonOne::ManagementApi | delete_coupons | DELETE /v1/applications/applicationId/campaigns/campaignId/coupons | Delete Coupons |
TalonOne::ManagementApi | delete_referral | DELETE /v1/applications/applicationId/campaigns/campaignId/referrals/referralId | Delete one Referral |
TalonOne::ManagementApi | delete_ruleset | DELETE /v1/applications/applicationId/campaigns/campaignId/rulesets/rulesetId | Delete a Ruleset |
TalonOne::ManagementApi | get_access_logs | GET /v1/applications/applicationId/access_logs | Get access logs for application |
TalonOne::ManagementApi | get_access_logs_without_total_count | GET /v1/applications/applicationId/access_logs/no_total | Get access logs for application |
TalonOne::ManagementApi | get_account | GET /v1/accounts/accountId | Get Account Details |
TalonOne::ManagementApi | get_account_analytics | GET /v1/accounts/accountId/analytics | Get Account Analytics |
TalonOne::ManagementApi | get_account_limits | GET /v1/accounts/accountId/limits | Get Account Limits |
TalonOne::ManagementApi | get_all_access_logs | GET /v1/access_logs | Get all access logs |
TalonOne::ManagementApi | get_all_roles | GET /v1/roles | Get all roles. |
TalonOne::ManagementApi | get_application | GET /v1/applications/applicationId | Get Application |
TalonOne::ManagementApi | get_application_api_health | GET /v1/applications/applicationId/health_report | Get report of health of application API |
TalonOne::ManagementApi | get_application_customer | GET /v1/applications/applicationId/customers/customerId | Get Application Customer |
TalonOne::ManagementApi | get_application_customers | GET /v1/applications/applicationId/customers | List Application Customers |
TalonOne::ManagementApi | get_application_customers_by_attributes | POST /v1/application_customer_search | Get a list of the customer profiles that match the given attributes |
TalonOne::ManagementApi | get_application_event_types | GET /v1/applications/applicationId/event_types | List Applications Event Types |
TalonOne::ManagementApi | get_application_events | GET /v1/applications/applicationId/events | List Applications Events |
TalonOne::ManagementApi | get_application_events_without_total_count | GET /v1/applications/applicationId/events/no_total | List Applications Events |
TalonOne::ManagementApi | get_application_session | GET /v1/applications/applicationId/sessions/sessionId | Get Application Session |
TalonOne::ManagementApi | get_application_sessions | GET /v1/applications/applicationId/sessions | List Application Sessions |
TalonOne::ManagementApi | get_applications | GET /v1/applications | List Applications |
TalonOne::ManagementApi | get_attribute | GET /v1/attributes/attributeId | Get a custom attribute |
TalonOne::ManagementApi | get_campaign | GET /v1/applications/applicationId/campaigns/campaignId | Get a Campaign |
TalonOne::ManagementApi | get_campaign_analytics | GET /v1/applications/applicationId/campaigns/campaignId/analytics | Get analytics of campaigns |
TalonOne::ManagementApi | get_campaign_by_attributes | POST /v1/applications/applicationId/campaigns_search | Get a list of all campaigns that match the given attributes |
TalonOne::ManagementApi | get_campaign_set | GET /v1/applications/applicationId/campaign_set | List CampaignSet |
TalonOne::ManagementApi | get_campaigns | GET /v1/applications/applicationId/campaigns | List your Campaigns |
TalonOne::ManagementApi | get_changes | GET /v1/changes | Get audit log for an account |
TalonOne::ManagementApi | get_coupons | GET /v1/applications/applicationId/campaigns/campaignId/coupons | List Coupons |
TalonOne::ManagementApi | get_coupons_by_attributes | POST /v1/applications/applicationId/campaigns/campaignId/coupons_search | Get a list of the coupons that match the given attributes |
TalonOne::ManagementApi | get_coupons_by_attributes_application_wide | POST /v1/applications/applicationId/coupons_search | Get a list of the coupons that match the given attributes in all active campaigns of an application |
TalonOne::ManagementApi | get_coupons_without_total_count | GET /v1/applications/applicationId/campaigns/campaignId/coupons/no_total | List Coupons |
TalonOne::ManagementApi | get_customer_activity_report | GET /v1/applications/applicationId/customer_activity_reports/customerId | Get Activity Report for Single Customer |
TalonOne::ManagementApi | get_customer_activity_reports | GET /v1/applications/applicationId/customer_activity_reports | Get Activity Reports for Application Customers |
TalonOne::ManagementApi | get_customer_activity_reports_without_total_count | GET /v1/applications/applicationId/customer_activity_reports/no_total | Get Activity Reports for Application Customers |
TalonOne::ManagementApi | get_customer_analytics | GET /v1/applications/applicationId/customers/customerId/analytics | Get Analytics Report for a Customer |
TalonOne::ManagementApi | get_customer_profile | GET /v1/customers/customerId | Get Customer Profile |
TalonOne::ManagementApi | get_customer_profiles | GET /v1/customers/no_total | List Customer Profiles |
TalonOne::ManagementApi | get_customers_by_attributes | POST /v1/customer_search/no_total | Get a list of the customer profiles that match the given attributes |
TalonOne::ManagementApi | get_event_types | GET /v1/event_types | List Event Types |
TalonOne::ManagementApi | get_exports | GET /v1/exports | Get Exports |
TalonOne::ManagementApi | get_imports | GET /v1/imports | Get Imports |
TalonOne::ManagementApi | get_loyalty_points | GET /v1/loyalty_programs/programID/profile/integrationID | get the Loyalty Ledger for this integrationID |
TalonOne::ManagementApi | get_loyalty_program | GET /v1/loyalty_programs/programID | Get a loyalty program |
TalonOne::ManagementApi | get_loyalty_programs | GET /v1/loyalty_programs | List all loyalty Programs |
TalonOne::ManagementApi | get_referrals | GET /v1/applications/applicationId/campaigns/campaignId/referrals | List Referrals |
TalonOne::ManagementApi | get_referrals_without_total_count | GET /v1/applications/applicationId/campaigns/campaignId/referrals/no_total | List Referrals |
TalonOne::ManagementApi | get_role | GET /v1/roles/roleId | Get information for the specified role. |
TalonOne::ManagementApi | get_ruleset | GET /v1/applications/applicationId/campaigns/campaignId/rulesets/rulesetId | Get a Ruleset |
TalonOne::ManagementApi | get_rulesets | GET /v1/applications/applicationId/campaigns/campaignId/rulesets | List Campaign Rulesets |
TalonOne::ManagementApi | get_user | GET /v1/users/userId | Get a single User |
TalonOne::ManagementApi | get_users | GET /v1/users | List Users in your account |
TalonOne::ManagementApi | get_webhook | GET /v1/webhooks/webhookId | Get Webhook |
TalonOne::ManagementApi | get_webhook_activation_logs | GET /v1/webhook_activation_logs | List Webhook activation Log Entries |
TalonOne::ManagementApi | get_webhook_logs | GET /v1/webhook_logs | List Webhook Log Entries |
TalonOne::ManagementApi | get_webhooks | GET /v1/webhooks | List Webhooks |
TalonOne::ManagementApi | refresh_analytics | POST /v1/refresh_analytics | Trigger refresh on stale analytics. |
TalonOne::ManagementApi | remove_loyalty_points | PUT /v1/loyalty_programs/programID/profile/integrationID/deduct_points | Deduct points in a certain loyalty program for the specified customer |
TalonOne::ManagementApi | reset_password | POST /v1/reset_password | Reset password |
TalonOne::ManagementApi | search_coupons_advanced | POST /v1/applications/applicationId/campaigns/campaignId/coupons_search_advanced | Get a list of the coupons that match the given attributes |
TalonOne::ManagementApi | search_coupons_advanced_application_wide | 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 |
TalonOne::ManagementApi | search_coupons_advanced_application_wide_without_total_count | 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 |
TalonOne::ManagementApi | search_coupons_advanced_without_total_count | POST /v1/applications/applicationId/campaigns/campaignId/coupons_search_advanced/no_total | Get a list of the coupons that match the given attributes |
TalonOne::ManagementApi | set_account_limits | PUT /v1/accounts/accountId/limits | Set account limits |
TalonOne::ManagementApi | update_campaign | PUT /v1/applications/applicationId/campaigns/campaignId | Update a Campaign |
TalonOne::ManagementApi | update_campaign_set | PUT /v1/applications/applicationId/campaign_set | Update a Campaign Set |
TalonOne::ManagementApi | update_coupon | PUT /v1/applications/applicationId/campaigns/campaignId/coupons/couponId | Update a Coupon |
TalonOne::ManagementApi | update_coupon_batch | PUT /v1/applications/applicationId/campaigns/campaignId/coupons | Update a Batch of Coupons |
TalonOne::ManagementApi | update_ruleset | PUT /v1/applications/applicationId/campaigns/campaignId/rulesets/rulesetId | Update a Ruleset |
Documentation for Models
- TalonOne::APIError
- TalonOne::AccessLogEntry
- TalonOne::Account
- TalonOne::AccountAnalytics
- TalonOne::AccountEntity
- TalonOne::AccountLimits
- TalonOne::Application
- TalonOne::ApplicationAPIKey
- TalonOne::ApplicationApiHealth
- TalonOne::ApplicationCustomer
- TalonOne::ApplicationCustomerEntity
- TalonOne::ApplicationCustomerSearch
- TalonOne::ApplicationEntity
- TalonOne::ApplicationEvent
- TalonOne::ApplicationSession
- TalonOne::ApplicationSessionEntity
- TalonOne::Attribute
- TalonOne::AttributeQuery
- TalonOne::Binding
- TalonOne::Campaign
- TalonOne::CampaignAnalytics
- TalonOne::CampaignCopy
- TalonOne::CampaignEntity
- TalonOne::CampaignSearch
- TalonOne::CampaignSet
- TalonOne::CampaignSetBranchNode
- TalonOne::CampaignSetLeafNode
- TalonOne::CampaignSetNode
- TalonOne::CartItem
- TalonOne::CartItemAdjustment
- TalonOne::Change
- TalonOne::CodeGeneratorSettings
- TalonOne::Coupon
- TalonOne::CouponConstraints
- TalonOne::CouponRejectionReason
- TalonOne::CouponReservations
- TalonOne::CouponSearch
- TalonOne::CouponValue
- TalonOne::CreateApplicationAPIKey
- TalonOne::CustomerActivityReport
- TalonOne::CustomerAnalytics
- TalonOne::CustomerProfile
- TalonOne::CustomerProfileSearchQuery
- TalonOne::CustomerSession
- TalonOne::EmailEntity
- TalonOne::Entity
- TalonOne::Environment
- TalonOne::ErrorResponse
- TalonOne::ErrorSource
- TalonOne::Event
- TalonOne::EventType
- TalonOne::Export
- TalonOne::FeatureFlag
- TalonOne::FeatureFlags
- TalonOne::FeaturesFeed
- TalonOne::FuncArgDef
- TalonOne::FunctionDef
- TalonOne::Import
- TalonOne::ImportCoupons
- TalonOne::InlineResponse200
- TalonOne::InlineResponse2001
- TalonOne::InlineResponse20010
- TalonOne::InlineResponse20011
- TalonOne::InlineResponse20012
- TalonOne::InlineResponse20013
- TalonOne::InlineResponse20014
- TalonOne::InlineResponse20015
- TalonOne::InlineResponse20016
- TalonOne::InlineResponse20017
- TalonOne::InlineResponse20018
- TalonOne::InlineResponse20019
- TalonOne::InlineResponse2002
- TalonOne::InlineResponse20020
- TalonOne::InlineResponse20021
- TalonOne::InlineResponse20022
- TalonOne::InlineResponse20023
- TalonOne::InlineResponse20024
- TalonOne::InlineResponse20025
- TalonOne::InlineResponse20026
- TalonOne::InlineResponse20027
- TalonOne::InlineResponse20028
- TalonOne::InlineResponse2003
- TalonOne::InlineResponse2004
- TalonOne::InlineResponse2005
- TalonOne::InlineResponse2006
- TalonOne::InlineResponse2007
- TalonOne::InlineResponse2008
- TalonOne::InlineResponse2009
- TalonOne::IntegrationEntity
- TalonOne::IntegrationEvent
- TalonOne::IntegrationProfileEntity
- TalonOne::IntegrationState
- TalonOne::LedgerEntry
- TalonOne::LibraryAttribute
- TalonOne::LimitConfig
- TalonOne::LoginParams
- TalonOne::Loyalty
- TalonOne::LoyaltyLedger
- TalonOne::LoyaltyLedgerEntry
- TalonOne::LoyaltyMembership
- TalonOne::LoyaltyPoints
- TalonOne::LoyaltyProgram
- TalonOne::LoyaltyProgramBalance
- TalonOne::LoyaltyProgramLedgers
- TalonOne::LoyaltySubLedger
- TalonOne::ManagerConfig
- TalonOne::Meta
- TalonOne::MiscUpdateUserLatestFeature
- TalonOne::MultiApplicationEntity
- TalonOne::MutableEntity
- TalonOne::NewAccount
- TalonOne::NewAccountSignUp
- TalonOne::NewApplication
- TalonOne::NewApplicationAPIKey
- TalonOne::NewAttribute
- TalonOne::NewCampaign
- TalonOne::NewCampaignSet
- TalonOne::NewCoupons
- TalonOne::NewCustomerProfile
- TalonOne::NewCustomerSession
- TalonOne::NewEvent
- TalonOne::NewEventType
- TalonOne::NewFeatureFlags
- TalonOne::NewImport
- TalonOne::NewInvitation
- TalonOne::NewInviteEmail
- TalonOne::NewLoyaltyProgram
- TalonOne::NewPassword
- TalonOne::NewPasswordEmail
- TalonOne::NewReferral
- TalonOne::NewRole
- TalonOne::NewRuleset
- TalonOne::NewTemplateDef
- TalonOne::NewUser
- TalonOne::NewWebhook
- TalonOne::Referral
- TalonOne::Role
- TalonOne::RoleAssign
- TalonOne::RoleMembership
- TalonOne::Rule
- TalonOne::Ruleset
- TalonOne::Session
- TalonOne::SlotDef
- TalonOne::TemplateArgDef
- TalonOne::TemplateDef
- TalonOne::UpdateAccount
- TalonOne::UpdateCampaign
- TalonOne::UpdateCoupon
- TalonOne::UpdateCouponBatch
- TalonOne::UpdateLoyaltyProgram
- TalonOne::UpdateRole
- TalonOne::UpdateUser
- TalonOne::User
- TalonOne::UserEntity
- TalonOne::Webhook
- TalonOne::WebhookActivationLogEntry
- TalonOne::WebhookLogEntry
Documentation for Authorization
api_key_v1
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
integration_auth
- Type: API key
- API key parameter name: Content-Signature
- Location: HTTP header
manager_auth
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header