Retrieving Rewards

Reward API Object

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

{
  "object_id": "rwd_0bb38c3719a572e149e51fdec9a159b1",
  "object": "reward",
  "is_monetary": false,
  "is_redeemed": false,
  "amount": 1000,
  "created": 1502486922,
  "person": {
    "object_id": "per_7bba99740fe55a1938696fa789f1b392",
    "object": "person",
    "name": "Keegan Christiansen",
    "email": "nella46@example.org",
    "created": 1503322719
  }
}

A list of rewards is represented as follows:

{
  "rewards": [...]
}

Reward Retrieval API

You can filter and retrieve rewards through:

  • Campaigns
  • People (by object id or email address)
  • Your Account

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
  • __PERSON_ID__  - person object id
  • __EMAIL_ADDRESS__  - person email address

Retrieve a campaign's all or pending rewards

curl -X GET \
    -H "Accept: application/json" \
    -H "Authorization: Bearer __API_KEY__" \
    "https://api.referralmagic.co/campaigns/__CAMPAIGN_ID__/rewards"

If you want to retrieve pending rewards only, add  ?pending=1 at the end of URL.

Retrieve a person's all or pending rewards

curl -X GET\
    -H "Accept: application/json"\
    -H "Authorization: Bearer __API_KEY__"\
    "https://api.referralmagic.co/people/__PERSON_ID__/rewards"

If you want to retrieve pending rewards only, add  ?pending=1 at the end of URL.

Retrieve a person's all or pending rewards (searching with email address)

curl -X GET \
    -H "Accept: application/json" \
    -H "Authorization: Bearer __API_KEY__" \
    "https://api.referralmagic.co/rewards?email=__EMAIL_ADDRESS__"

If you want to retrieve pending rewards only, add  &pending=1 at the end of URL.

Retrieve all or pending rewards in your account

curl -X GET \
    -H "Accept: application/json" \
    -H "Authorization: Bearer __API_KEY__" \
    "https://api.referralmagic.co/rewards"

If you want to retrieve pending rewards only, add ?pending=1 at the end of URL.

Still need help? Contact Us Contact Us