Generating Referral Codes

Referral Code API Object

A referral code is represented as the following JSON object in all API responses.

{
  "object_id": "rfc_0cc175b9c0f1b6a831c399e269772661",
  "object": "referral_code",
  "code": "gXbqigbfImI",
  "link": "http://example.org?refcode=gXbqigbfImI"
}

Referral Code Generation API

Referral codes are unique to campaigns and referrers. You will get the same referral code for each campaign and referrer combination.

Don't forget to replace the following placeholders with your own values when running the commands:

  • __API_KEY__  - your api key
  • __CAMPAIGN_ID__ - campaign object id
  • __EMAIL_ADDRESS__ - referrer email address
curl -X POST \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer __API_KEY__" \
    -d '{"campaign_id":"__CAMPAIGN_ID__","person_email":"__EMAIL_ADDRESS__"}' \
    "http://api.referralmagic.co/referral-codes"

Still need help? Contact Us Contact Us