import sys
import chargeover
import pprint
endpoint = 'http://dev.chargeover.com/signup/api/v3'
username = 'noECbNw0GDA7vtPLcuaVqJBRhUldjz38'
password = 'B6LnuVGE74Co1TacXxHjdwk9hKtPpIW0'
key_auth = False
co = chargeover.ChargeOver(
endpoint,
username,
password,
key_auth = key_auth)
data = {
'target_url': 'http://playscape2.uglyslug.com/resthooks/customer_insert.php',
'event': 'customer.insert'
}
id = co.create('_resthook', data)
if id is None:
pprint.pprint(co.get_last_response())
exit()
else:
print("Our new Rest Hook ID is: " + str(id))