All URIs are relative to https://api.sparkfly.com
Method | HTTP request | Description |
---|---|---|
get_points_card_status | GET /v1.0/points/card_status | Check Card Status |
transfer_loyalty_points | POST /v1.0/points/transfer | Transfer Loyalty Points |
PointsCardStatus get_points_card_status(identifier, channel_id)
Check Card Status
- Api Key Authentication (X-Auth-Token):
import time
import os
import sparkfly_client
from sparkfly_client.models.points_card_status import PointsCardStatus
from sparkfly_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.sparkfly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = sparkfly_client.Configuration(
host = "https://api.sparkfly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: X-Auth-Token
configuration.api_key['X-Auth-Token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Enter a context with an instance of the API client
with sparkfly_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = sparkfly_client.LoyaltyPointsApi(api_client)
identifier = 'identifier_example' # str | The identifier of the member
channel_id = 56 # int | The id of the channel
try:
# Check Card Status
api_response = api_instance.get_points_card_status(identifier, channel_id)
print("The response of LoyaltyPointsApi->get_points_card_status:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LoyaltyPointsApi->get_points_card_status: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | The identifier of the member | |
channel_id | int | The id of the channel |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | successful retrieval of card status | * Cache-Control - * Content-Length - * Content-Type - * Date - * Server - * X-Request-Id - * X-Runtime - * X-Ua-Compatible - |
401 | Unauthorized | * Cache-Control - * Content-Length - * Content-Type - * Date - * Server - * X-Request-Id - * X-Runtime - * X-Ua-Compatible - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PointsCardStatus transfer_loyalty_points(identifier, points, txid, channel_id)
Transfer Loyalty Points
- Api Key Authentication (X-Auth-Token):
import time
import os
import sparkfly_client
from sparkfly_client.models.points_card_status import PointsCardStatus
from sparkfly_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.sparkfly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = sparkfly_client.Configuration(
host = "https://api.sparkfly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: X-Auth-Token
configuration.api_key['X-Auth-Token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Enter a context with an instance of the API client
with sparkfly_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = sparkfly_client.LoyaltyPointsApi(api_client)
identifier = 'identifier_example' # str | The identifier of the member
points = 56 # int | Number of points to transfer
txid = 'txid_example' # str | Unique transaction id for the transfer for logging and to protect duplicates
channel_id = 56 # int | The id of the channel
try:
# Transfer Loyalty Points
api_response = api_instance.transfer_loyalty_points(identifier, points, txid, channel_id)
print("The response of LoyaltyPointsApi->transfer_loyalty_points:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LoyaltyPointsApi->transfer_loyalty_points: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | The identifier of the member | |
points | int | Number of points to transfer | |
txid | str | Unique transaction id for the transfer for logging and to protect duplicates | |
channel_id | int | The id of the channel |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Successful transfer | * Cache-Control - * Content-Length - * Content-Type - * Date - * Etag - * Location - * Server - * Set-Cookie - * X-Request-Id - * X-Runtime - * X-Ua-Compatible - |
400 | Error parsing request | * Cache-Control - * Content-Length - * Content-Type - * Date - * Server - * Set-Cookie - * X-Request-Id - * X-Runtime - * X-Ua-Compatible - |
401 | Unauthorized | * Cache-Control - * Content-Length - * Content-Type - * Date - * Server - * X-Request-Id - * X-Runtime - * X-Ua-Compatible - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]