NAV Navbar
Shell HTTP JavaScript Node.JS Ruby Python Java Go
  • SalesCamp V1 API v0.0.2
  • Authentication
  • campaigns
  • rewards
  • referrers
  • site_checks
  • 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.

    Base URLs:

    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'
    
    
    GET /localhost:3000/api/v1/campaigns/{id} HTTP/1.1
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: '/localhost:3000/api/v1/campaigns/{id}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    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'
    }
    
    result = RestClient.get '/localhost:3000/api/v1/campaigns/{id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    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"},
    
        }
    
        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

    Name In Type Required Description
    id path string true ID of the campaign

    Example responses

    200 Response

    {
      "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'
    
    
    GET /localhost:3000/api/v1/campaigns HTTP/1.1
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: '/localhost:3000/api/v1/campaigns',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    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'
    }
    
    result = RestClient.get '/localhost:3000/api/v1/campaigns',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    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"},
    
        }
    
        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

    Name In Type Required Description
    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

    200 Response

    [
      {
        "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 Restrictions Description
    anonymous [Campaign] false none [Return all campaigns]
    » id integer(int32) false none ID of the campaign.
    » name integer(int32) false none ID of the campaign.
    » url string false none 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'
    
    
    POST /localhost:3000/api/v1/rewards HTTP/1.1
    
    Content-Type: application/x-www-form-urlencoded
    Accept: application/json
    
    
    var headers = {
      'Content-Type':'application/x-www-form-urlencoded',
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: '/localhost:3000/api/v1/rewards',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = 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'
    
    };
    
    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'
    }
    
    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'
    }
    
    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"},
    
        }
    
        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

    Name In Type Required Description
    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 paid

    Example responses

    201 Response

    {
      "id": 0,
      "campaign_id": 0,
      "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'
    
    
    GET /localhost:3000/api/v1/rewards?campaign_id=string HTTP/1.1
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: '/localhost:3000/api/v1/rewards',
      method: 'get',
      data: '?campaign_id=string',
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    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'
    }
    
    result = RestClient.get '/localhost:3000/api/v1/rewards',
      params: {
      'campaign_id' => 'string'
    }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    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"},
    
        }
    
        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

    Name In Type Required Description
    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

    200 Response

    [
      {
        "id": 0,
        "status": 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 Restrictions Description
    anonymous [Reward] false none [Return all rewards]
    » id integer(int32) false none ID of the reward.
    » status boolean false none Status.
    » referrer Referrer false none Return all referrers
    »» id integer(int32) false none ID of the referrer.
    »» token integer(int32) false none Unique Token of the referrer.
    »» email integer(int32) false none 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'
    
    
    GET /localhost:3000/api/v1/rewards/{id}?campaign_id=0 HTTP/1.1
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.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 fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    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'
    }
    
    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'
    }
    
    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"},
    
        }
    
        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

    Name In Type Required Description
    campaign_id query integer(int32) true ID of the campaign
    id path integer(int32) true ID of the reward

    Example responses

    200 Response

    {
      "id": 0,
      "campaign_id": 0,
      "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'
    
    
    GET /localhost:3000/api/v1/rewards/total?campaign_id=0 HTTP/1.1
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.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 fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    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'
    }
    
    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'
    }
    
    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"},
    
        }
    
        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

    Name In Type Required Description
    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

    200 Response

    {
      "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'
    
    
    PATCH /localhost:3000/api/v1/rewards/{id}/dismiss HTTP/1.1
    
    Content-Type: application/x-www-form-urlencoded
    
    
    var headers = {
      'Content-Type':'application/x-www-form-urlencoded'
    
    };
    
    $.ajax({
      url: '/localhost:3000/api/v1/rewards/{id}/dismiss',
      method: 'patch',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "campaign_id": 0
    }';
    const headers = {
      'Content-Type':'application/x-www-form-urlencoded'
    
    };
    
    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'
    }
    
    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'
    }
    
    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"},
    
        }
    
        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

    Name In Type Required Description
    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'
    
    
    PATCH /localhost:3000/api/v1/rewards/{id}/fulfill HTTP/1.1
    
    Content-Type: application/x-www-form-urlencoded
    
    
    var headers = {
      'Content-Type':'application/x-www-form-urlencoded'
    
    };
    
    $.ajax({
      url: '/localhost:3000/api/v1/rewards/{id}/fulfill',
      method: 'patch',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "campaign_id": 0
    }';
    const headers = {
      'Content-Type':'application/x-www-form-urlencoded'
    
    };
    
    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'
    }
    
    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'
    }
    
    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"},
    
        }
    
        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

    Name In Type Required Description
    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
    
    
    DELETE /localhost:3000/api/v1/referrers?campaign_id=0 HTTP/1.1
    
    
    
    $.ajax({
      url: '/localhost:3000/api/v1/referrers',
      method: 'delete',
      data: '?campaign_id=0',
    
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    fetch('/localhost:3000/api/v1/referrers?campaign_id=0',
    {
      method: 'DELETE'
    
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    result = RestClient.delete '/localhost:3000/api/v1/referrers',
      params: {
      'campaign_id' => 'integer(int32)'
    }
    
    p JSON.parse(result)
    
    
    import requests
    
    r = requests.delete('/localhost:3000/api/v1/referrers', params={
      'campaign_id': '0'
    )
    
    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() {
    
        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

    Name In Type Required Description
    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'
    
    
    POST /localhost:3000/api/v1/referrers HTTP/1.1
    
    Content-Type: application/x-www-form-urlencoded
    Accept: application/json
    
    
    var headers = {
      'Content-Type':'application/x-www-form-urlencoded',
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: '/localhost:3000/api/v1/referrers',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "campaign_id": 0,
      "emails": "string"
    }';
    const headers = {
      'Content-Type':'application/x-www-form-urlencoded',
      'Accept':'application/json'
    
    };
    
    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'
    }
    
    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'
    }
    
    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"},
    
        }
    
        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

    Name In Type Required Description
    campaign_id body integer(int32) true ID of the campaign
    emails body string true Emails of new referrers, splitted with space

    Example responses

    201 Response

    {
      "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'
    
    
    GET /localhost:3000/api/v1/referrers?campaign_id=0 HTTP/1.1
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: '/localhost:3000/api/v1/referrers',
      method: 'get',
      data: '?campaign_id=0',
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    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'
    }
    
    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'
    }
    
    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"},
    
        }
    
        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

    Name In Type Required Description
    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

    200 Response

    [
      {
        "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 Restrictions Description
    anonymous [Referrer] false none [Return all referrers]
    » id integer(int32) false none ID of the referrer.
    » token integer(int32) false none Unique Token of the referrer.
    » email integer(int32) false none 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'
    
    
    GET /localhost:3000/api/v1/referrers/details?campaign_id=0 HTTP/1.1
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.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 fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    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'
    }
    
    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'
    }
    
    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"},
    
        }
    
        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

    Name In Type Required Description
    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

    200 Response

    {
      "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

    site_checks

    Operations about site_checks

    checkSite

    Code samples

    # You can also use wget
    curl -X GET /localhost:3000/api/v1/site_checks?url=string&pattern=string
    
    
    GET /localhost:3000/api/v1/site_checks?url=string&pattern=string HTTP/1.1
    
    
    
    $.ajax({
      url: '/localhost:3000/api/v1/site_checks',
      method: 'get',
      data: '?url=string&pattern=string',
    
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    fetch('/localhost:3000/api/v1/site_checks?url=string&pattern=string',
    {
      method: 'GET'
    
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    result = RestClient.get '/localhost:3000/api/v1/site_checks',
      params: {
      'url' => 'string',
    'pattern' => 'string'
    }
    
    p JSON.parse(result)
    
    
    import requests
    
    r = requests.get('/localhost:3000/api/v1/site_checks', params={
      'url': 'string',  'pattern': 'string'
    )
    
    print r.json()
    
    
    URL obj = new URL("/localhost:3000/api/v1/site_checks?url=string&pattern=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() {
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "/localhost:3000/api/v1/site_checks", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /api/v1/site_checks

    Download content from a URL, check for presence of specific text or pattern

    Parameters

    Name In Type Required Description
    url query string true URL to search
    pattern query string true pattern to search for

    Responses

    Status Meaning Description Schema
    200 OK Download content from a URL, check for presence of specific text or pattern None

    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 Restrictions Description
    id integer(int32) false none ID of the campaign.
    name integer(int32) false none ID of the campaign.
    url string false none Url of the campaign - for which unique referrers url will be generated.
    type string false none Type of the campaign - established or pre-launch.
    title string false none Title of the campaign.
    subtitle string false none Subtitle of the campaign.
    goal Goal false none none

    Goal

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

    Properties

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

    Campaign

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

    Return all campaigns

    Properties

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

    RewardDetails

    {
      "id": 0,
      "campaign_id": 0,
      "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 Restrictions Description
    id integer(int32) false none ID of the reward.
    campaign_id integer(int32) false none ID of the reward's campaign.
    referral_ip string false none IP of the user referred by the referrer.
    referral_email string false none Email of the user referred by the referrer.
    referral_stripe_id string false none Stripe UID of the user referred by the referrer.
    referral_generated integer(int32) false none Amount paid by referred user.
    amount integer(int32) false none Amount should be paid to referrer.
    created_at string false none none
    updated_at string false none none
    referrer Referrer false none Return all referrers

    Referrer

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

    Return all referrers

    Properties

    Name Type Required Restrictions Description
    id integer(int32) false none ID of the referrer.
    token integer(int32) false none Unique Token of the referrer.
    email integer(int32) false none 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 Restrictions Description
    total_rewards integer(int32) false none Sum of all rewards of the campaign.
    pending_rewards integer(int32) false none Sum of all fulfilled rewards of the campaign.
    fulfilled_rewards integer(int32) false none Sum of all pending rewards of the campaign.
    total_amount integer(int32) false none Total amount of all rewards referrer payments.
    total_pending integer(int32) false none Total amount of all pending rewards referrer payments.
    total_paid integer(int32) false none Total amount of all fulfilled rewards referrer payments.

    Reward

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

    Return all rewards

    Properties

    Name Type Required Restrictions Description
    id integer(int32) false none ID of the reward.
    status boolean false none Status.
    referrer Referrer false none Return all referrers

    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 Restrictions Description
    id integer(int32) false none ID of the referrer.
    token integer(int32) false none Unique Token of the referrer.
    email integer(int32) false none Email of the referrer.
    total_rewards integer(int32) false none Sum of all rewards of the referrer.
    pending_rewards integer(int32) false none Sum of all fulfilled rewards of the referrer.
    fulfilled_rewards integer(int32) false none Sum of all pending rewards of the referrer.
    total_amount integer(int32) false none Total amount of all rewards referrer payments.
    total_pending integer(int32) false none Total amount of all pending rewards referrer payments.
    total_paid integer(int32) false none Total amount of all fulfilled rewards referrer payments.