Skip to content

g20yr/sparkfly-client

 
 

Repository files navigation

sparkfly-api-client

Getting Started

I created a complete OpenAPI spec for this api which you can find under /openapi-generator-config/sparkfly_openapi.yaml because the current docs were incomplete. Enjoy!

The base Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.23
  • Package version: 1.0.2
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

I added some extra helper modules/classes to make API Discovery easier as well outlined below.

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install sparkfly-api-client

(you may need to run pip with root permission: sudo pip install sparkfly-api-client)

Then import the package:

import sparkfly_client

Tests

Execute pytest to run the tests.

Getting Started

Using Auth Identity and Auth Key headers, the Client takes care of generating the Auth Token on your behalf

from sparkfly_client.sparkfly import Sparkfly
sparkfly_client = Sparkfly(auth_identity="{your_auth_identity_value}", auth_key="{your_auth_key_value}")
print(sparkfly_client.account.get_account())

Auth Tokens expire after 24 hours, but the Sparkfly client takes care of re-authorization. You can use the manual method if desired:

from sparkfly_client.sparkfly import Sparkfly
sparkfly_client = Sparkfly(auth_identity="{your_auth_identity_value}", auth_key="{your_auth_key_value}")
sparkfly_client.authenticate()

You can specify the staging host if desired, though it defaults to the production URL (https://api.sparkfly.com):

from sparkfly_client.sparkfly import Sparkfly
sparkfly_client = Sparkfly(
    auth_identity="{your_auth_identity_value}",
    auth_key="{your_auth_key_value}",
    host="https://api-staging.sparkfly.com"
)

Documentation for API Endpoints

Sparkfly has 2 versions of their API docs which this client was generated from:

All URIs are relative to https://api.sparkfly.com

Class Method HTTP request Description
AccountApi disable_callbacks PUT /v1.0/account/callbacks/disable Disable Callbacks
AccountApi enable_callbacks PUT /v1.0/account/callbacks/enable Enable Callbacks
AccountApi get_account GET /v1.0/account View Account
AccountApi update_account PUT /v1.0/account Update Account
AuthApi authenticate GET /auth authenticate and receive auth token
CampaignsApi create_campaign POST /v1.0/campaigns Create a new campaign
CampaignsApi delete_campaign DELETE /v1.0/campaigns/{campaign_id} Delete the campaign
CampaignsApi get_active_reward_program_campaigns GET /v1.0/campaigns/search Get active reward program campaigns
CampaignsApi get_campaign GET /v1.0/campaigns/{campaign_id} Retrieve Campaign
CampaignsApi get_campaign_by_external_id GET /v1.0/campaigns Get campaign by external ID
CampaignsApi update_campaign PUT /v1.0/campaigns/{campaign_id} Update Campaign
ChannelsApi create_channel POST /v1.0/channels Create a channel
ChannelsApi delete_channel DELETE /v1.0/channels/{channel_id} Delete channel by ID
ChannelsApi get_channel GET /v1.0/channels/{channel_id} Get channel by ID
ChannelsApi get_channels GET /v1.0/channels Get channels
ChannelsApi update_channel PUT /v1.0/channels/{channel_id} Update channel by ID
CountersApi create_counter POST /v1.0/counters Create a counter
CountersApi delete_counter DELETE /v1.0/counters/{counter_id} Delete counter by ID
CountersApi get_counter GET /v1.0/counters/{counter_id} Get counter by ID
CountersApi get_counters GET /v1.0/counters Get counters
CountersApi update_counter PUT /v1.0/counters/{counter_id} Update counter by ID
CredentialsApi create_credential POST /v1.0/credentials Creates a credential
CredentialsApi delete_credential DELETE /v1.0/credentials/{credential_id} Delete Credential
CredentialsApi get_credential GET /v1.0/credentials/{credential_id} Get Credential
CredentialsApi get_credentials GET /v1.0/credentials List Credentials
CredentialsApi get_offer_eligibility_for_member GET /v1.0/credentials/eligible Determine if a member is eligible for an offer
CredentialsApi redeem_credential PUT /v1.0/credentials/{credential_id}/redeem Redeem a credential
CredentialsApi update_credential PUT /v1.0/credentials/{credential_id} Updates a credential
CredentialsApi void_credential PUT /v1.0/credentials/{credential_id}/void Void a credential
EventsApi create_event POST /v1.0/events Creates an event
EventsApi delete_event DELETE /v1.0/events/{event_id} Delete the event
EventsApi get_event GET /v1.0/events/{event_id} Get event by ID
EventsApi get_events GET /v1.0/events get all events
EventsApi update_event_name PUT /v1.0/events/{event_id} Change the name of an event
ImpressionsApi create_impression POST /v1.0/impressions Creates an impression
ImpressionsApi delete_impression DELETE /v1.0/impressions/{impression_id} Delete the impression
ImpressionsApi get_impressions GET /v1.0/impressions Get all impressions
ItemSetsApi create_item_sets POST /v1.0/item_sets Create an item set
ItemSetsApi delete_item_set DELETE /v1.0/item_sets/{item_set_id} Delete item set by ID
ItemSetsApi get_item_set GET /v1.0/item_sets/{item_set_id} Get item set by ID
ItemSetsApi get_item_set_items GET /v1.0/item_sets/{item_set_id}/items Get items for item set
ItemSetsApi get_item_sets GET /v1.0/item_sets Get all item sets
ItemSetsApi update_item_set PUT /v1.0/item_sets/{item_set_id} Update item set by ID
ItemsApi create_item POST /v1.0/items Create an item
ItemsApi delete_item DELETE /v1.0/items/{item_id} Delete item by ID
ItemsApi get_item GET /v1.0/items/{item_id} Get item by ID
ItemsApi get_items GET /v1.0/items Get all items
ItemsApi update_item PUT /v1.0/items/{item_id} Update item by ID
LoyaltyPointsApi get_points_card_status GET /v1.0/points/card_status Check Card Status
LoyaltyPointsApi transfer_loyalty_points POST /v1.0/points/transfer Transfer Loyalty Points
ManufacturersApi create_manufacturer POST /v1.0/manufacturers Create a manufacturer
ManufacturersApi delete_manufacturer DELETE /v1.0/manufacturers/{manufacturer_id} Delete manufacturer by ID
ManufacturersApi get_manufacturer GET /v1.0/manufacturers/{manufacturer_id} Get manufacturer by ID
ManufacturersApi get_manufacturers GET /v1.0/manufacturers Get all manufacturers
ManufacturersApi update_manufacturer PUT /v1.0/manufacturers/{manufacturer_id} Update manufacturer by ID
ManufacturersItemSetsApi create_manufacturer_item_sets POST /v1.0/manufacturers/{manufacturer_id}/item_sets Create an item set for manufacturer
ManufacturersItemSetsApi delete_manufacturer_item_set DELETE /v1.0/manufacturers/{manufacturer_id}/item_sets/{item_set_id} Delete item set by ID for manufacturer
ManufacturersItemSetsApi get_manufacturer_item_set GET /v1.0/manufacturers/{manufacturer_id}/item_sets/{item_set_id} Get item set by ID for manufacturer
ManufacturersItemSetsApi get_manufacturer_item_sets GET /v1.0/manufacturers/{manufacturer_id}/item_sets Get all item sets for manufacturer
ManufacturersItemSetsApi update_manufacturer_item_set PUT /v1.0/manufacturers/{manufacturer_id}/item_sets/{item_set_id} Update item set by ID for manufacturer
ManufacturersItemSetsItemsApi get_manufacturer_item_set_items GET /v1.0/manufacturers/{manufacturer_id}/item_sets/{item_set_id}/items Get items for item set for manufacturer
ManufacturersItemsApi create_manufacturer_item POST /v1.0/manufacturers/{manufacturer_id}/items Create an item for manufacturer
ManufacturersItemsApi delete_manufacturer_item DELETE /v1.0/manufacturers/{manufacturer_id}/items/{item_id} Delete item by ID for manufacturer
ManufacturersItemsApi get_manufacturer_item GET /v1.0/manufacturers/{manufacturer_id}/items/{item_id} Get item by ID for manufacturer
ManufacturersItemsApi get_manufacturer_items GET /v1.0/manufacturers/{manufacturer_id}/items Get all items for manufacturer
ManufacturersItemsApi update_manufacturer_item PUT /v1.0/manufacturers/{manufacturer_id}/items/{item_id} Update item by ID for manufacturer
ManufacturersMerchantsApi delete_manufacturer_merchants DELETE /v1.0/manufacturers/{manufacturer_id}/merchants Remove an eligible merchant for manufacturer
ManufacturersMerchantsApi get_manufacturer_merchants GET /v1.0/manufacturers/{manufacturer_id}/merchants Get all merchants for manufacturer
ManufacturersMerchantsApi set_manufacturer_merchants POST /v1.0/manufacturers/{manufacturer_id}/merchants Set eligible merchants for manufacturer
ManufacturersMerchantsApi update_manufacturer_merchants PUT /v1.0/manufacturers/{manufacturer_id}/merchants Add an eligible merchant for manufacturer
MemberListsApi create_member_list POST /v1.0/member_lists Create a member list
MemberListsApi delete_member_list DELETE /v1.0/member_lists/{member_list_id} Delete Member List by ID
MemberListsApi get_member_list GET /v1.0/member_lists/{member_list_id} Get member list by ID
MemberListsApi get_member_lists GET /v1.0/member_lists Get all member lists
MemberListsApi update_member_list PUT /v1.0/member_lists/{member_list_id} Update Member List by ID
MemberListsMembersApi delete_member_list_members DELETE /v1.0/member_lists/{member_list_id}/members Remove an eligible member for member_list
MemberListsMembersApi get_member_list_members GET /v1.0/member_lists/{member_list_id}/members Get all Members for Member List
MemberListsMembersApi set_member_list_members POST /v1.0/member_lists/{member_list_id}/members Set eligible members for Member List
MemberListsMembersApi update_member_list_members PUT /v1.0/member_lists/{member_list_id}/members Add eligible members for Member List
MemberOffersOfferWalletApi create_member_offer_state POST /v1.0/members/{member_id}/offer_states Create a new Member Offer State and provide optional activation and expiration dates
MemberOffersOfferWalletApi get_member_offer_state GET /v1.0/members/{member_id}/offer_states/{offer_state_id} Get an individual Offer State for a Member
MemberOffersOfferWalletApi get_member_offer_states GET /v1.0/members/{member_id}/offer_states Get the entire list of Offer States for a Member
MemberOffersOfferWalletApi get_members_with_offer_states GET /v1.0/members/offer_states Retrieve Offer States
MemberOffersOfferWalletApi update_member_offer_state PUT /v1.0/members/{member_id}/offer_states/{offer_state_id} Update an individual Offer State for a Member - in order to change the availability
MemberOffersOfferWalletApi void_member_offer_state POST /v1.0/members/{member_id}/offer_states/{offer_state_id}/void Voids an individual Offer State for a Member by Member ID
MemberOffersOfferWalletApi void_offer_state_by_member_identifier POST /v1.0/members/offer_states/{offer_state_id}/void Voids an individual Offer State for a Member by Member Identifier
MemberPrivacyApi create_member_deletion_request POST /v1.0/privacy/member/delete_request Creates a deletion request for a member
MemberPrivacyApi export_member_data GET /v1.0/privacy/member/export Exports data associated with a member
MembersApi create_member POST /v1.0/members Creates a member
MembersApi delete_member DELETE /v1.0/members/{member_id} Delete the member
MembersApi get_member GET /v1.0/members/{member_id} Retrieve Member
MembersApi get_members GET /v1.0/members List members
MembersApi get_members_by_identifier GET /v1.0/members/search Search for Member by Identifier
MembersApi update_member PUT /v1.0/members/{member_id} Update Member
MerchantsApi create_merchant POST /v1.0/merchants Create a merchant
MerchantsApi delete_merchant DELETE /v1.0/merchants/{merchant_id} Delete merchant by ID
MerchantsApi get_merchant GET /v1.0/merchants/{merchant_id} Get merchant by ID
MerchantsApi get_merchants GET /v1.0/merchants Get all merchants
MerchantsApi update_merchant PUT /v1.0/merchants/{merchant_id} Update merchant by ID
MerchantsItemSetsApi create_merchant_item_set POST /v1.0/merchants/{merchant_id}/item_sets Create an item set for merchant
MerchantsItemSetsApi delete_merchant_item_set DELETE /v1.0/merchants/{merchant_id}/item_sets/{item_set_id} Delete item set by ID for merchant
MerchantsItemSetsApi get_merchant_item_set GET /v1.0/merchants/{merchant_id}/item_sets/{item_set_id} Get item set by ID for merchant
MerchantsItemSetsApi get_merchant_item_sets GET /v1.0/merchants/{merchant_id}/item_sets Get all item sets for merchant
MerchantsItemSetsApi update_merchant_item_set PUT /v1.0/merchants/{merchant_id}/item_sets/{item_set_id} Update item set by ID for merchant
MerchantsItemSetsItemsApi get_merchant_item_set_items GET /v1.0/merchants/{merchant_id}/item_sets/{item_set_id}/items Get items for item set for merchant
MerchantsItemsApi create_merchant_item POST /v1.0/merchants/{merchant_id}/items Create an item for merchant
MerchantsItemsApi delete_merchant_item DELETE /v1.0/merchants/{merchant_id}/items/{item_id} Delete item by ID for merchant
MerchantsItemsApi get_merchant_item GET /v1.0/merchants/{merchant_id}/items/{item_id} Get item by ID for merchant
MerchantsItemsApi get_merchant_items GET /v1.0/merchants/{merchant_id}/items Get all items for merchant
MerchantsItemsApi update_merchant_item PUT /v1.0/merchants/{merchant_id}/items/{item_id} Update item by ID for merchant
MerchantsOffersApi get_merchant_offers GET /v1.0/merchants/{merchant_id}/offers List offers for merchant
MerchantsStoreListsApi create_merchant_store_list POST /v1.0/merchants/{merchant_id}/store_lists Create an Store List for merchant
MerchantsStoreListsApi delete_merchant_store_list DELETE /v1.0/merchants/{merchant_id}/store_lists/{store_list_id} Delete Store List by ID for merchant
MerchantsStoreListsApi delete_merchant_store_list_stores DELETE /v1.0/merchants/store_lists/{store_list_id}/stores Remove an eligible Store for store_list
MerchantsStoreListsApi get_merchant_store_list GET /v1.0/merchants/{merchant_id}/store_lists/{store_list_id} Get Store List by ID for merchant
MerchantsStoreListsApi get_merchant_store_list_stores GET /v1.0/merchants/store_lists/{store_list_id}/stores Get all Stores for Store List
MerchantsStoreListsApi get_merchant_store_list_stores_detailed GET /v1.0/merchants/{merchant_id}/store_lists/{store_list_id}/stores Get all Stores for Store List (detailed)
MerchantsStoreListsApi get_merchant_store_lists GET /v1.0/merchants/{merchant_id}/store_lists Get all Store Lists for merchant
MerchantsStoreListsApi set_merchant_store_list_stores POST /v1.0/merchants/store_lists/{store_list_id}/stores Set eligible Stores for Store List
MerchantsStoreListsApi update_merchant_store_list PUT /v1.0/merchants/{merchant_id}/store_lists/{store_list_id} Update Store List by ID for merchant
MerchantsStoreListsApi update_merchant_store_list_stores PUT /v1.0/merchants/store_lists/{store_list_id}/stores Add eligible Stores for Store List
MerchantsStoresApi create_merchant_store POST /v1.0/merchants/{merchant_id}/stores Create an Store for merchant
MerchantsStoresApi delete_merchant_store DELETE /v1.0/merchants/{merchant_id}/stores/{store_id} Delete Store by ID for merchant
MerchantsStoresApi get_filtered_merchant_stores GET /v1.0/merchants/stores/index Get and Filter Stores WITH Active Offers (stores/index)
MerchantsStoresApi get_merchant_store GET /v1.0/merchants/{merchant_id}/stores/{store_id} Get Store by ID for merchant
MerchantsStoresApi get_merchant_store_offer_ids GET /v1.0/merchants/{merchant_id}/stores/{store_id}/offers List Offer IDs for Merchant and Store
MerchantsStoresApi get_merchant_store_without_merchant GET /v1.0/merchants/stores/{store_id} Get Store by ID (without merchant)
MerchantsStoresApi get_merchant_stores GET /v1.0/merchants/{merchant_id}/stores Get all Stores for merchant
MerchantsStoresApi get_nearby_filtered_merchant_stores GET /v1.0/merchants/stores/nearby/index Get and Filter Stores WITH Active Offers (stores/nearby/index)
MerchantsStoresApi get_nearby_merchant_stores GET /v1.0/merchants/stores/nearby/{lat}/{lng}/index Get and Filter Stores WITH Active Offers (stores/nearby/{lat}/{lng}/index)
MerchantsStoresApi update_merchant_store PUT /v1.0/merchants/{merchant_id}/stores/{store_id} Update Store by ID for merchant
OfferEngineApi check_in_member_to_store POST /v1.0/members/{member_id}/stores/{store_id}/check-in Check-In Member to Store
OfferEngineApi get_member_offer_activities GET /v1.0/activities/offers Retrieve Offer Activities for Member
OfferEngineApi get_member_redemptions GET /v1.0/members/{member_id}/activities/redemptions Retrieve Redeemed Redemptions for Member
OfferEngineApi get_member_store GET /v1.0/members/{member_id}/stores/{store_id} Retrieve Store for Member
OfferEngineApi get_member_store_redemptions GET /v1.0/members/{member_id}/stores/{store_id}/activities/redemptions Retrieve Redeemed Redemptions for Member for Store
OffersApi create_offer POST /v1.0/offers Creates an offer
OffersApi delete_offer DELETE /v1.0/offers/{offer_id} Delete the offer
OffersApi get_offer GET /v1.0/offers/{offer_id} Retrieve Offer
OffersApi get_offers GET /v1.0/offers List offers
OffersApi update_offer PUT /v1.0/offers/{offer_id} Update Offer
OffersChannelsApi delete_offer_channels DELETE /v1.0/offers/{offer_id}/channels Remove eligible Channels from offer
OffersChannelsApi get_offer_channel GET /v1.0/offers/{offer_id}/channels/{channel_id} Eligible Channel Show
OffersChannelsApi get_offer_channels GET /v1.0/offers/{offer_id}/channels Eligible Channels List
OffersChannelsApi set_offer_channels POST /v1.0/offers/{offer_id}/channels Set eligible Channels for offer
OffersChannelsApi update_offer_channel PUT /v1.0/offers/{offer_id}/channels/{channel_id} Eligible Channel Update
OffersChannelsApi update_offer_channels PUT /v1.0/offers/{offer_id}/channels Add eligible Channels for offer
OffersEligibleItemSetsApi get_offer_eligible_item_sets GET /v1.0/offers/{offer_id}/eligible_item_sets Eligible Item Sets List
OffersItemSetsApi delete_offer_eligible_item_set DELETE /v1.0/offers/{offer_id}/eligible_item_sets/{eligible_item_set_id} Remove eligible Item Set from offer
OffersItemSetsApi get_offer_eligible_item_set GET /v1.0/offers/{offer_id}/eligible_item_sets/{eligible_item_set_id} Retrieve eligible Item Set for offer
OffersItemSetsApi set_offer_eligible_item_sets POST /v1.0/offers/{offer_id}/eligible_item_sets Eligible Item Set for Offer - Create
OffersItemSetsApi update_offer_eligible_item_set PUT /v1.0/offers/{offer_id}/eligible_item_sets/{eligible_item_set_id} Update eligible Item Set for offer
OffersMemberListsApi delete_offer_member_lists DELETE /v1.0/offers/{offer_id}/member_lists Remove eligible Member Lists from offer
OffersMemberListsApi get_offer_member_lists GET /v1.0/offers/{offer_id}/member_lists Eligible Member Lists List
OffersMemberListsApi set_offer_member_lists POST /v1.0/offers/{offer_id}/member_lists Set eligible Member Lists for offer
OffersMemberListsApi update_offer_member_lists PUT /v1.0/offers/{offer_id}/member_lists Add eligible Member Lists for offer
OffersMerchantsApi delete_offer_merchants DELETE /v1.0/offers/{offer_id}/merchants Remove eligible Merchants from offer
OffersMerchantsApi get_offer_merchants GET /v1.0/offers/{offer_id}/merchants Eligible Merchants List
OffersMerchantsApi set_offer_merchants POST /v1.0/offers/{offer_id}/merchants Set eligible Merchants for offer
OffersMerchantsApi update_offer_merchants PUT /v1.0/offers/{offer_id}/merchants Add eligible Merchants for offer
OffersPassbookConfigurationApi create_offer_passbook_configuration POST /v1.0/offers/{offer_id}/passbook_configuration Passbook Configuration Create
OffersPassbookConfigurationApi delete_offer_passbook_configuration DELETE /v1.0/offers/{offer_id}/passbook_configuration Passbook Configuration Delete for Offer
OffersPassbookConfigurationApi get_offer_passbook_configuration GET /v1.0/offers/{offer_id}/passbook_configuration Get Passbook Configuration for Offer
OffersPassbookConfigurationApi update_offer_passbook_configuration PUT /v1.0/offers/{offer_id}/passbook_configuration Update Passbook Configuration for Offer
OffersStoreListsApi delete_offer_store_lists DELETE /v1.0/offers/{offer_id}/store_lists Remove eligible Store Lists from offer
OffersStoreListsApi get_offer_store_lists GET /v1.0/offers/{offer_id}/store_lists Eligible Store Lists List
OffersStoreListsApi set_offer_store_lists POST /v1.0/offers/{offer_id}/store_lists Set eligible Store Lists for offer
OffersStoreListsApi update_offer_store_lists PUT /v1.0/offers/{offer_id}/store_lists Add eligible Store Lists for offer
OffersStoresApi get_nearby_offer_stores GET /v1.0/offers/{offer_id}/stores Get nearby Stores for Offer
POSOfferCodesApi get_pos_offer_code GET /v1.0/pos_offer_codes/{pos_offer_code_id} Get POS Offer Code
POSOfferCodesApi get_pos_offer_codes GET /v1.0/pos_offer_codes List POS Offer Codes
ReportsApi get_all_merchant_data GET /v1.0/reports/account_level Generates a report of full Merchant data in a given timeframe for a all Merchants
ReportsApi get_merchant_data GET /v1.0/merchants/{merchant_id}/reports/full Generates a report of full Merchant data in a given timeframe for a single Merchant
ReportsApi get_merchant_impressions GET /v1.0/merchants/{merchant_id}/reports/impressions Get Unique Impressions
ReportsApi get_offer_activity GET /v1.0/reports/offer_activity Generates a report of all offer activity in a given timeframe
ReportsApi get_offer_redemptions GET /v1.0/reports/redemptions Generates a report of all offer redemptions for a given timeframe and store list
ZidentifiersApi create_z_identifier GET /v1.0/members/{member_id}/offers/{offer_id}/zidentifiers Create an identifier linking Offer, Member, Channel
ZidentifiersApi get_z_identifier GET /v1.0/members/zidentifiers/{zid} Get Zidentifier

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

X-Auth-Token

  • Type: API key
  • API key parameter name: X-Auth-Token
  • Location: HTTP header

Author

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%