All URIs are relative to https://api.sparkfly.com
Method | HTTP request | Description |
---|---|---|
create_offer | POST /v1.0/offers | Creates an offer |
delete_offer | DELETE /v1.0/offers/{offer_id} | Delete the offer |
get_offer | GET /v1.0/offers/{offer_id} | Retrieve Offer |
get_offers | GET /v1.0/offers | List offers |
update_offer | PUT /v1.0/offers/{offer_id} | Update Offer |
OfferResponse create_offer(offer_input_request=offer_input_request)
Creates an offer
- Api Key Authentication (X-Auth-Token):
import time
import os
import sparkfly_client
from sparkfly_client.models.offer_input_request import OfferInputRequest
from sparkfly_client.models.offer_response import OfferResponse
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.OffersApi(api_client)
offer_input_request = sparkfly_client.OfferInputRequest() # OfferInputRequest | Offer to add to system (optional)
try:
# Creates an offer
api_response = api_instance.create_offer(offer_input_request=offer_input_request)
print("The response of OffersApi->create_offer:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OffersApi->create_offer: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
offer_input_request | OfferInputRequest | Offer to add to system | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Successful creation | * 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]
delete_offer(offer_id)
Delete the offer
- Api Key Authentication (X-Auth-Token):
import time
import os
import sparkfly_client
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.OffersApi(api_client)
offer_id = 56 # int | The id of the offer
try:
# Delete the offer
api_instance.delete_offer(offer_id)
except Exception as e:
print("Exception when calling OffersApi->delete_offer: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
offer_id | int | The id of the offer |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
200 | Successful deletion | * Cache-Control - * Content-Length - * Content-Type - * Date - * Etag - * 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 - |
404 | Offer was not found by id | * Cache-Control - * Content-Length - * Content-Type - * Date - * Server - * Set-Cookie - * X-Request-Id - * X-Runtime - * X-Ua-Compatible - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OfferResponse get_offer(offer_id)
Retrieve Offer
- Api Key Authentication (X-Auth-Token):
import time
import os
import sparkfly_client
from sparkfly_client.models.offer_response import OfferResponse
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.OffersApi(api_client)
offer_id = 56 # int | The id of the offer
try:
# Retrieve Offer
api_response = api_instance.get_offer(offer_id)
print("The response of OffersApi->get_offer:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OffersApi->get_offer: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
offer_id | int | The id of the offer |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | successful retrieval of offer | * Cache-Control - * Content-Length - * Content-Type - * Server - * Etag - * X-Request-Id - * X-Runtime - * X-Ua-Compatible - * Date - |
401 | Unauthorized | * Cache-Control - * Content-Length - * Content-Type - * Date - * Server - * X-Request-Id - * X-Runtime - * X-Ua-Compatible - |
404 | Event was not found by id | * Cache-Control - * Content-Length - * Content-Type - * Date - * Server - * Set-Cookie - * X-Request-Id - * X-Runtime - * X-Ua-Compatible - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OfferList get_offers(merchant_id=merchant_id, sort_by=sort_by, order=order, name=name)
List offers
- Api Key Authentication (X-Auth-Token):
import time
import os
import sparkfly_client
from sparkfly_client.models.offer_list import OfferList
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.OffersApi(api_client)
merchant_id = 56 # int | The id of the merchant (optional)
sort_by = 'sort_by_example' # str | Sort offers by 1 of their attributes ( name, start_running_at, status ) (optional)
order = 'order_example' # str | Order the result ( asc or desc ) (optional)
name = 'name_example' # str | The name by which to search (optional)
try:
# List offers
api_response = api_instance.get_offers(merchant_id=merchant_id, sort_by=sort_by, order=order, name=name)
print("The response of OffersApi->get_offers:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OffersApi->get_offers: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
merchant_id | int | The id of the merchant | [optional] |
sort_by | str | Sort offers by 1 of their attributes ( name, start_running_at, status ) | [optional] |
order | str | Order the result ( asc or desc ) | [optional] |
name | str | The name by which to search | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | successful retrieval of offers | * Cache-Control - * Content-Length - * Date - * Etag - * Server - * Set-Cookie - * X-Auth-Token - * 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]
OfferResponse update_offer(offer_id, offer_input_request=offer_input_request)
Update Offer
- Api Key Authentication (X-Auth-Token):
import time
import os
import sparkfly_client
from sparkfly_client.models.offer_input_request import OfferInputRequest
from sparkfly_client.models.offer_response import OfferResponse
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.OffersApi(api_client)
offer_id = 56 # int | The id of the offer
offer_input_request = sparkfly_client.OfferInputRequest() # OfferInputRequest | The object that passes the updated offer (optional)
try:
# Update Offer
api_response = api_instance.update_offer(offer_id, offer_input_request=offer_input_request)
print("The response of OffersApi->update_offer:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OffersApi->update_offer: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
offer_id | int | The id of the offer | |
offer_input_request | OfferInputRequest | The object that passes the updated offer | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | successful update of offer | * Cache-Control - * Content-Length - * Content-Type - * Server - * Etag - * X-Request-Id - * X-Runtime - * X-Ua-Compatible - * Date - |
401 | Unauthorized | * Cache-Control - * Content-Length - * Content-Type - * Date - * Server - * X-Request-Id - * X-Runtime - * X-Ua-Compatible - |
404 | Offer was not found by id | * Cache-Control - * Content-Length - * Content-Type - * Date - * Server - * Set-Cookie - * X-Request-Id - * X-Runtime - * X-Ua-Compatible - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]