# Public Methods

### Public Methods

### 1. Add a Subscriber

<mark style="color:green;">`POST`</mark> `https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers`

**Request Body**

| Name                                                       | Type    | Description                                                                                             |
| ---------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------- |
| email<mark style="color:red;">\*</mark>                    | String  | The email of the subscriber. Required if email is the unique identifier for the campaign.               |
| name                                                       | String  | The name of the subscriber                                                                              |
| crypto\_wallet\_address<mark style="color:red;">\*</mark>  | String  | The crypto wallet address. Required if it is the unique identifier for the campaign.                    |
| phone\_number<mark style="color:red;">\*</mark>            | String  | The phone number of the subscriber. Required if phone number is the unique identifier for the campaign. |
| extra\_field                                               | String  | The extra field value of the subscriber                                                                 |
| extra\_field\_2                                            | String  | The extra field 2 value of the subscriber                                                               |
| referrer                                                   | String  | The referral code or email of the referrer                                                              |
| lifetime\_spend                                            | Number  | Lifetime spend of the subscriber                                                                        |
| subscribe\_page\_url                                       | String  | Subscribe Page URL of the Subscriber                                                                    |
| landing\_page\_url                                         | String  | Landing Page URL of the Subscriber                                                                      |
| is\_quick\_add\_referral                                   | Boolean | Send **True** only if you want to add the referral as Quick Add Referral otherwise **False**            |
| option\_field\_value                                       | String  | Option field value of the subscriber                                                                    |
| other\_identifier\_value<mark style="color:red;">\*</mark> | String  | The other identifier value (Required if other identifier enabled as unique identifier)                  |
| double\_optin                                              | Boolean | Send **True** if you want to send verification method before adding otherwise **False**                 |
| points                                                     | Integer | Points of the subscriber                                                                                |
| crypto\_wallet\_provider                                   | String  | The crypto wallet provider                                                                              |
| visitor\_id                                                | String  | The visitor id received in params                                                                       |
| device                                                     | String  | The device used by subscriber when the referral link was clicked                                        |
| os\_type                                                   | String  | The Type of Operating system used by subscriber when the referral link was clicked                      |
| source                                                     | String  | The source of the subscriber.                                                                           |
| hosting\_url                                               | String  | URL used to generate the referral link.                                                                 |
| transaction\_id                                            | String  | The unique ID of the transaction. Useful when tracking purchases.                                       |
| conversion\_category                                       | String  | The type of subscriber. Useful for creating reports or segmenting subscribers.                          |
| conversion\_value                                          | Number  | The monetary conversion value of the subscriber                                                         |
| status                                                     | String  | Use 'custom\_event\_pending' to set the referral status to pending                                      |

When using this method please take note of your Campaign Goal as our tracking logic will depend on if you are tracking a single or multi-step conversion event.

{% hint style="info" %}
**GOAL: One Conversion Event**\
If you have your Campaign Goal set up to track one conversion event, the following tracking logic will take place:

* If a referral, a referral will be automatically created and set to Confirmed in the correct campaign.
* If not a referral, an organic subscriber will be created in the campaign UUID specified.
* If the subscriber exists in our database, the subscriber will be 'identified'. Data is not overwritten. Additional data will be created.
  {% endhint %}

{% hint style="info" %}
**GOAL: Two or Three Conversion Events**\
If you have your Campaign Goal set up to track two or three conversion events, the following tracking logic will take place:

* If a referral, a referral will be created and set to Pending in the correct campaign.
* If not a referral, an organic subscriber will be created in the campaign UUID specified.
* If the subscriber exists in our database, the subscriber will be 'identified'. Data is not overwritten.
  {% endhint %}

To add a subscriber (for example, post a successful signup or login) call the function and send the params information such as email address and name. The minimum values you should send for the endpoint to work are the following:

```dart
final subscriber = { 
    "email": "johnDoe123@gmail.com", 
    "domain": "https://a.domain.co/", 
}
```

**To identify and create a referral**, you must also send either the setReferrer OR the required param visitor\_id so that our matching algorithm can automatically identify a referral.

```dart
"os_type": "Android",
"device": "Android",
"visitor_id": "sub_*********",
```

{% hint style="warning" %}
NOTE:\
The visitor\_id parameter must be sent for our system to automatically identify and create a referral. See the Getting Started section here.
{% endhint %}

{% tabs %}
{% tab title="Example Request" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "xxxxxxxxxxxxxxxxxxxxxxxxxxxx");
myHeaders.append("Accept", "application/vnd.referralhero.v1");
myHeaders.append("Content-Type", "application/json");


var raw = JSON.stringify({
 "email": "test24@gmail.com",
 "name": "Test User 24",
 "phone_number": "9898989896",
 "extra_field": "some extra data",
 "extra_field_2": "some more extra data",
 "referrer": "",
 "conversion_value": 0,
 "conversion_category": "",
 "transaction_id": "",
 "os_type": "Android",
 "device": "Android",
 "visitor_id": "sub_********",
 "hosting_url": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxxx/analytics",
 "crypto_wallet_address": "",
 "crypto_wallet_provider": "",
 "points": 22,
 "double_optin": false,
 "other_identifier_value": "",
 "option_field_value": "",
 "is_quick_add_referral": true,
 "landing_page_url": "",
 "subscribe_page_url": "",
 "lifetime_spend": "",
 "status": "custom_event_pending"
});

var requestOptions = {
 method: 'POST',
 headers: myHeaders,
 body: raw,
 redirect: 'follow'
};

fetch("https://app.referralhero.com/api/sdk/v1/lists/MFxxxxxxxxxx/subscribers", requestOptions)
 .then(response => response.json())
 .then(result => console.log(result))
 .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="Example Response" %}

```javascript
{
    "status": "ok",
    "data": {
        "id": "sub_a1d333c890bf",
        "name": "Test User 10",
        "email": "test15@gmail.com",
        "phone_number": "",
        "crypto_wallet_address": "",
        "crypto_wallet_provider": "",
        "extra_field": "",
        "extra_field_2": "",
        "option_field": "",
        "conversion_amount": 0.0,
        "code": "33d278b9",
        "position": 21,
        "referred": false,
        "referred_by": {},
        "people_referred": 0,
        "promoted": false,
        "promoted_at": null,
        "verified": true,
        "verified_at": 1685018452,
        "points": 0,
        "risk_level": 0,
        "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic",
        "source": null,
        "device": null,
        "referral_link": "https://app.referralhero.com/dashboard/lists/Mxxxxxxxxx/analytics/traffic?mwr=33d278b9",
        "created_at": 1685018451,
        "last_updated_at": 1685018452,
        "os_type": null,
        "screen_size": null,
        "ip_address": null,
        "universal_link": "https://app.referralhero.com/MFxxxxxxxxx/universal_link?mwr=33d278b9",
        "status": "",
        "response": "subscriber_retrieved"
    },
    "calls_left": null,
    "timestamp": 1692865024
}
```

{% endtab %}
{% endtabs %}

### 2. Add Pending Referral

<mark style="color:green;">`POST`</mark>` `` ``https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/pending_referral `

This method is most commonly used to create a referral entering the 1st step of your multi-step conversion event funnel (i.e. after a referred user successfully signs up for your app). If you want us to automatically add every user to your campaign and determine if the user is a referral or not, use the Add Subscriber method instead. This logic only checks for referrals:

{% hint style="info" %}
**Tracking Logic**

**GOAL: Two or Three Conversion Events**

Your campaign Goal must be set up to track two or three conversion events, and then the following tracking logic will take place:

* If a referral, a referral will be automatically created and set to Pending in the correct campaign.
* If not a referral, no subscriber will be created.
  {% endhint %}

**Request Body**

| Name                     | Type   | Description                                                                                                                 |
| ------------------------ | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| email                    | String | The email of the subscriber. Required if email is the unique identifier for the campaign.                                   |
| phone\_number            | String | The phone number of the subscriber. Required if phone number is the unique identifier for the campaign.                     |
| crypto\_wallet\_address  | String | The crypto wallet address of the subscriber. Required if crypto wallet address is the unique identifier for the campaign.   |
| other\_identifier\_value | String | The other identifier value of the subscriber. Required if other identifier value is the unique identifier for the campaign. |

{% tabs %}
{% tab title="Example Request" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Accept", "application/vnd.referralhero.v1");
myHeaders.append("Authorization", "xxxxxxxxxxxxxxxxxx");

var raw = JSON.stringify({
  "name": "Pending Referral",
  "os_type": "IOS",
  "visitor_id": "sub_***********",
  "device": "IOS",
  "email": "testpending1@email.com",
  "Phone_nubmer": "",
  "Cryoto_wallet_address": "",
  "referrer": "8f01d5db",
  "hosting_url": "https://app.referralhero.com"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/pending_referral", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="Example Response" %}

```javascript
{
    "status": "ok",
    "data": {
        "id": "sub_a1d333c890bf",
        "name": "Test User 10",
        "email": "test15@gmail.com",
        "phone_number": "",
        "crypto_wallet_address": "",
        "crypto_wallet_provider": "",
        "extra_field": "",
        "extra_field_2": "",
        "option_field": "",
        "conversion_amount": 0.0,
        "code": "33d278b9",
        "position": 21,
        "referred": false,
        "referred_by": {},
        "people_referred": 0,
        "promoted": false,
        "promoted_at": null,
        "verified": true,
        "verified_at": 1685018452,
        "points": 0,
        "risk_level": 0,
        "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxxx/analytics/traffic",
        "source": null,
        "device": null,
        "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxxx/analytics/traffic?mwr=33d278b9",
        "created_at": 1685018451,
        "last_updated_at": 1685018452,
        "os_type": null,
        "screen_size": null,
        "ip_address": null,
        "universal_link": "https://app.referralhero.com/MFxxxxxxxxx/universal_link?mwr=33d278b9",
        "status": "",
        "response": "subscriber_retrieved"
    },
    "calls_left": null,
    "timestamp": 1692865024
}
```

{% endtab %}
{% endtabs %}

To add a pending referral, simply call ReferralHero's `createPendingReferral` function and send the `referralParams` data.

The minimum values for this endpoint to work:

```javascript
final referralParams = {
  "email": signup_email,
  "referrer": "M12345fc2",
};
```

OR:

```javascript
final referralParams = {
  'email': signup_email,
  'device': getDeviceType(), // Get device type
  'os_type': getOperatingSystem(), // Get operating system type
  'visitor_id': 'sub_***********'
};
```

{% hint style="info" %}
NOTE:\
The visitor\_id parameter must be sent for our system to automatically identify and create a referral.
{% endhint %}

### 3. Track Referral

<mark style="color:green;">`POST`</mark> `https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/track_referral_conversion_event`

This method is used for tracking a referral conversion event (i.e. a purchase, but can be any conversion event).

{% hint style="info" %}
**Tracking Logic**:

* If a referral and pre-existing in the campaign as Pending

**OR**

* If a referral and setReferrer or Visitor Id is provided, a referral is automatically created in the correct campaign and

**The Referral Is Set To:**

* Confirmed (if tracking two conversion events)
* Unconfirmed (if tracking three conversion events)
  {% endhint %}

**Note:**

1\. Your campaign must be set up as a custom event or a multi-step event otherwise, an error will return.

2\. If the referral is present in ReferralHero with pending status, a successful response `custom_event_completed` will return.

3\. If the referral unique identifier is not present in the ReferralHero, but the referrer unique identifier is present, a successful response `custom_event_completed` with the data of the new confirmed referral will return.

4\. If a referral exists but the referral status is not pending, the error `custom event is already completed` will return.

5\. If the referral unique identifier is not present in ReferralHero and the referrer is also not provided in the API, the error `referrer is invalid or not present` will return.

6\. If the referral status is unconfirmed or confirmed, the error `custom event is already completed` will return.

{% hint style="warning" %}
When tracking referrals on your App you should ALWAYS send the ACTUAL unique identifier (email, phone number, crypto wallet address, or other ID) of the user in referralParams class Object.
{% endhint %}

**Request Body**

| Name                                                      | Type   | Description                                                                                                                 |
| --------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| email<mark style="color:red;">\*</mark>                   | String | The email of the subscriber. Required if email is the unique identifier for the campaign.                                   |
| crypto\_wallet\_address<mark style="color:red;">\*</mark> | String | The crypto wallet address. Required if crypto wallet address is the unique identifier for the campaign.                     |
| phone\_number<mark style="color:red;">\*</mark>           | String | The phone number of the subscriber. Required if phone number is the unique identifier for the campaign.                     |
| other\_identifier\_value                                  | String | <p>The other identifier value. Required if other identifier value is the unique identifier for the campaign.</p><p><br></p> |

{% hint style="info" %}

* uniqueIdentifier is a placeholder.
* When tracking referrals on your App you should ALWAYS send the ACTUAL unique identifier (email, phone number, crypto wallet address, or other ID) of the user in referralParams class Object
  {% endhint %}

{% tabs %}
{% tab title="Example Request" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "xxxxxxxxxxxxxxxx");
myHeaders.append("Accept", "application/vnd.referralhero.v1");

var raw = JSON.stringify({
  "email": "test17@gmail.com",
  "name": "Test name updated",
  "phone_number": "3289408393",
  "Crypto_wallet_address": ""
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/track_referral_conversion_event", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="Example Response" %}

```javascript
{
    "status": "ok",
    "data": {
        "id": "sub_f3922a951cc3",
        "name": "Tarun Garg",
        "email": "taru820@gmail.com",
        "phone_number": "",
        "crypto_wallet_address": "4553",
        "crypto_wallet_provider": "",
        "extra_field": "",
        "extra_field_2": "",
        "option_field": "",
        "conversion_amount": 0.0,
        "code": "153aaf07",
        "position": 38,
        "referred": true,
        "referred_by": {
            "id": "sub_cd581757b137",
            "name": "Test User 10",
            "email": "test18@gmail.com",
            "code": "c6ff0e6f",
            "people_referred": 0,
            "points": 0
        },
        "people_referred": 0,
        "promoted": false,
        "promoted_at": null,
        "verified": true,
        "verified_at": 1692957804,
        "points": 0,
        "risk_level": 0,
        "host": "http://localhost:4005/",
        "source": null,
        "device": null,
        "referral_link": "http://localhost:4005/?mwr=153aaf07",
        "created_at": 1692957804,
        "last_updated_at": 1692957881,
        "os_type": null,
        "screen_size": null,
        "ip_address": null,
        "universal_link": "https://app.referralhero.com/MFxxxxxxxxx/universal_link?mwr=153aaf07",
        "status": "unconfirmed",
        "response": "custom_event_completed"
    },
    "calls_left": null,
    "timestamp": 1692957881
}
```

{% endtab %}
{% endtabs %}

### 4. Confirm Referral

<mark style="color:green;">`POST`</mark> `https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/:subscriber_id/confirm`

Use this method when your Campaign Goal is set to track three conversion events and you want to confirm a referral when your third conversion event occurs (complete profile, upgrade to a paid plan, end of the trial, etc).

{% hint style="info" %}
**Tracking Logic**:

* If a referral and pre-existing in the campaign as Unconfirmed

**The Referral Is Set To:**

* Confirmed (if tracking three conversion events)
  {% endhint %}

{% hint style="warning" %}
**Note:** only verified referrals can be confirmed. Trying to confirm a non-verified referral will return a `subscriber_not_found` error.
{% endhint %}

**Request Body**

| Name           | Type   | Description               |
| -------------- | ------ | ------------------------- |
| subscriber\_id | String | The ID of the subscriber. |

{% tabs %}
{% tab title="Example Request" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Accept", "application/vnd.referralhero.v1");
myHeaders.append("Authorization", "xxxxxxxxxxxxx");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/:subscriber_id/confirm", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="Example Response" %}

```javascript
{
    "status": "ok",
    "data": {
        "id": "sub_f3922a951cc3",
        "name": "Tarun Garg",
        "email": "tarungarg@gmail.com",
        "phone_number": "",
        "crypto_wallet_address": "4553",
        "crypto_wallet_provider": "",
        "extra_field": "",
        "extra_field_2": "",
        "option_field": "",
        "conversion_amount": 0.0,
        "code": "153aaf07",
        "position": 38,
        "referred": true,
        "referred_by": {
            "id": "sub_cd581757b137",
            "name": "John Doe",
            "email": "johndoe@gmail.com",
            "code": "c6ff0e6f",
            "people_referred": 1,
            "points": 0
        },
        "people_referred": 0,
        "promoted": false,
        "promoted_at": null,
        "verified": true,
        "verified_at": 1692957804,
        "points": 0,
        "risk_level": 0,
        "host": "http://localhost:4005/",
        "source": null,
        "device": null,
        "referral_link": "http://localhost:4005/?mwr=153aaf07",
        "created_at": 1692957804,
        "last_updated_at": 1692959314,
        "os_type": null,
        "screen_size": null,
        "ip_address": null,
        "universal_link": "https://app.referralhero.com/MFxxxxxxxxx/universal_link?mwr=153aaf07",
        "status": "confirmed",
        "response": "subscriber_confirmed"
    },
    "calls_left": null,
    "timestamp": 1692959314
}
```

{% endtab %}
{% endtabs %}

### 5. Organic Track Referral

<mark style="color:green;">`POST`</mark> `https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/organic_track_referral`

If you would like to add an organic subscriber or a track referral on the conversion page to your referral campaign, you can use the following method. This method would most commonly be used if the **user has not been previously added to your campaign** and instead directly passes through a post-checkout/subscribe event.

{% hint style="info" %}
**Tracking Logic**:

* If a referral and pre-existing in the campaign as Pending

**OR**

* If a referral and setReferrer or Visitor Id is provided, a referral is automatically created in the correct campaign and

**The Referral Is Set To:**

* Confirmed (if tracking two conversion events)
* Unconfirmed (if tracking three conversion events)

**OR**

* If not a referral, an organic subscriber is created in the campaign UUID specified.
  {% endhint %}

**Request Body**

| Name                     | Type   | Description                                                                                                                 |
| ------------------------ | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| email                    | String | The email of the subscriber. Required if email is the unique identifier for the campaign.                                   |
| phone\_number            | String | The phone number of the subscriber. Required if phone number is the unique identifier for the campaign.                     |
| crypto\_wallet\_address  | String | The crypto wallet address of the subscriber. Required if crypto wallet address is the unique identifier for the campaign.   |
| other\_identifier\_value | String | The other identifier value of the subscriber. Required if other identifier value is the unique identifier for the campaign. |

{% tabs %}
{% tab title="Example Request" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Accept", "application/vnd.referralhero.v1");
myHeaders.append("Authorization", "xxxxxxxxxxxx");

var raw = JSON.stringify({
  "email": "testorganic1@gmail.com",
  "name": "Test organic User1",
  "hosting_url": "https://app.referralhero.com/dashboard/lists/:uuid/analytics/traffic",
  "referrer": "2c2dbefb"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/organic_track_referral", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="Example Response" %}

```javascript
{
  "status": "ok",
  "data": {
    "id": "sub_41adff0cfc8e",
    "name": "Test organic User1",
    "email": "testorganic1@gmail.com",
    "phone_number": "",
    "crypto_wallet_address": "",
    "crypto_wallet_provider": "",
    "extra_field": "",
    "extra_field_2": "",
    "option_field": "",
    "conversion_amount": 0,
    "code": "23e0fb1c",
    "position": 5,
    "referred": true,
    "referred_by": {
      "id": "sub_7b9be1ed8ccb",
      "name": "Test User 10",
      "email": "test15@gmail.com",
      "code": "2c2dbefb",
      "people_referred": 0,
      "points": 0
    },
    "people_referred": 0,
    "promoted": false,
    "promoted_at": null,
    "verified": true,
    "verified_at": 1685020506,
    "points": 0,
    "risk_level": 0,
    "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxx/analytics/traffic",
    "source": null,
    "device": null,
    "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxx/analytics/traffic?mwr=23e0fb1c",
    "created_at": 1685020506,
    "last_updated_at": 1685020506,
    "os_type": null,
    "screen_size": null,
    "ip_address": null,
    "response": "subscriber_created"
  },
  "calls_left": null,
  "timestamp": 1685020506
}
```

{% endtab %}
{% endtabs %}

The Unique Identifier is the only required body parameter, otherwise, all other available subscriber attributes can be found above under 'Add a Subscriber'.

{% hint style="info" %}
**If the referral is NOT pre-existing in the campaign** (and you want to identify and create a referral), you must send either the setReferrer OR the required visitor\_id so that our matching algorithm can automatically identify a referral. See the Getting Started section here.
{% endhint %}

### 6. Update Subscriber Details

<mark style="color:purple;">`PATCH`</mark> `https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/:subscriber_id`

This method is used to update various user-related data like username, address, etc. Request parameters are the same as before in the Add a Subscriber API.

Required body parameters are noted below, otherwise, all other available subscriber attributes can be found above under 'Add a Subscriber'.

**Request Body**

| Name           | Type   | Description               |
| -------------- | ------ | ------------------------- |
| subscriber\_id | String | The ID of the subscriber. |

{% tabs %}
{% tab title="Example Request" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "xxxxxxxxxxxx");
myHeaders.append("Accept", "application/vnd.referralhero.v1");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
 "email": "test102@gmail.com",
 "name": "Test name new",
 "os_type": "Ubuntu"
});

var requestOptions = {
 method: 'PATCH',
 headers: myHeaders,
 body: raw,
 redirect: 'follow'
};

fetch("https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/:subscriber_id", requestOptions)
 .then(response => response.json())
 .then(result => console.log(result))
 .catch(error => console.log('error', error));


```

{% endtab %}

{% tab title="Example Response" %}

```javascript
{
    "status": "ok",
    "data": {
        "id": "sub_a1d333c890bf",
        "name": "Test User 10",
        "email": "test15@gmail.com",
        "phone_number": "",
        "crypto_wallet_address": "",
        "crypto_wallet_provider": "",
        "extra_field": "",
        "extra_field_2": "",
        "option_field": "",
        "conversion_amount": 0.0,
        "code": "33d278b9",
        "position": 21,
        "referred": false,
        "referred_by": {},
        "people_referred": 0,
        "promoted": false,
        "promoted_at": null,
        "verified": true,
        "verified_at": 1685018452,
        "points": 0,
        "risk_level": 0,
        "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic",
        "source": null,
        "device": null,
        "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxxx/analytics/traffic?mwr=33d278b9",
        "created_at": 1685018451,
        "last_updated_at": 1685018452,
        "os_type": null,
        "screen_size": null,
        "ip_address": null,
        "universal_link": "https://app.referralhero.com/MFxxxxxxxxx/universal_link?mwr=33d278b9",
        "status": "",
        "response": "subscriber_retrieved"
    },
    "calls_left": null,
    "timestamp": 1692865024
}
```

{% endtab %}
{% endtabs %}

### 7. Get Subscriber Details

<mark style="color:blue;">`GET`</mark> `https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/:subscriber_id`

This method is used to get the details of a particular subscriber.

**Path Parameters**

| Name                                             | Type   | Description               |
| ------------------------------------------------ | ------ | ------------------------- |
| subscriber\_id<mark style="color:red;">\*</mark> | String | The ID of the subscriber. |

{% tabs %}
{% tab title="Example Request" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/vnd.referralhero.v1");
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "xxxxxxxxxxxxx");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/subscriber_id", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="Example Response" %}

```javascript
{
    "status": "ok",
    "data": {
        "id": "sub_a1d333c890bf",
        "name": "Test User 10",
        "email": "test15@gmail.com",
        "phone_number": "",
        "crypto_wallet_address": "",
        "crypto_wallet_provider": "",
        "extra_field": "",
        "extra_field_2": "",
        "option_field": "",
        "conversion_amount": 0.0,
        "code": "33d278b9",
        "position": 21,
        "referred": false,
        "referred_by": {},
        "people_referred": 0,
        "promoted": false,
        "promoted_at": null,
        "verified": true,
        "verified_at": 1685018452,
        "points": 0,
        "risk_level": 0,
        "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics",
        "source": null,
        "device": null,
        "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics?mwr=33d278b9",
        "created_at": 1685018451,
        "last_updated_at": 1685018452,
        "os_type": null,
        "screen_size": null,
        "ip_address": null,
        "universal_link": "https://app.referralhero.com/MFxxxxxxxxxx/universal_link?mwr=33d278b9",
        "status": "",
        "response": "subscriber_retrieved"
    },
    "calls_left": null,
    "timestamp": 1692865024
}
```

{% endtab %}
{% endtabs %}

### 8. Delete Subscriber

<mark style="color:red;">`DELETE`</mark> `https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/:subscriber_id`

This method is used to Delete a Subscriber.

**Path Parameters**

| Name                                             | Type   | Description               |
| ------------------------------------------------ | ------ | ------------------------- |
| subscriber\_id<mark style="color:red;">\*</mark> | String | The ID of the subscriber. |

{% tabs %}
{% tab title="Example Request" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "xxxxxxxxxxxxxxx");
myHeaders.append("Accept", "application/vnd.referralhero.v1");
myHeaders.append("Content-Type", "application/json");

var requestOptions = {
  method: 'DELETE',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/:subscriber_id", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="Example Response" %}

```javascript
{
    "status": "ok",
    "data": {
        "id": "sub_a1d333c890bf",
        "name": "Test User 10",
        "email": "test15@gmail.com",
        "phone_number": "",
        "crypto_wallet_address": "",
        "crypto_wallet_provider": "",
        "extra_field": "",
        "extra_field_2": "",
        "option_field": "",
        "conversion_amount": 0.0,
        "code": "33d278b9",
        "position": 21,
        "referred": false,
        "referred_by": {},
        "people_referred": 0,
        "promoted": false,
        "promoted_at": null,
        "verified": true,
        "verified_at": 1685018452,
        "points": 0,
        "risk_level": 0,
        "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic",
        "source": null,
        "device": null,
        "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic?mwr=33d278b9",
        "created_at": 1685018451,
        "last_updated_at": 1685018452,
        "os_type": null,
        "screen_size": null,
        "ip_address": null,
        "universal_link": "https://app.referralhero.com/MFxxxxxxxxx/universal_link?mwr=33d278b9",
        "status": "",
        "response": "subscriber_retrieved"
    },
    "calls_left": null,
    "timestamp": 1692865024
}
```

{% endtab %}
{% endtabs %}

### 9. Capture Share

<mark style="color:green;">`POST`</mark> `https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/:subscriber_id/click_capture`

This method is used with parameters like 'copy', 'sms', 'facebook', 'twitter', etc. to capture a Share Event.

**Request Body**

| Name   | Type               | Description                                    |
| ------ | ------------------ | ---------------------------------------------- |
| social | facebook           | To capture a 'facebook' share event.           |
| social | twitter            | To capture a 'twitter' share event.            |
| social | linkedin           | To capture a 'linkedin' share event.           |
| social | email              | To capture a 'email' share event.              |
| social | telegram           | To capture a 'telegram' share event.           |
| social | sms                | To capture a 'sms' share event.                |
| social | copy               | To capture a 'copy' share event.               |
| social | reddit             | To capture a 'reddit' share event.             |
| social | facebook messenger | To capture a 'facebook messenger' share event. |
| social | whatsapp           | To capture a 'whatsapp' share event.           |
| social | line               | To capture a 'line' share event.               |
| social | pinterest          | To capture a 'pinterest' share event.          |

{% tabs %}
{% tab title="Example Request" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "xxxxxxxxxxxxxx");
myHeaders.append("Accept", "application/vnd.referralhero.v1");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "social": "facebook"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/:subscriber_id/click_capture", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="Example Response" %}

```javascript
{
    "status": "ok",
    "data": {
        "id": "sub_a1d333c890bf",
        "name": "Test User 10",
        "email": "test15@gmail.com",
        "phone_number": "",
        "crypto_wallet_address": "",
        "crypto_wallet_provider": "",
        "extra_field": "",
        "extra_field_2": "",
        "option_field": "",
        "conversion_amount": 0.0,
        "code": "33d278b9",
        "position": 21,
        "referred": false,
        "referred_by": {},
        "people_referred": 0,
        "promoted": false,
        "promoted_at": null,
        "verified": true,
        "verified_at": 1685018452,
        "points": 0,
        "risk_level": 0,
        "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic",
        "source": null,
        "device": null,
        "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxxx/analytics/traffic?mwr=33d278b9",
        "created_at": 1685018451,
        "last_updated_at": 1685018452,
        "os_type": null,
        "screen_size": null,
        "ip_address": null,
        "universal_link": "https://app.referralhero.com/MFxxxxxxxxx/universal_link?mwr=33d278b9",
        "status": "",
        "response": "subscriber_retrieved"
    },
    "calls_left": null,
    "timestamp": 1692865024
}
```

{% endtab %}
{% endtabs %}

### 10. Get My Referrals

<mark style="color:blue;">`GET`</mark> `https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/:subscriber-id/referrals_data`

This method is used for retrieving all referrals of the specific subscriber.

**Path Parameters**

| Name                                            | Type   | Description                |
| ----------------------------------------------- | ------ | -------------------------- |
| uuid<mark style="color:red;">\*</mark>          | String | List UUID for the campaign |
| subscriber-id<mark style="color:red;">\*</mark> | String | Subscriber ID              |

{% tabs %}
{% tab title="Example Request" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "xxxxxxxxxxxxxxxx");
myHeaders.append("Accept", "application/vnd.referralhero.v1");
myHeaders.append("Content-Type", "application/json");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/:subscriber_id/referrals_data", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="Example Response" %}

```javascript
{
    "status": "ok",
    "data": {
        "response": "subscribers_retrieved",
        "subscribers": [
            {
                "id": "sub_fa49ba0d30e9",
                "name": "Test User 10",
                "email": "test125@gmail.com",
                "phone_number": "",
                "crypto_wallet_address": "",
                "crypto_wallet_provider": "",
                "extra_field": "",
                "extra_field_2": "",
                "option_field": "",
                "conversion_amount": 0.0,
                "code": "dededb46",
                "position": 18,
                "referred": true,
                "referred_by": {
                    "id": "sub_d0cc231dce89",
                    "name": "Test name",
                    "email": "test26@gmail.com",
                    "code": "0879561f",
                    "people_referred": 1,
                    "points": 0
                },
                "people_referred": 0,
                "promoted": false,
                "promoted_at": null,
                "verified": true,
                "verified_at": 1684985427,
                "points": 0,
                "risk_level": 0,
                "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic",
                "source": null,
                "device": null,
                "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic?mwr=dededb46",
                "created_at": 1684985427,
                "last_updated_at": 1684985427,
                "os_type": null,
                "screen_size": null,
                "ip_address": null,
                "universal_link": "https://app.referralhero.com/MFxxxxxxxxx/universal_link?mwr=dededb46",
                "status": "confirmed"
            }
        ],
        "pagination": {
            "total_pages": 1,
            "current_page": 1,
            "per_page": 50,
            "total_objects": 1
        }
    },
    "calls_left": null,
    "timestamp": 1692954116
}
```

{% endtab %}
{% endtabs %}

### 11. Get Leaderboard

<mark style="color:blue;">`GET`</mark> `https://app.referralhero.com/api/sdk/v1/lists/:uuid/leaderboard`

This method is used for retrieving the campaign leaderboard.

**Path Parameters**

| Name                                   | Type   | Description                |
| -------------------------------------- | ------ | -------------------------- |
| uuid<mark style="color:red;">\*</mark> | String | List UUID for the campaign |

{% tabs %}
{% tab title="Example Request" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "xxxxxxxxxxxxxxxx");
myHeaders.append("Accept", "application/vnd.referralhero.v1");
myHeaders.append("Content-Type", "application/json");

var requestOptions = {
  method: 'GET',
  headers: myHeaders
};

fetch("https://app.referralhero.com/api/sdk/v1/lists/:uuid/leaderboard", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="Example Response" %}

```javascript
{
    "status": "ok",
    "data": {
        "ranking": [
            {
                "id": "sub_7b9be1ed8ccb",
                "name": "Test name new",
                "email": "test102@gmail.com",
                "phone_number": "",
                "crypto_wallet_address": "",
                "crypto_wallet_provider": "",
                "extra_field": "",
                "extra_field_2": "",
                "option_field": "",
                "conversion_amount": 0.0,
                "code": "2c2dbefb",
                "position": 11,
                "referred": false,
                "referred_by": {},
                "people_referred": 3,
                "promoted": false,
                "promoted_at": null,
                "verified": true,
                "verified_at": 1685018462,
                "points": 0,
                "risk_level": 0,
                "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic",
                "source": null,
                "device": null,
                "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic?mwr=2c2dbefb",
                "created_at": 1685018462,
                "last_updated_at": 1686575826,
                "os_type": null,
                "screen_size": null,
                "ip_address": null,
                "universal_link": "https://app.referralhero.com/MFxxxxxxxxxx/universal_link?mwr=2c2dbefb",
                "status": ""
            },
            {
                "id": "sub_7797d0ec272e",
                "name": "",
                "email": "test786@gmail.com",
                "phone_number": "",
                "crypto_wallet_address": "",
                "crypto_wallet_provider": "",
                "extra_field": "",
                "extra_field_2": "",
                "option_field": "",
                "conversion_amount": 0.0,
                "code": "9f234785",
                "position": 11,
                "referred": false,
                "referred_by": {},
                "people_referred": 2,
                "promoted": false,
                "promoted_at": null,
                "verified": true,
                "verified_at": 1686814646,
                "points": 0,
                "risk_level": 0,
                "host": "http://localhost:3000/legf4edsitimate",
                "source": null,
                "device": null,
                "referral_link": "http://localhost:3000/legf4edsitimate?mwr=9f234785",
                "created_at": 1686814646,
                "last_updated_at": 1686815029,
                "os_type": null,
                "screen_size": null,
                "ip_address": null,
                "universal_link": "https://app.referralhero.com/MFxxxxxxxxxx/universal_link?mwr=9f234785",
                "status": ""
            },
            {
                "id": "sub_06e2af5a2236",
                "name": "Test User multi1",
                "email": "testorganic3@gmail.com",
                "phone_number": "",
                "crypto_wallet_address": "",
                "crypto_wallet_provider": "",
                "extra_field": "",
                "extra_field_2": "",
                "option_field": "",
                "conversion_amount": 0.0,
                "code": "afd54225",
                "position": 11,
                "referred": false,
                "referred_by": {},
                "people_referred": 1,
                "promoted": false,
                "promoted_at": null,
                "verified": true,
                "verified_at": 1685018562,
                "points": 0,
                "risk_level": 0,
                "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxxx/analytics/traffic",
                "source": null,
                "device": null,
                "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic?mwr=afd54225",
                "created_at": 1685018562,
                "last_updated_at": 1686138321,
                "os_type": null,
                "screen_size": null,
                "ip_address": null,
                "universal_link": "https://app.referralhero.com/MFxxxxxxxxx/universal_link?mwr=afd54225",
                "status": ""
            },
            {
                "id": "sub_41adff0cfc8e",
                "name": "Test organic User1",
                "email": "testorganic1@gmail.com",
                "phone_number": "",
                "crypto_wallet_address": "",
                "crypto_wallet_provider": "",
                "extra_field": "",
                "extra_field_2": "",
                "option_field": "",
                "conversion_amount": 0.0,
                "code": "23e0fb1c",
                "position": 1,
                "referred": true,
                "referred_by": {
                    "id": "sub_7b9be1ed8ccb",
                    "name": "Test name new",
                    "email": "test102@gmail.com",
                    "code": "2c2dbefb",
                    "people_referred": 3,
                    "points": 0
                },
                "people_referred": 1,
                "promoted": false,
                "promoted_at": null,
                "verified": true,
                "verified_at": 1685020506,
                "points": 0,
                "risk_level": 0,
                "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxxx/analytics/traffic",
                "source": null,
                "device": null,
                "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic?mwr=23e0fb1c",
                "created_at": 1685020506,
                "last_updated_at": 1688983405,
                "os_type": null,
                "screen_size": null,
                "ip_address": null,
                "universal_link": "https://app.referralhero.com/MFxxxxxxxxxx/universal_link?mwr=23e0fb1c",
                "status": "confirmed"
            },
            {
                "id": "sub_f9bb5d521d45",
                "name": "",
                "email": "test788@gmail.com",
                "phone_number": "",
                "crypto_wallet_address": "",
                "crypto_wallet_provider": "",
                "extra_field": "",
                "extra_field_2": "",
                "option_field": "",
                "conversion_amount": 0.0,
                "code": "4646a17a",
                "position": 11,
                "referred": true,
                "referred_by": {
                    "id": "sub_7797d0ec272e",
                    "name": "",
                    "email": "test786@gmail.com",
                    "code": "9f234785",
                    "people_referred": 2,
                    "points": 0
                },
                "people_referred": 1,
                "promoted": false,
                "promoted_at": null,
                "verified": true,
                "verified_at": 1686814799,
                "points": 0,
                "risk_level": 0,
                "host": "http://localhost:3000/legitimate",
                "source": null,
                "device": null,
                "referral_link": "http://localhost:3000/legitimate?mwr=4646a17a",
                "created_at": 1686814799,
                "last_updated_at": 1686824516,
                "os_type": null,
                "screen_size": null,
                "ip_address": null,
                "universal_link": "https://app.referralhero.com/MFxxxxxxxxxx/universal_link?mwr=4646a17a",
                "status": "confirmed"
            },
            {
                "id": "sub_1bb1e02b90cb",
                "name": "Pending Referral",
                "email": "testpending1@email.com",
                "phone_number": "",
                "crypto_wallet_address": "",
                "crypto_wallet_provider": "",
                "extra_field": "",
                "extra_field_2": "",
                "option_field": "",
                "conversion_amount": 0.0,
                "code": "1b155f4e",
                "position": 11,
                "referred": true,
                "referred_by": {
                    "id": "sub_7b9be1ed8ccb",
                    "name": "Test name new",
                    "email": "test102@gmail.com",
                    "code": "2c2dbefb",
                    "people_referred": 3,
                    "points": 0
                },
                "people_referred": 0,
                "promoted": false,
                "promoted_at": null,
                "verified": true,
                "verified_at": 1685018482,
                "points": 0,
                "risk_level": 0,
                "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxx/analytics/traffic",
                "source": null,
                "device": "IOS",
                "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic?mwr=1b155f4e",
                "created_at": 1685018482,
                "last_updated_at": 1685707183,
                "os_type": "IOS",
                "screen_size": "64*32",
                "ip_address": "123.456.789.0123",
                "universal_link": "https://app.referralhero.com/MFxxxxxxxxx/universal_link?mwr=1b155f4e",
                "status": "confirmed"
            },
            {
                "id": "sub_e3a22f9c058e",
                "name": "Test User 10",
                "email": "test15@gmail.com",
                "phone_number": "",
                "crypto_wallet_address": "",
                "crypto_wallet_provider": "",
                "extra_field": "",
                "extra_field_2": "",
                "option_field": "",
                "conversion_amount": 0.0,
                "code": "05d97b9c",
                "position": 11,
                "referred": true,
                "referred_by": {
                    "id": "sub_7b9be1ed8ccb",
                    "name": "Test name new",
                    "email": "test102@gmail.com",
                    "code": "2c2dbefb",
                    "people_referred": 3,
                    "points": 0
                },
                "people_referred": 0,
                "promoted": false,
                "promoted_at": null,
                "verified": true,
                "verified_at": 1685804120,
                "points": 0,
                "risk_level": 0,
                "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxxx/analytics/traffic",
                "source": null,
                "device": null,
                "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic?mwr=05d97b9c",
                "created_at": 1685804120,
                "last_updated_at": 1685824588,
                "os_type": null,
                "screen_size": null,
                "ip_address": null,
                "universal_link": "https://app.referralhero.com/MFxxxxxxxxxx/universal_link?mwr=05d97b9c",
                "status": "confirmed"
            },
            {
                "id": "sub_1745bc28a318",
                "name": "Test User 11",
                "email": "test11@gmail.com",
                "phone_number": "",
                "crypto_wallet_address": "",
                "crypto_wallet_provider": "",
                "extra_field": "",
                "extra_field_2": "",
                "option_field": "",
                "conversion_amount": 0.0,
                "code": "0cdf62b6",
                "position": 2,
                "referred": true,
                "referred_by": {
                    "id": "sub_41adff0cfc8e",
                    "name": "Test organic User1",
                    "email": "testorganic1@gmail.com",
                    "code": "23e0fb1c",
                    "people_referred": 1,
                    "points": 0
                },
                "people_referred": 0,
                "promoted": false,
                "promoted_at": null,
                "verified": true,
                "verified_at": 1686138035,
                "points": 0,
                "risk_level": 0,
                "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic",
                "source": null,
                "device": null,
                "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic?mwr=0cdf62b6",
                "created_at": 1686138035,
                "last_updated_at": 1688983288,
                "os_type": null,
                "screen_size": null,
                "ip_address": null,
                "universal_link": "https://app.referralhero.com/MFxxxxxxxxx/universal_link?mwr=0cdf62b6",
                "status": "unconfirmed"
            },
            {
                "id": "sub_4056a6b27122",
                "name": "Test User 16",
                "email": "test16@gmail.com",
                "phone_number": "",
                "crypto_wallet_address": "",
                "crypto_wallet_provider": "",
                "extra_field": "",
                "extra_field_2": "",
                "option_field": "",
                "conversion_amount": 0.0,
                "code": "7af598cb",
                "position": 11,
                "referred": true,
                "referred_by": {
                    "id": "sub_06e2af5a2236",
                    "name": "Test User multi1",
                    "email": "testorganic3@gmail.com",
                    "code": "afd54225",
                    "people_referred": 1,
                    "points": 0
                },
                "people_referred": 0,
                "promoted": false,
                "promoted_at": null,
                "verified": true,
                "verified_at": 1686138073,
                "points": 0,
                "risk_level": 0,
                "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic",
                "source": null,
                "device": null,
                "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxx/analytics/traffic?mwr=7af598cb",
                "created_at": 1686138073,
                "last_updated_at": 1686138319,
                "os_type": null,
                "screen_size": null,
                "ip_address": null,
                "universal_link": "https://app.referralhero.com/MFxxxxxxxxx/universal_link?mwr=7af598cb",
                "status": "confirmed"
            },
            {
                "id": "sub_637a4521548a",
                "name": "",
                "email": "test787@gmail.com",
                "phone_number": "",
                "crypto_wallet_address": "",
                "crypto_wallet_provider": "",
                "extra_field": "",
                "extra_field_2": "",
                "option_field": "",
                "conversion_amount": 0.0,
                "code": "1e42e41f",
                "position": 11,
                "referred": true,
                "referred_by": {
                    "id": "sub_7797d0ec272e",
                    "name": "",
                    "email": "test786@gmail.com",
                    "code": "9f234785",
                    "people_referred": 2,
                    "points": 0
                },
                "people_referred": 0,
                "promoted": false,
                "promoted_at": null,
                "verified": true,
                "verified_at": 1686814728,
                "points": 0,
                "risk_level": 0,
                "host": "http://localhost:3000/legf4edsitimate",
                "source": null,
                "device": null,
                "referral_link": "http://localhost:3000/legf4edsitimate?mwr=1e42e41f",
                "created_at": 1686814728,
                "last_updated_at": 1686815033,
                "os_type": null,
                "screen_size": null,
                "ip_address": null,
                "universal_link": "https://app.referralhero.com/MFxxxxxxxxx/universal_link?mwr=1e42e41f",
                "status": "confirmed"
            }
        ],
        "count": 10
    },
    "calls_left": null,
    "timestamp": 1692954943
}
```

{% endtab %}
{% endtabs %}

### 12. Get Referrer

<mark style="color:blue;">`GET`</mark> `https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/referrer`

This method is used to retrieve the referrer of a user. By calling this method, you would know if someone was a referral or not, and then could:

* Apply a discount code automatically to the checkout process
* Personalize text shown on a page

**Path Parameters**

| Name                                   | Type   | Description                |
| -------------------------------------- | ------ | -------------------------- |
| uuid<mark style="color:red;">\*</mark> | String | List UUID for the campaign |

{% tabs %}
{% tab title="Example Request" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "xxxxxxxxxxxxxxx");
myHeaders.append("Accept", "application/vnd.referralhero.v1");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "os_type": "ios",
  "devise": "device",
  "ip_address": "192.168.0.1",
  "screen_size": "1200x1800"
});


var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/referrer", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="Example Response" %}

```javascript
{
    "status": "ok",
    "data": {
        "id": "sub_68c9ed9e2712",
        "name": "test one",
        "email": "test1@gmail.com",
        "phone_number": "",
        "crypto_wallet_address": "",
        "crypto_wallet_provider": "",
        "extra_field": "",
        "extra_field_2": "",
        "option_field": "",
        "conversion_amount": 0.0,
        "code": "00598133",
        "position": 2,
        "referred": false,
        "referred_by": {},
        "people_referred": 1,
        "promoted": false,
        "promoted_at": null,
        "verified": true,
        "verified_at": 1686310876,
        "points": 0,
        "risk_level": 0,
        "host": "https://app.referralhero.com",
        "source": null,
        "device": null,
        "referral_link": "https://app.referralhero.com?mwr=00598133",
        "created_at": 1686310876,
        "last_updated_at": 1692824465,
        "os_type": null,
        "screen_size": null,
        "ip_address": null,
        "universal_link": "https://app.referralhero.com/MFxxxxxxxxx/universal_link?mwr=00598133",
        "status": "",
        "response": "subscriber_retrieved"
    },
    "calls_left": null,
    "timestamp": 1692957166
}
```

{% endtab %}
{% endtabs %}

### 13. Get Rewards

<mark style="color:blue;">`GET`</mark> `https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/:subscriber_id/rewards`

Use this method to Get Rewards unlocked by a specific subscriber.

**Path Parameters**

| Name                                            | Type   | Description                |
| ----------------------------------------------- | ------ | -------------------------- |
| uuid<mark style="color:red;">\*</mark>          | String | List UUID for the campaign |
| subscriber-id<mark style="color:red;">\*</mark> | String | Subscriber ID              |

{% tabs %}
{% tab title="Example Request" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "xxxxxxxxxxxxxxxx");
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Accept", "application/vnd.referralhero.v1");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://app.referralhero.com/api/sdk/v1/lists/:uuid/subscribers/sub_bfdc2b6e2f7e/rewards", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="Example Response" %}

```javascript
{
    "status": "ok",
    "data": {
        "response": "rewards_retrieved",
        "rewards": [
            {
                "id": 1795,
                "name": "A free Premium account for 1 year",
                "status": "confirmed",
                "referrals": null,
                "created_at": 1686397951,
                "signup_type": "organic subscriber",
                "referrals_type": null,
                "recurring_count": null,
                "image_url": null
            }
        ],
        "pagination": {
            "total_pages": 1,
            "current_page": 1,
            "per_page": 10,
            "total_objects": 1
        }
    },
    "calls_left": null,
    "timestamp": 1687759997
}
```

{% endtab %}
{% endtabs %}
