Skip to content
This repository was archived by the owner on Jan 20, 2024. It is now read-only.

Add ET_InteractionEvents #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion FuelSDK/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,19 @@ def __init__(self):
self.endpoint = 'https://www.exacttargetapis.com/hub/v1/campaigns/{id}/assets/{assetId}'
self.urlProps = ["id", "assetId"]
self.urlPropsRequired = ["id"]


########
##
## wrap an Exact Target Interaction Events
##
########
class ET_InteractionEvents(ET_CUDSupportRest):
def __init__(self):
super(ET_InteractionEvents, self).__init__()
self.endpoint = 'https://www.exacttargetapis.com/interaction/v1/events'
self.urlProps = []
self.urlPropsRequired = []

########
##
## wrap an Exact Target Click Event
Expand Down
32 changes: 32 additions & 0 deletions objsamples/sample_interaction.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import ET_Client

try:
debug = False
stubObj = ET_Client.ET_Client(False, debug)

# In order for this sample to run, it needs to have a interaction.
SubscriberKey = "123456789"
EventDefinitionKey = "ContactEvent-xxxxxxxx"

# Event Fire for interaction
print '>>> Event Fire for interaction'
postInteractionEvent = ET_Client.ET_InteractionEvents()
postInteractionEvent.auth_stub = stubObj
postInteractionEvent.props = {
"ContactKey": SubscriberKey,
"EventDefinitionKey": EventDefinitionKey,
"Data": {
"Id":"01234567",
"Foo":"Bar"
}
}
postInteractionEventResponse = postInteractionEvent.post()

print 'PostRequest Status: ' + str(postInteractionEventResponse.status)
print 'Code: ' + str(postInteractionEventResponse.code)
print 'eventInstanceId: ' + str(postInteractionEventResponse.results['eventInstanceId'])
print '-----------------------------'

except Exception as e:
print 'Caught exception: ' + e.message
print e