NAV Navbar
Shell HTTP JavaScript Node.JS Ruby Python Java Go
  • SalesCamp V1 API v0.0.2
  • Authentication
  • campaigns
  • rewards
  • referrers
  • Schemas
  • SalesCamp V1 API v0.0.2

    Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

    Below listed methods that is accessible through api endpoints.

    Authentication

    campaigns

    Operations about campaigns

    getCampaign

    Code samples

    # You can also use wget
    curl -X GET //localhost:3000//api/v1/campaigns/{id} \
      -H 'Accept: application/json' \
      -H 'Authorization: string'
    
    
    GET //localhost:3000//api/v1/campaigns/{id} HTTP/1.1
    Host: null
    
    Accept: application/json
    Authorization: string
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    $.ajax({
      url: '//localhost:3000//api/v1/campaigns/{id}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    fetch('//localhost:3000//api/v1/campaigns/{id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'string'
    }
    
    result = RestClient.get '//localhost:3000//api/v1/campaigns/{id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'string'
    }
    
    r = requests.get('//localhost:3000//api/v1/campaigns/{id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("//localhost:3000//api/v1/campaigns/{id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "Authorization": []string{"string"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "//localhost:3000//api/v1/campaigns/{id}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/v1/campaigns/{id}

    Campaigns details information

    Return a campaign

    Parameters

    Parameter In Type Required Description
    Authorization header string true Valid Api Key
    id path string true ID of the campaign

    Example responses

    {
      "id": 0,
      "name": 0,
      "url": "string",
      "type": "string",
      "title": "string",
      "subtitle": "string",
      "goal": {
        "event": "string",
        "reward_type": "string",
        "amount": 0,
        "amount_type": "string",
        "ongoing": true
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Return a campaign CampaignDetails

    getAllCampaigns

    Code samples

    # You can also use wget
    curl -X GET //localhost:3000//api/v1/campaigns \
      -H 'Accept: application/json' \
      -H 'Authorization: string'
    
    
    GET //localhost:3000//api/v1/campaigns HTTP/1.1
    Host: null
    
    Accept: application/json
    Authorization: string
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    $.ajax({
      url: '//localhost:3000//api/v1/campaigns',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    fetch('//localhost:3000//api/v1/campaigns',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'string'
    }
    
    result = RestClient.get '//localhost:3000//api/v1/campaigns',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'string'
    }
    
    r = requests.get('//localhost:3000//api/v1/campaigns', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("//localhost:3000//api/v1/campaigns");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "Authorization": []string{"string"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "//localhost:3000//api/v1/campaigns", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/v1/campaigns

    Campaigns list information

    Return all campaigns

    Parameters

    Parameter In Type Required Description
    Authorization header string true Valid Api Key
    page query integer(int32) false Page for pagination (default is 1)
    per_page query integer(int32) false Per page for pagination (default is 10)

    Example responses

    [
      {
        "id": 0,
        "name": 0,
        "url": "string"
      }
    ]
    

    Responses

    Status Meaning Description Schema
    200 OK Return all campaigns Inline

    Response Schema

    Status Code 200

    Name Type Required Description
    anonymous [Campaign] false No description
    » id integer(int32) false ID of the campaign.
    » name integer(int32) false ID of the campaign.
    » url string false Url of the campaig - for which unique referrers url will be generated.

    rewards

    Operations about rewards

    createReward

    Code samples

    # You can also use wget
    curl -X POST //localhost:3000//api/v1/rewards \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      -H 'Accept: application/json' \
      -H 'Authorization: string'
    
    
    POST //localhost:3000//api/v1/rewards HTTP/1.1
    Host: null
    Content-Type: application/x-www-form-urlencoded
    Accept: application/json
    Authorization: string
    
    
    var headers = {
      'Content-Type':'application/x-www-form-urlencoded',
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    $.ajax({
      url: '//localhost:3000//api/v1/rewards',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const request = require('node-fetch');
    const inputBody = '{
      "campaign_id": 0,
      "referrer_id": 0,
      "referrer_token": "string",
      "referrer_email": "string",
      "referral_ip": "string",
      "referral_email": "string",
      "referral_stripe_id": "string",
      "referral_stripe_amount": "string",
      "fulfilled": true
    }';
    const headers = {
      'Content-Type':'application/x-www-form-urlencoded',
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    fetch('//localhost:3000//api/v1/rewards',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/x-www-form-urlencoded',
      'Accept' => 'application/json',
      'Authorization' => 'string'
    }
    
    result = RestClient.post '//localhost:3000//api/v1/rewards',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Accept': 'application/json',
      'Authorization': 'string'
    }
    
    r = requests.post('//localhost:3000//api/v1/rewards', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("//localhost:3000//api/v1/rewards");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("POST");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/x-www-form-urlencoded"},
            "Accept": []string{"application/json"},
            "Authorization": []string{"string"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "//localhost:3000//api/v1/rewards", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/v1/rewards

    Create reward returning detailed information about it

    Create reward

    Body parameter

    campaign_id: 0
    referrer_id: 0
    referrer_token: string
    referrer_email: string
    referral_ip: string
    referral_email: string
    referral_stripe_id: string
    referral_stripe_amount: string
    fulfilled: true
    
    

    Parameters

    Parameter In Type Required Description
    Authorization header string true Valid Api Key
    campaign_id body integer(int32) true ID of the campaign
    referrer_id body integer(int32) false ID of the referrer
    referrer_token body string false Token of the referrer
    referrer_email body string false Email of the referrer
    referral_ip body string false IP of the referral
    referral_email body string false Email of the referral
    referral_stripe_id body string false StripeID of the referral
    referral_stripe_amount body string false Sale Amount generated by the referral
    fulfilled body boolean false automatically make reward awarded

    Example responses

    {
      "id": 0,
      "awarded": true,
      "referral_ip": "string",
      "referral_email": "string",
      "referral_stripe_id": "string",
      "referral_generated": 0,
      "amount": 0,
      "created_at": "string",
      "updated_at": "string",
      "referrer": {
        "id": 0,
        "token": 0,
        "email": 0
      }
    }
    

    Responses

    Status Meaning Description Schema
    201 Created Create reward RewardDetails

    getRewards

    Code samples

    # You can also use wget
    curl -X GET //localhost:3000//api/v1/rewards?campaign_id=string \
      -H 'Accept: application/json' \
      -H 'Authorization: string'
    
    
    GET //localhost:3000//api/v1/rewards?campaign_id=string HTTP/1.1
    Host: null
    
    Accept: application/json
    Authorization: string
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    $.ajax({
      url: '//localhost:3000//api/v1/rewards',
      method: 'get',
      data: '?campaign_id=string',
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    fetch('//localhost:3000//api/v1/rewards?campaign_id=string',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'string'
    }
    
    result = RestClient.get '//localhost:3000//api/v1/rewards',
      params: {
      'campaign_id' => 'string'
    }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'string'
    }
    
    r = requests.get('//localhost:3000//api/v1/rewards', params={
      'campaign_id': 'string'
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("//localhost:3000//api/v1/rewards?campaign_id=string");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "Authorization": []string{"string"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "//localhost:3000//api/v1/rewards", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/v1/rewards

    Rewards list information

    Return all rewards

    Parameters

    Parameter In Type Required Description
    Authorization header string true Valid Api Key
    campaign_id query string true ID of the campaign
    type query string false Reward type, pending or reward
    referrer_id query string false ID of the referrer
    referrer_token query string false Token of the referrer
    referrer_email query string false Email of the referrer
    page query integer(int32) false Page for pagination (default is 1)
    per_page query integer(int32) false Per page for pagination (default is 10)

    Example responses

    [
      {
        "id": 0,
        "awarded": true,
        "referrer": {
          "id": 0,
          "token": 0,
          "email": 0
        }
      }
    ]
    

    Responses

    Status Meaning Description Schema
    200 OK Return all rewards Inline

    Response Schema

    Status Code 200

    Name Type Required Description
    anonymous [Reward] false No description
    » id integer(int32) false ID of the reward.
    » awarded boolean false Defines is reward pending or fulfilled.
    » referrer Referrer false Return all referrers
    »» id integer(int32) false ID of the referrer.
    »» token integer(int32) false Unique Token of the referrer.
    »» email integer(int32) false Email of the referrer.

    getReward

    Code samples

    # You can also use wget
    curl -X GET //localhost:3000//api/v1/rewards/{id}?campaign_id=0 \
      -H 'Accept: application/json' \
      -H 'Authorization: string'
    
    
    GET //localhost:3000//api/v1/rewards/{id}?campaign_id=0 HTTP/1.1
    Host: null
    
    Accept: application/json
    Authorization: string
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    $.ajax({
      url: '//localhost:3000//api/v1/rewards/{id}',
      method: 'get',
      data: '?campaign_id=0',
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    fetch('//localhost:3000//api/v1/rewards/{id}?campaign_id=0',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'string'
    }
    
    result = RestClient.get '//localhost:3000//api/v1/rewards/{id}',
      params: {
      'campaign_id' => 'integer(int32)'
    }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'string'
    }
    
    r = requests.get('//localhost:3000//api/v1/rewards/{id}', params={
      'campaign_id': '0'
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("//localhost:3000//api/v1/rewards/{id}?campaign_id=0");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "Authorization": []string{"string"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "//localhost:3000//api/v1/rewards/{id}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/v1/rewards/{id}

    Reward details information

    Return a reward

    Parameters

    Parameter In Type Required Description
    Authorization header string true Valid Api Key
    campaign_id query integer(int32) true ID of the campaign
    id path integer(int32) true ID of the reward

    Example responses

    {
      "id": 0,
      "awarded": true,
      "referral_ip": "string",
      "referral_email": "string",
      "referral_stripe_id": "string",
      "referral_generated": 0,
      "amount": 0,
      "created_at": "string",
      "updated_at": "string",
      "referrer": {
        "id": 0,
        "token": 0,
        "email": 0
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Return a reward RewardDetails

    getRewardsTotal

    Code samples

    # You can also use wget
    curl -X GET //localhost:3000//api/v1/rewards/total?campaign_id=0 \
      -H 'Accept: application/json' \
      -H 'Authorization: string'
    
    
    GET //localhost:3000//api/v1/rewards/total?campaign_id=0 HTTP/1.1
    Host: null
    
    Accept: application/json
    Authorization: string
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    $.ajax({
      url: '//localhost:3000//api/v1/rewards/total',
      method: 'get',
      data: '?campaign_id=0',
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    fetch('//localhost:3000//api/v1/rewards/total?campaign_id=0',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'string'
    }
    
    result = RestClient.get '//localhost:3000//api/v1/rewards/total',
      params: {
      'campaign_id' => 'integer(int32)'
    }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'string'
    }
    
    r = requests.get('//localhost:3000//api/v1/rewards/total', params={
      'campaign_id': '0'
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("//localhost:3000//api/v1/rewards/total?campaign_id=0");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "Authorization": []string{"string"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "//localhost:3000//api/v1/rewards/total", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/v1/rewards/total

    Get total information scoped to campaign or referrer about number of rewards and amounts

    Return rewards total

    Parameters

    Parameter In Type Required Description
    Authorization header string true Valid Api Key
    campaign_id query integer(int32) true ID of the campaign
    referrer_id query string false ID of the referrer
    referrer_token query string false Token of the referrer
    referrer_email query string false Email of the referrer

    Example responses

    {
      "total_rewards": 0,
      "pending_rewards": 0,
      "fulfilled_rewards": 0,
      "total_amount": 0,
      "total_pending": 0,
      "total_paid": 0
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Return rewards total CampaignTotal

    dismissReward

    Code samples

    # You can also use wget
    curl -X PATCH //localhost:3000//api/v1/rewards/{id}/dismiss \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      -H 'Authorization: string'
    
    
    PATCH //localhost:3000//api/v1/rewards/{id}/dismiss HTTP/1.1
    Host: null
    Content-Type: application/x-www-form-urlencoded
    
    Authorization: string
    
    
    var headers = {
      'Content-Type':'application/x-www-form-urlencoded',
      'Authorization':'string'
    
    };
    
    $.ajax({
      url: '//localhost:3000//api/v1/rewards/{id}/dismiss',
      method: 'patch',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const request = require('node-fetch');
    const inputBody = '{
      "campaign_id": 0
    }';
    const headers = {
      'Content-Type':'application/x-www-form-urlencoded',
      'Authorization':'string'
    
    };
    
    fetch('//localhost:3000//api/v1/rewards/{id}/dismiss',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/x-www-form-urlencoded',
      'Authorization' => 'string'
    }
    
    result = RestClient.patch '//localhost:3000//api/v1/rewards/{id}/dismiss',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': 'string'
    }
    
    r = requests.patch('//localhost:3000//api/v1/rewards/{id}/dismiss', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("//localhost:3000//api/v1/rewards/{id}/dismiss");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("PATCH");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/x-www-form-urlencoded"},
            "Authorization": []string{"string"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("PATCH", "//localhost:3000//api/v1/rewards/{id}/dismiss", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    PATCH /api/v1/rewards/{id}/dismiss

    Dismiss reward by ID

    Dismiss reward

    Body parameter

    campaign_id: 0
    
    

    Parameters

    Parameter In Type Required Description
    Authorization header string true Valid Api Key
    id path integer(int32) true ID of the reward
    campaign_id body integer(int32) true ID of the campaign

    Responses

    Status Meaning Description Schema
    200 OK Dismiss reward None

    fulfillReward

    Code samples

    # You can also use wget
    curl -X PATCH //localhost:3000//api/v1/rewards/{id}/fulfill \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      -H 'Authorization: string'
    
    
    PATCH //localhost:3000//api/v1/rewards/{id}/fulfill HTTP/1.1
    Host: null
    Content-Type: application/x-www-form-urlencoded
    
    Authorization: string
    
    
    var headers = {
      'Content-Type':'application/x-www-form-urlencoded',
      'Authorization':'string'
    
    };
    
    $.ajax({
      url: '//localhost:3000//api/v1/rewards/{id}/fulfill',
      method: 'patch',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const request = require('node-fetch');
    const inputBody = '{
      "campaign_id": 0
    }';
    const headers = {
      'Content-Type':'application/x-www-form-urlencoded',
      'Authorization':'string'
    
    };
    
    fetch('//localhost:3000//api/v1/rewards/{id}/fulfill',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/x-www-form-urlencoded',
      'Authorization' => 'string'
    }
    
    result = RestClient.patch '//localhost:3000//api/v1/rewards/{id}/fulfill',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': 'string'
    }
    
    r = requests.patch('//localhost:3000//api/v1/rewards/{id}/fulfill', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("//localhost:3000//api/v1/rewards/{id}/fulfill");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("PATCH");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/x-www-form-urlencoded"},
            "Authorization": []string{"string"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("PATCH", "//localhost:3000//api/v1/rewards/{id}/fulfill", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    PATCH /api/v1/rewards/{id}/fulfill

    Fulfill reward by ID

    Fulfill reward

    Body parameter

    campaign_id: 0
    
    

    Parameters

    Parameter In Type Required Description
    Authorization header string true Valid Api Key
    id path integer(int32) true ID of the reward
    campaign_id body integer(int32) true ID of the campaign

    Responses

    Status Meaning Description Schema
    200 OK Fulfill reward None

    referrers

    Operations about referrers

    deleteReferrer

    Code samples

    # You can also use wget
    curl -X DELETE //localhost:3000//api/v1/referrers?campaign_id=0 \
      -H 'Authorization: string'
    
    
    DELETE //localhost:3000//api/v1/referrers?campaign_id=0 HTTP/1.1
    Host: null
    
    Authorization: string
    
    
    var headers = {
      'Authorization':'string'
    
    };
    
    $.ajax({
      url: '//localhost:3000//api/v1/referrers',
      method: 'delete',
      data: '?campaign_id=0',
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const request = require('node-fetch');
    
    const headers = {
      'Authorization':'string'
    
    };
    
    fetch('//localhost:3000//api/v1/referrers?campaign_id=0',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Authorization' => 'string'
    }
    
    result = RestClient.delete '//localhost:3000//api/v1/referrers',
      params: {
      'campaign_id' => 'integer(int32)'
    }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Authorization': 'string'
    }
    
    r = requests.delete('//localhost:3000//api/v1/referrers', params={
      'campaign_id': '0'
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("//localhost:3000//api/v1/referrers?campaign_id=0");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("DELETE");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Authorization": []string{"string"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("DELETE", "//localhost:3000//api/v1/referrers", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    DELETE /api/v1/referrers

    Delete referrer by one of the identifiers

    Delete referrer from campaign

    Parameters

    Parameter In Type Required Description
    Authorization header string true Valid Api Key
    campaign_id query integer(int32) true ID of the campaign
    referrer_id query integer(int32) false ID of the referrer
    referrer_token query string false Token of the referrer
    referrer_email query string false Email of the referrer

    Responses

    Status Meaning Description Schema
    204 No Content Delete referrer from campaign None

    createReferrers

    Code samples

    # You can also use wget
    curl -X POST //localhost:3000//api/v1/referrers \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      -H 'Accept: application/json' \
      -H 'Authorization: string'
    
    
    POST //localhost:3000//api/v1/referrers HTTP/1.1
    Host: null
    Content-Type: application/x-www-form-urlencoded
    Accept: application/json
    Authorization: string
    
    
    var headers = {
      'Content-Type':'application/x-www-form-urlencoded',
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    $.ajax({
      url: '//localhost:3000//api/v1/referrers',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const request = require('node-fetch');
    const inputBody = '{
      "campaign_id": 0,
      "emails": "string"
    }';
    const headers = {
      'Content-Type':'application/x-www-form-urlencoded',
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    fetch('//localhost:3000//api/v1/referrers',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/x-www-form-urlencoded',
      'Accept' => 'application/json',
      'Authorization' => 'string'
    }
    
    result = RestClient.post '//localhost:3000//api/v1/referrers',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Accept': 'application/json',
      'Authorization': 'string'
    }
    
    r = requests.post('//localhost:3000//api/v1/referrers', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("//localhost:3000//api/v1/referrers");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("POST");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/x-www-form-urlencoded"},
            "Accept": []string{"application/json"},
            "Authorization": []string{"string"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "//localhost:3000//api/v1/referrers", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /api/v1/referrers

    Create referrers from space separated emails

    Create referrers for campaign

    Body parameter

    campaign_id: 0
    emails: string
    
    

    Parameters

    Parameter In Type Required Description
    Authorization header string true Valid Api Key
    campaign_id body integer(int32) true ID of the campaign
    emails body string true Emails of new referrers, splitted with space

    Example responses

    {
      "id": 0,
      "token": 0,
      "email": 0
    }
    

    Responses

    Status Meaning Description Schema
    201 Created Create referrers for campaign Referrer

    getReferrers

    Code samples

    # You can also use wget
    curl -X GET //localhost:3000//api/v1/referrers?campaign_id=0 \
      -H 'Accept: application/json' \
      -H 'Authorization: string'
    
    
    GET //localhost:3000//api/v1/referrers?campaign_id=0 HTTP/1.1
    Host: null
    
    Accept: application/json
    Authorization: string
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    $.ajax({
      url: '//localhost:3000//api/v1/referrers',
      method: 'get',
      data: '?campaign_id=0',
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    fetch('//localhost:3000//api/v1/referrers?campaign_id=0',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'string'
    }
    
    result = RestClient.get '//localhost:3000//api/v1/referrers',
      params: {
      'campaign_id' => 'integer(int32)'
    }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'string'
    }
    
    r = requests.get('//localhost:3000//api/v1/referrers', params={
      'campaign_id': '0'
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("//localhost:3000//api/v1/referrers?campaign_id=0");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "Authorization": []string{"string"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "//localhost:3000//api/v1/referrers", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/v1/referrers

    Referrers list information

    Return all referrers

    Parameters

    Parameter In Type Required Description
    Authorization header string true Valid Api Key
    campaign_id query integer(int32) true ID of the campaign
    page query integer(int32) false Page for pagination (default is 1)
    per_page query integer(int32) false Per page for pagination (default is 10)

    Example responses

    [
      {
        "id": 0,
        "token": 0,
        "email": 0
      }
    ]
    

    Responses

    Status Meaning Description Schema
    200 OK Return all referrers Inline

    Response Schema

    Status Code 200

    Name Type Required Description
    anonymous [Referrer] false No description
    » id integer(int32) false ID of the referrer.
    » token integer(int32) false Unique Token of the referrer.
    » email integer(int32) false Email of the referrer.

    getReferrer

    Code samples

    # You can also use wget
    curl -X GET //localhost:3000//api/v1/referrers/details?campaign_id=0 \
      -H 'Accept: application/json' \
      -H 'Authorization: string'
    
    
    GET //localhost:3000//api/v1/referrers/details?campaign_id=0 HTTP/1.1
    Host: null
    
    Accept: application/json
    Authorization: string
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    $.ajax({
      url: '//localhost:3000//api/v1/referrers/details',
      method: 'get',
      data: '?campaign_id=0',
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'string'
    
    };
    
    fetch('//localhost:3000//api/v1/referrers/details?campaign_id=0',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'string'
    }
    
    result = RestClient.get '//localhost:3000//api/v1/referrers/details',
      params: {
      'campaign_id' => 'integer(int32)'
    }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'string'
    }
    
    r = requests.get('//localhost:3000//api/v1/referrers/details', params={
      'campaign_id': '0'
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("//localhost:3000//api/v1/referrers/details?campaign_id=0");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "Authorization": []string{"string"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "//localhost:3000//api/v1/referrers/details", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/v1/referrers/details

    Referrer details information

    Return a referrer details

    Parameters

    Parameter In Type Required Description
    Authorization header string true Valid Api Key
    campaign_id query integer(int32) true ID of the campaign
    referrer_id query integer(int32) false ID of the referrer
    referrer_token query string false Token of the referrer
    referrer_email query string false Email of the referrer

    Example responses

    {
      "id": 0,
      "token": 0,
      "email": 0,
      "total_rewards": 0,
      "pending_rewards": 0,
      "fulfilled_rewards": 0,
      "total_amount": 0,
      "total_pending": 0,
      "total_paid": 0
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Return a referrer details ReferrerDetails

    Schemas

    CampaignDetails

    {
      "id": 0,
      "name": 0,
      "url": "string",
      "type": "string",
      "title": "string",
      "subtitle": "string",
      "goal": {
        "event": "string",
        "reward_type": "string",
        "amount": 0,
        "amount_type": "string",
        "ongoing": true
      }
    }
    

    Return a campaign

    Properties

    Name Type Required Description
    id integer(int32) false ID of the campaign.
    name integer(int32) false ID of the campaign.
    url string false Url of the campaign - for which unique referrers url will be generated.
    type string false Type of the campaign - established or pre-launch.
    title string false Title of the campaign.
    subtitle string false Subtitle of the campaign.
    goal Goal false No description

    Goal

    {
      "event": "string",
      "reward_type": "string",
      "amount": 0,
      "amount_type": "string",
      "ongoing": true
    }
    

    Properties

    Name Type Required Description
    event string false Event for campaign - subscription, signup, custom.
    reward_type string false Reward type for campaign - cash, gift_card, custom.
    amount integer(int32) false Amount for campaign should be paid to referrers - based on amount_type.
    amount_type string false Amount type for campaign - constant, percent.
    ongoing boolean false Determines is reward should be created more then once.

    Campaign

    {
      "id": 0,
      "name": 0,
      "url": "string"
    }
    

    Return all campaigns

    Properties

    Name Type Required Description
    id integer(int32) false ID of the campaign.
    name integer(int32) false ID of the campaign.
    url string false Url of the campaig - for which unique referrers url will be generated.

    RewardDetails

    {
      "id": 0,
      "awarded": true,
      "referral_ip": "string",
      "referral_email": "string",
      "referral_stripe_id": "string",
      "referral_generated": 0,
      "amount": 0,
      "created_at": "string",
      "updated_at": "string",
      "referrer": {
        "id": 0,
        "token": 0,
        "email": 0
      }
    }
    

    Return a reward

    Properties

    Name Type Required Description
    id integer(int32) false ID of the reward.
    awarded boolean false Defines is reward pending or fulfilled.
    referral_ip string false IP of the user referred by the referrer.
    referral_email string false Email of the user referred by the referrer.
    referral_stripe_id string false Stripe UID of the user referred by the referrer.
    referral_generated integer(int32) false Amount paid by referred user.
    amount integer(int32) false Amount should be paid to referrer.
    created_at string false No description
    updated_at string false No description
    referrer Referrer false No description

    Referrer

    {
      "id": 0,
      "token": 0,
      "email": 0
    }
    

    Return all referrers

    Properties

    Name Type Required Description
    id integer(int32) false ID of the referrer.
    token integer(int32) false Unique Token of the referrer.
    email integer(int32) false Email of the referrer.

    CampaignTotal

    {
      "total_rewards": 0,
      "pending_rewards": 0,
      "fulfilled_rewards": 0,
      "total_amount": 0,
      "total_pending": 0,
      "total_paid": 0
    }
    

    Return rewards total

    Properties

    Name Type Required Description
    total_rewards integer(int32) false Sum of all rewards of the campaign.
    pending_rewards integer(int32) false Sum of all fulfilled rewards of the campaign.
    fulfilled_rewards integer(int32) false Sum of all pending rewards of the campaign.
    total_amount integer(int32) false Total amount of all rewards referrer payments.
    total_pending integer(int32) false Total amount of all pending rewards referrer payments.
    total_paid integer(int32) false Total amount of all fulfilled rewards referrer payments.

    Reward

    {
      "id": 0,
      "awarded": true,
      "referrer": {
        "id": 0,
        "token": 0,
        "email": 0
      }
    }
    

    Return all rewards

    Properties

    Name Type Required Description
    id integer(int32) false ID of the reward.
    awarded boolean false Defines is reward pending or fulfilled.
    referrer Referrer false No description

    ReferrerDetails

    {
      "id": 0,
      "token": 0,
      "email": 0,
      "total_rewards": 0,
      "pending_rewards": 0,
      "fulfilled_rewards": 0,
      "total_amount": 0,
      "total_pending": 0,
      "total_paid": 0
    }
    

    Return a referrer details

    Properties

    Name Type Required Description
    id integer(int32) false ID of the referrer.
    token integer(int32) false Unique Token of the referrer.
    email integer(int32) false Email of the referrer.
    total_rewards integer(int32) false Sum of all rewards of the referrer.
    pending_rewards integer(int32) false Sum of all fulfilled rewards of the referrer.
    fulfilled_rewards integer(int32) false Sum of all pending rewards of the referrer.
    total_amount integer(int32) false Total amount of all rewards referrer payments.
    total_pending integer(int32) false Total amount of all pending rewards referrer payments.
    total_paid integer(int32) false Total amount of all fulfilled rewards referrer payments.