talon-one / talon-one-client
Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applicati
Installs: 71 489
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 5
Forks: 2
Open Issues: 4
Requires
- php: >=7.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.12
- phpunit/phpunit: ^7.4
- squizlabs/php_codesniffer: ~2.6
- dev-master
- 9.0.0
- 8.0.0
- 7.0.0
- 6.0.0
- 5.1.0
- 5.0.0
- 4.0.1
- v4.0.0.x-dev
- 4.0.0
- v3.6.0.x-dev
- v3.5.0.x-dev
- v3.4.0.x-dev
- 3.4.0
- v3.3.0.x-dev
- 3.3.0
- v3.2.0.x-dev
- 3.2.0
- v3.1.0.x-dev
- 3.1.0
- 3.0.0
- dev-openapi3-sdk-update
- dev-usual-sdk-update
- dev-sc-30044-add-getloyaltyprogramprofilepoints-endpoint
- dev-sc-26774-update-php-sdk
- dev-chore/lower-php-version-requirement
- dev-chore/guzzle/dependency/7.2
- dev-hotfix/guzzle-prs-7.3
- dev-oas3-test
This package is auto-updated.
Last update: 2025-01-02 08:50:06 UTC
README
Use the Talon.One API to integrate with your application and to manage applications and campaigns:
- Use the operations in the Integration API section are used to integrate with our platform
- Use the operation in the Management API section 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}
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
- Package version: 9.0.0
- Build package: org.openapitools.codegen.languages.PhpClientCodegen
Requirements
Installation and usage
You have 2 options:
- Using Composer (recommended).
- Using the release's source code.
Using Composer
This is the recommended method.
-
Install Composer following the installation instructions.
-
Execute the following command in your project root to install this library:
composer require talon-one/talon-one-client
-
Include the autoloader:
require_once '/path/to/your-project/vendor/autoload.php';
Using the release's source
If you prefer not to use Composer, you can download the package in its entirety. The Releases page lists all stable versions.
-
Download the source code of the desired version, or checkout the source code directly from the repository.
-
Uncompress the zip file you downloaded, and include the autoloader in your project:
require_once '/path/to/talon-one-client/vendor/autoload.php';
Running the tests
To run the unit tests:
composer install ./vendor/bin/phpunit
Getting Started
- Follow the installation procedure.
- Use the Integration API or the Management API as shown in the following sections.
Integration API
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure Host, API key, & API key prefix for integration authentication $config = \TalonOne\Client\Configuration::getDefaultConfiguration() ->setHost('https://yourbaseurl.talon.one') ->setApiKeyPrefix('Authorization', 'ApiKey-v1') ->setApiKey('Authorization', 'dbc644d33aa74d582bd9479c59e16f970fe13bf34a208c39d6c7fa7586968468'); // Initiating an integration api instance with the config $apiInstance = new \TalonOne\Client\Api\IntegrationApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default when `null` is passed. null, // new YouClientImplementation(), $config ); $customer_session_id = 'customer_session_id_example'; // string | The unique identifier for this session $customer_session = new \TalonOne\Client\Model\NewCustomerSessionV2([ 'profileId' => 'example_prof_id', 'couponCodes' => [ 'Cool-Summer!' ], 'cartItems' => [ new \TalonOne\Client\Model\CartItem([ 'name' => 'Hawaiian Pizza', 'sku' => 'piz-hw-001', 'quantity' => 1, 'price' => 5.85 ]) ] ]); $body = new \TalonOne\Client\Model\IntegrationRequest([ 'customerSession' => $customer_session, // Optional list of requested information to be present on the response. // See lib/Model/IntegrationRequest.php#getResponseContentAllowableValues for full list // 'responseContent' => [ // \TalonOne\Client\Model\IntegrationRequest::RESPONSE_CONTENT_CUSTOMER_SESSION, // \TalonOne\Client\Model\IntegrationRequest::RESPONSE_CONTENT_COUPONS // ] ]); try { // Create/Update a customer session using `updateCustomerSessionV2` function $integration_state = $apiInstance->updateCustomerSessionV2($customer_session_id, $body); print_r($integration_state); // 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 foreach ($integration_state->getEffects() as $effect) { if ("addLoyaltyPoints" == $effect->getEffectType()) { // Initiating right props instance according to the effect type $props = new \TalonOne\Client\Model\AddLoyaltyPointsEffectProps((array) $effect->getProps()); // Access the specific effect's properties echo $props->getName(), ':: ', $props->getRecipientIntegrationId(), ' just earned ', $props->getValue(), ' points', PHP_EOL; } if ("acceptCoupon" == $effect->getEffectType()) { // Initiating right props instance according to the effect type $props = new \TalonOne\Client\Model\AcceptCouponEffectProps((array) $effect->getProps()); // work with AcceptCouponEffectProps' properties // ... } } } catch (Exception $e) { echo 'Exception when calling IntegrationApi->updateCustomerSessionV2: ', $e->getMessage(), PHP_EOL; } ?>
Management API
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure Host, API key, & API key prefix for management authentication $config = \TalonOne\Client\Configuration::getDefaultConfiguration() ->setHost('https://yourbaseurl.talon.one') ->setApiKeyPrefix('Authorization', 'ManagementKey-v1') ->setApiKey('Authorization', '2f0dce055da01ae595005d7d79154bae7448d319d5fc7c5b2951fadd6ba1ea07'); // Initiating a management api instance with the config $apiInstance = new \TalonOne\Client\Api\ManagementApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default when `null` is passed. null, // new YouClientImplementation(), $config ); try { $application_id = 7; // int | desired application identifier // Calling `getApplication` function $application = $apiInstance->getApplication($application_id); print_r($application); } catch (Exception $e) { echo 'Exception when calling ManagementApi->getApplication: ', $e->getMessage(), PHP_EOL; } ?>
Documentation for API Endpoints
All URIs are relative to https://yourbaseurl.talon.one
Documentation For Models
- APIError
- AcceptCouponEffectProps
- AcceptReferralEffectProps
- AccessLogEntry
- Account
- AccountAdditionalCost
- AccountAnalytics
- AccountDashboardStatistic
- AccountDashboardStatisticCampaigns
- AccountDashboardStatisticDiscount
- AccountDashboardStatisticLoyaltyPoints
- AccountDashboardStatisticReferrals
- AccountDashboardStatisticRevenue
- AccountEntity
- AccountLimits
- Achievement
- AchievementAdditionalProperties
- AchievementProgress
- ActivateUserRequest
- AddFreeItemEffectProps
- AddItemCatalogAction
- AddLoyaltyPoints
- AddLoyaltyPointsEffectProps
- AddToAudienceEffectProps
- AddedDeductedPointsNotificationPolicy
- AdditionalCampaignProperties
- AdditionalCost
- AnalyticsDataPoint
- AnalyticsDataPointWithTrend
- AnalyticsDataPointWithTrendAndInfluencedRate
- AnalyticsDataPointWithTrendAndUplift
- Application
- ApplicationAPIKey
- ApplicationAnalyticsDataPoint
- ApplicationApiHealth
- ApplicationCIF
- ApplicationCIFExpression
- ApplicationCampaignAnalytics
- ApplicationCampaignStats
- ApplicationCustomer
- ApplicationCustomerEntity
- ApplicationEntity
- ApplicationEvent
- ApplicationNotification
- ApplicationReferee
- ApplicationSession
- ApplicationSessionEntity
- ApplicationStoreEntity
- AsyncCouponCreationResponse
- AsyncCouponDeletionJobResponse
- Attribute
- AttributesMandatory
- AttributesSettings
- Audience
- AudienceAnalytics
- AudienceCustomer
- AudienceIntegrationID
- AudienceMembership
- AwardGiveawayEffectProps
- BaseCampaign
- BaseLoyaltyProgram
- BaseNotification
- BaseNotificationEntity
- BaseNotificationWebhook
- BaseNotifications
- BaseSamlConnection
- Binding
- BulkApplicationNotification
- BulkCampaignNotification
- BulkOperationOnCampaigns
- Campaign
- CampaignActivationRequest
- CampaignAnalytics
- CampaignBudget
- CampaignCollection
- CampaignCollectionEditedNotification
- CampaignCollectionWithoutPayload
- CampaignCopy
- CampaignCreatedNotification
- CampaignDeletedNotification
- CampaignEditedNotification
- CampaignEntity
- CampaignEvaluationGroup
- CampaignEvaluationPosition
- CampaignEvaluationTreeChangedNotification
- CampaignGroup
- CampaignGroupEntity
- CampaignNotification
- CampaignNotificationPolicy
- CampaignRulesetChangedNotification
- CampaignSearch
- CampaignSet
- CampaignSetBranchNode
- CampaignSetLeafNode
- CampaignSetNode
- CampaignStateChangedNotification
- CampaignStoreBudget
- CampaignTemplate
- CampaignTemplateCollection
- CampaignTemplateParams
- CampaignVersions
- CardAddedDeductedPointsNotificationPolicy
- CardExpiringPointsNotificationPolicy
- CardExpiringPointsNotificationTrigger
- CardLedgerPointsEntryIntegrationAPI
- CardLedgerTransactionLogEntry
- CardLedgerTransactionLogEntryIntegrationAPI
- CartItem
- Catalog
- CatalogAction
- CatalogActionFilter
- CatalogItem
- CatalogSyncRequest
- CatalogsStrikethroughNotificationPolicy
- Change
- ChangeLoyaltyTierLevelEffectProps
- ChangeProfilePassword
- CodeGeneratorSettings
- Collection
- CollectionItem
- CollectionWithoutPayload
- Coupon
- CouponConstraints
- CouponCreatedEffectProps
- CouponCreationJob
- CouponDeletionFilters
- CouponDeletionJob
- CouponLimitConfigs
- CouponRejectionReason
- CouponReservations
- CouponSearch
- CouponValue
- CouponsNotificationPolicy
- CreateAchievement
- CreateApplicationAPIKey
- CreateManagementKey
- CreateTemplateCampaign
- CreateTemplateCampaignResponse
- CustomEffect
- CustomEffectProps
- CustomerActivityReport
- CustomerAnalytics
- CustomerInventory
- CustomerProfile
- CustomerProfileAudienceRequest
- CustomerProfileAudienceRequestItem
- CustomerProfileIntegrationRequestV2
- CustomerProfileIntegrationResponseV2
- CustomerProfileSearchQuery
- CustomerProfileUpdateV2Response
- CustomerSession
- CustomerSessionV2
- DeactivateUserRequest
- DeductLoyaltyPoints
- DeductLoyaltyPointsEffectProps
- DeleteUserRequest
- Effect
- EffectEntity
- EmailEntity
- Endpoint
- Entity
- EntityWithTalangVisibleID
- Environment
- ErrorEffectProps
- ErrorResponse
- ErrorResponseWithStatus
- ErrorSource
- EvaluableCampaignIds
- Event
- EventType
- EventV2
- ExpiringCouponsNotificationPolicy
- ExpiringCouponsNotificationTrigger
- ExpiringPointsNotificationPolicy
- ExpiringPointsNotificationTrigger
- Export
- FeatureFlag
- FeaturesFeed
- FuncArgDef
- FunctionDef
- GenerateCampaignDescription
- GenerateCampaignTags
- GenerateItemFilterDescription
- GenerateLoyaltyCard
- GenerateRuleTitle
- GenerateRuleTitleRule
- GetIntegrationCouponRequest
- Giveaway
- GiveawaysPool
- IdentifiableEntity
- Import
- ImportEntity
- IncreaseAchievementProgressEffectProps
- InlineResponse200
- InlineResponse2001
- InlineResponse20010
- InlineResponse20011
- InlineResponse20012
- InlineResponse20013
- InlineResponse20014
- InlineResponse20015
- InlineResponse20016
- InlineResponse20017
- InlineResponse20018
- InlineResponse20019
- InlineResponse2002
- InlineResponse20020
- InlineResponse20021
- InlineResponse20022
- InlineResponse20023
- InlineResponse20024
- InlineResponse20025
- InlineResponse20026
- InlineResponse20027
- InlineResponse20028
- InlineResponse20029
- InlineResponse2003
- InlineResponse20030
- InlineResponse20031
- InlineResponse20032
- InlineResponse20033
- InlineResponse20034
- InlineResponse20035
- InlineResponse20036
- InlineResponse20037
- InlineResponse20038
- InlineResponse20039
- InlineResponse2004
- InlineResponse20040
- InlineResponse20041
- InlineResponse20042
- InlineResponse20043
- InlineResponse20044
- InlineResponse20045
- InlineResponse20046
- InlineResponse20047
- InlineResponse2005
- InlineResponse2006
- InlineResponse2007
- InlineResponse2008
- InlineResponse2009
- InlineResponse201
- IntegrationCoupon
- IntegrationCustomerSessionResponse
- IntegrationEntity
- IntegrationEvent
- IntegrationEventV2Request
- IntegrationProfileEntity
- IntegrationRequest
- IntegrationState
- IntegrationStateV2
- IntegrationStoreEntity
- InventoryCoupon
- InventoryReferral
- ItemAttribute
- LedgerEntry
- LedgerInfo
- LedgerPointsEntryIntegrationAPI
- LedgerTransactionLogEntryIntegrationAPI
- LibraryAttribute
- LimitConfig
- LimitCounter
- LoginParams
- Loyalty
- LoyaltyBalance
- LoyaltyBalanceWithTier
- LoyaltyBalances
- LoyaltyBalancesWithTiers
- LoyaltyCard
- LoyaltyCardBalances
- LoyaltyCardBatch
- LoyaltyCardBatchResponse
- LoyaltyCardProfileRegistration
- LoyaltyCardRegistration
- LoyaltyDashboardData
- LoyaltyDashboardPointsBreakdown
- LoyaltyLedger
- LoyaltyLedgerEntry
- LoyaltyLedgerTransactions
- LoyaltyMembership
- LoyaltyProgram
- LoyaltyProgramBalance
- LoyaltyProgramEntity
- LoyaltyProgramLedgers
- LoyaltyProgramTransaction
- LoyaltySubLedger
- LoyaltyTier
- ManagementKey
- ManagerConfig
- MessageLogEntries
- MessageLogEntry
- MessageLogRequest
- MessageLogResponse
- Meta
- ModelReturn
- MultiApplicationEntity
- MultipleAttribute
- MultipleAudiences
- MultipleAudiencesItem
- MultipleCustomerProfileIntegrationRequest
- MultipleCustomerProfileIntegrationRequestItem
- MultipleCustomerProfileIntegrationResponseV2
- MultipleNewAttribute
- MultipleNewAudiences
- MutableEntity
- NewAccount
- NewAccountSignUp
- NewAdditionalCost
- NewAppWideCouponDeletionJob
- NewApplication
- NewApplicationAPIKey
- NewApplicationCIF
- NewApplicationCIFExpression
- NewAttribute
- NewAudience
- NewBaseNotification
- NewCampaign
- NewCampaignCollection
- NewCampaignEvaluationGroup
- NewCampaignGroup
- NewCampaignSet
- NewCampaignTemplate
- NewCatalog
- NewCollection
- NewCouponCreationJob
- NewCouponDeletionJob
- NewCoupons
- NewCouponsForMultipleRecipients
- NewCustomEffect
- NewCustomerProfile
- NewCustomerSession
- NewCustomerSessionV2
- NewEvent
- NewEventType
- NewExternalInvitation
- NewGiveawaysPool
- NewInternalAudience
- NewInvitation
- NewInviteEmail
- NewLoyaltyProgram
- NewLoyaltyTier
- NewManagementKey
- NewMultipleAudiencesItem
- NewNotificationTest
- NewNotificationWebhook
- NewOutgoingIntegrationWebhook
- NewPassword
- NewPasswordEmail
- NewPicklist
- NewReferral
- NewReferralsForMultipleAdvocates
- NewReturn
- NewRevisionVersion
- NewRole
- NewRoleV2
- NewRuleset
- NewSamlConnection
- NewStore
- NewTemplateDef
- NewUser
- NewWebhook
- Notification
- NotificationActivation
- NotificationListItem
- NotificationTest
- OktaEvent
- OktaEventPayload
- OktaEventPayloadData
- OktaEventTarget
- OneTimeCode
- OutgoingIntegrationBrazePolicy
- OutgoingIntegrationCleverTapPolicy
- OutgoingIntegrationConfiguration
- OutgoingIntegrationIterablePolicy
- OutgoingIntegrationMoEngagePolicy
- OutgoingIntegrationTemplate
- OutgoingIntegrationTemplateWithConfigurationDetails
- OutgoingIntegrationTemplates
- OutgoingIntegrationType
- OutgoingIntegrationTypes
- PatchItemCatalogAction
- PatchManyItemsCatalogAction
- PendingPointsNotificationPolicy
- Picklist
- Product
- ProfileAudiencesChanges
- ProjectedTier
- RedeemReferralEffectProps
- Referral
- ReferralConstraints
- ReferralCreatedEffectProps
- ReferralRejectionReason
- RejectCouponEffectProps
- RejectReferralEffectProps
- RemoveFromAudienceEffectProps
- RemoveItemCatalogAction
- RemoveManyItemsCatalogAction
- ReopenSessionResponse
- ReserveCouponEffectProps
- ReturnIntegrationRequest
- ReturnedCartItem
- Revision
- RevisionActivation
- RevisionVersion
- Role
- RoleAssign
- RoleMembership
- RoleV2
- RoleV2ApplicationDetails
- RoleV2Base
- RoleV2PermissionSet
- RoleV2Permissions
- RoleV2RolesGroup
- RollbackAddedLoyaltyPointsEffectProps
- RollbackCouponEffectProps
- RollbackDeductedLoyaltyPointsEffectProps
- RollbackDiscountEffectProps
- RollbackIncreasedAchievementProgressEffectProps
- RollbackReferralEffectProps
- Rule
- RuleFailureReason
- Ruleset
- SSOConfig
- SamlConnection
- SamlConnectionInternal
- SamlConnectionMetadata
- SamlLoginEndpoint
- ScimBaseUser
- ScimBaseUserName
- ScimNewUser
- ScimPatchOperation
- ScimPatchRequest
- ScimResource
- ScimResourceTypesListResponse
- ScimSchemaResource
- ScimSchemasListResponse
- ScimServiceProviderConfigResponse
- ScimServiceProviderConfigResponseBulk
- ScimServiceProviderConfigResponseChangePassword
- ScimServiceProviderConfigResponseFilter
- ScimServiceProviderConfigResponsePatch
- ScimUser
- ScimUsersListResponse
- Session
- SetDiscountEffectProps
- SetDiscountPerAdditionalCostEffectProps
- SetDiscountPerAdditionalCostPerItemEffectProps
- SetDiscountPerItemEffectProps
- ShowBundleMetadataEffectProps
- ShowNotificationEffectProps
- SlotDef
- Store
- StrikethroughChangedItem
- StrikethroughCustomEffectPerItemProps
- StrikethroughEffect
- StrikethroughLabelingNotification
- StrikethroughSetDiscountPerItemEffectProps
- StrikethroughTrigger
- TalangAttribute
- TalangAttributeVisibility
- TemplateArgDef
- TemplateDef
- TemplateLimitConfig
- Tier
- TierDowngradeNotificationPolicy
- TierUpgradeNotificationPolicy
- TierWillDowngradeNotificationPolicy
- TierWillDowngradeNotificationTrigger
- TimePoint
- TrackEventV2Response
- TransferLoyaltyCard
- TriggerWebhookEffectProps
- TwoFAConfig
- UpdateAccount
- UpdateAchievement
- UpdateApplication
- UpdateApplicationAPIKey
- UpdateApplicationCIF
- UpdateAttributeEffectProps
- UpdateAudience
- UpdateCampaign
- UpdateCampaignCollection
- UpdateCampaignEvaluationGroup
- UpdateCampaignGroup
- UpdateCampaignTemplate
- UpdateCatalog
- UpdateCollection
- UpdateCoupon
- UpdateCouponBatch
- UpdateCustomEffect
- UpdateLoyaltyCard
- UpdateLoyaltyProgram
- UpdatePicklist
- UpdateReferral
- UpdateReferralBatch
- UpdateRole
- UpdateStore
- UpdateUser
- User
- UserEntity
- Webhook
- WebhookActivationLogEntry
- WebhookLogEntry
- WebhookWithOutgoingIntegrationDetails
- WillAwardGiveawayEffectProps
Documentation For Authorization
api_key_v1
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
management_key
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
manager_auth
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header