Referral information is represented as the following JSON object.
{
"campaign": {
"id": "cmp_123456a2a23453754201daad7f0ab125",
"object_id": "cmp_123456a2a23453754201daad7f0ab125",
"object": "campaign",
"name": "Dummy campaign",
"type": "conversion-machine",
"created": 1556013468,
"created_at": 1556013468
},
"person": {
"id": "per_12345696e050d89c119221d3f7986e92",
"object_id": "per_12345696e050d89c119221d3f7986e92",
"object": "person",
"name": "Georgette Braun",
"email": "[email protected]",
"created": 1556023468,
"created_at": 1556023468
},
"referral_stats": {
"visits": 3,
"sign_ups": 1,
"conversions": 1
},
"referrals": [...PersonAPIObject],
"referral_code": "123456bfIYk"
}
Referral information can be retrieved in two ways.
Don't forget to replace the following placeholders with your own values when running the commands:
__API_KEY__
- your api key__REFERRAL_CODE__
- referral code__CAMPAIGN_ID__
- campaign object id__EMAIL_ADDRESS__
- referrer email addresscurl -X GET \\
-H "Accept: application/json" \\
-H "Content-Type: application/json" \\
-H "Authorization: Bearer __API_KEY__" \\
"<https://api.referralmagic.co/referrals/__REFERRAL_CODE__>"
curl -X GET \\
-H "Accept: application/json" \\
-H "Content-Type: application/json" \\
-H "Authorization: Bearer __API_KEY__" \\
"<https://api.referralmagic.co/campaigns/__CAMPAIGN_ID__/referrals?email=__EMAIL_ADDRESS__>"