pip install referral_candy
Initialize a client with your ReferralCandy credentials
>>> from referral_candy import ReferralCandy
>>> rc = ReferralCandy(access_id="YOUR_ACCESS_ID", secret_key="YOUR_SECRET_KEY")
Verify your credentials.
>>> response = rc.verify()
>>> response.text
u'{"message":"Verification Ok"}'
>>> response.status_code
200
The ReferralCandy Python API client will perform the authentication steps for you. This means that you would not be required to pass in the 'timestamp', 'accessID', and 'signature' parameters.
API endpoints are available as methods in the ReferralCandy Python API client.
E.g.
>>> rc.contacts({'limit': 1}).text
u'{"message":"Success","total_count":1,"contacts":[{"id":1,"first_name":"Sean","last_name":"X","email":"[email protected]","purchase_made":false,"purchases":[],"unsubscribed":true}]}'
The ReferralCandy Python API client uses requests. API responses are wrapped in requests.models.Response
objects.
>>> response = rc.verify()
>>> response.__class__
<class 'requests.models.Response'>
>>> response.text
u'{"message":"Verification Ok"}'
>>> response.status_code
200
Thank you for the inputs: