API Documentation

Getting Started #

What is RubiQube VideoPay™?

RubiQube VideoPay is a reward – based video advertising platform that drives engagement and monetization opportunities for online publishers, while delivering rewards to their end users and providing advertisers with engaged customers.

We provide an additional button for online users to pay by watching a 15 second video clip.

To integrate the RubiQube Reward Ads button to your service, you need to follow the steps below:

  • Create an Account and select Publisher option using your correct user details on http://track.therubiqube.com/signup.php?lang=en
  • Login with created credentials on http://track.therubiqube.com/
  • Upon success of Login, move on to CREATE APP – Creating App where you intend to place this Ad button.
  • After that, you CREATE A PLACEMENT – with Information of the exact point where you want this Ad button deployed on the App. Information such as Placement Name, Message to be written on the button, nature/genre of Ads to be shown and Callback URL to redirect users to upon receiving rewards.


  • Encourages streaming services or content users to stay active longer than they might have otherwise.
  • Incentivized Video Ads can be used to nudge non-paying users towards In-App-Purchases (IAPs).
  • Incentivized-view only, leading to informed clicks and high quality downloads.
  • Additional revenue from non paying users.

Web Snippet API

After you might have created the PLACEMENT it redirects you to a page where you click “GENERATE CODE” button. A modal popup would appear with a code snippet.

Copy the snippet generated for you on the system and paste at whatever point on the website you want the Ad Button to appear at. You can paste in a DIV or a TABLE layout with a custom design layout.

Generated Sample Snippet JS Code

var publisherID = '100000'; //Auto Insert your PUBLISHER ID here from publisher form.
var placementID = '1005'; //Auto Insert your AD PLACEMENT ID here from publisher form.
var callbackURL = 'http://www.therubiqube.com/sample_callback.php'; //Auto Insert your CALLBACK URL here from publisher form.
var message = 'Watch Ads to Earn'; //Auto Insert the MESSAGE on your button here from form.
var topcolorShade = '#2D2F2F'; // Auto insert the color shade for top part of button.
var bottomcolorShade = '#161719'; // Auto insert the color shade for bottom part of button.
document.write('<script src=\'http:\/\/store.therubiqube.com\/js\/reward.js\'><\/script>');

Once this is pasted, a button like the below appears

When this button is clicked, a modal popup appears and within it, shows the video Ad to play. See below image.

After Video Ad must have been watched, some unique data will be automatically parsed to the Callback URL provided. To receive these data from our servers, a sample code base for a callback URL is written in PHP for better understanding on how to receive data.

Sample Callback PHP Code

		$publisherID = $_GET['publisherID'];
		$placementID = $_GET['placementID'];
		$earnings = $_GET['earnings'];
		$adName = $_GET['adName'];
		$only_country = $_GET['only_country'];
		$userID; //Get the ID of user currently signed in.
		$reward_given; //Set reward to be issued to user. E.g Song Download, Free access to album. This can be linked to the existing access/download system
		//Check for convergence; if publisher and placement ID received from RubiQube is equal to the ID assigned to you.
		if ($publisherID == '1000005' || placementID ='1005'){
		//Do all things regarding rewards management. E.g below.
		//Connect to DB.
		$host="localhost"; // Host name.
		$db='spinlet_db'; // Database name.
		$conn=mysql_connect($host,$db_user,$db_password) or die (mysql_error());
		mysql_select_db($db) or die (mysql_error());
		//Insert into spinlet_reward table to register reward for unique users.
		$insert = "INSERT INTO spinlet_reward (userID,earnings,adName,country,reward_given) VALUES ('$userID','$earnings','$adName','$only_country', '$reward_given')";
		$insertresult = mysql_query($insert, $link) or die(mysql_error());
		echo "Reward has been issued to user as free music download";

NOTE: This is just a sample code base written in php for how a typical callback page should look like. Replace with proper codes that issues users rewards (like music downloads or free access to songs) when those data are received by your server.

The table below also itemizes all the data being sent and to be received and manipulated to issue rewards.



Sample Request Data


publisherID: publisherID is a unique ID assigned to a publisher. It is gotten after creating a placement and during code generation.

placementID: placementID is a unique ID for each placement created and also assigned to the button after creating a placement and during code generation.

callbackURL: callbackURL is the link where all reward management will be processed. It is filled in when creating a placement on the system.

Sample Response Data

		"adName":"New Add is created ",
		"browser":"Mozilla\/5.0 (Windows NT 6.1; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/49.0.2623.87 Safari\/537.36",
		"updateDBURL":"http:\/\/store.therubiqube.com\/VideoAlgo\/updateDBApi.php?id=9&bid=120&adUrl=uploads\/&ad_upload_video=http:\/\/track.therubiqube.com\/advertiser\/uploads\/motorola.mp4&placementID=1005&publisherID=1000005&earnings=64.8&adName=New Add is created &ip=\/5.0 (Windows NT 6.1; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/49.0.2623.87 Safari\/537.36&callbackURL=http:\/\/www.therubiqube.com\/sample_callback.php&only_country=Nigeria"

* ad_upload_video *: Very important variable. This is where you get the Link to the Video Ad itself

*updateDBURL*: This is the URL where a GET request is sent to update the Database on each video Ad impression. Below is the sample request data to be sent for a GET request.













Android SDK (Usage)

Include rubiqube sdk in your gradle dependency

Download and copy rubiqubesdk.aar file into your project’s libs folder

Download SDK here

Download Sample MainActivity.java code

 dependencies {
	compile (name: 'rubiqubesdk', ext:'aar')
	compile 'com.android.support:appcompat-v7:23.3.0' //IMPORTANT: Rubiqube sdk depends on this library to work
	compile 'com.loopj.android:android-async-http:1.4.9'    //IMPORTANT: Rubiqube sdk depends on this library to work

Initialize rubiqube sdk

import rubiqube.ng.rubiqubesdk.*;
	Ad rubiqube = Ad.getInstance();
	rubiqube.init(publisherID, placementID, callback_url);


(INT) publisherID (INT) placementID (STRING) callback_url

Get your publisher and placement IDs from RubiQube website, the callback url will be used to update your database.

Listen to RubiQube internal events

	  rubiqube.setOnAdListener( new Ad.OnAdListener(){
            public void onFinished(){
                Toast.makeText(getApplicationContext(), "YOU HAVE BEEN REWARDED 10G Points", Toast.LENGTH_LONG).show();
                Log.v("MAIN ACTIVITY", "VIDEO AD FINISHED");

            public void onInitError(){

                Toast.makeText(getApplicationContext(), "ADVERT VIDEO COULD NOT BE INITIALIZED", Toast.LENGTH_LONG).show();

            public void onInitSuccess(){
                //This is the right time to play the video Ad 
                Toast.makeText(getApplicationContext(), "VIDEO IS INITIALIZED", Toast.LENGTH_LONG).show();
                Log.v("MAIN ACTIVITY", "VIDEO IS INITIALIZED");


Play video Ad

    rubiqube.showVideo(_activity); //_activity is the current activity from which you wish to launch the video Ad
Yes No

Getting Started #

Getting Started #

RubiQube Eve © #

Technical Documentation – Eve SDK

Introduction: Eve is a location-based marketing tool that can be integrated into any app that requests permission of user’s location to send brand’s promotional offers.

Use Case: A user of Opera mini (with Eve SDK integrated) can work into a shopping mall/Cinema or club and get attractive discount offers sent to him if the user opts in to allow location tracking.

SDK lib Size: Eve SDK library for Android is 42 kilobytes (42kB) which was truly designed for lightweight integrations.

Methodology/Integration to app: There are 3 steps in integrating Eve SDK.

  1. Import Eve AAR library.
  2. Set permissions on Android manifest
  3. Add the code snippet in the respective parts on your app.

3rd party integrations: Our notification system is powered by Firebase, which is a very secure and robust platform and can also be plugged into any existing 3rd party notification service like Braze (formerly Appboy), Swrve, AppsFlyer or Urban Airship.

Privacy: Our technology respects users’ privacy and we take that as our number one priority. Our location tracking is an opt-in type system that only recognizes users who voluntarily allow access to their location. Once the app with Eve SDK integration is launched, it asks the user if he wants to enable location tracking and only then will he/she be tracked and be sent brand offers.

Conclusion: Eve is a secure and lightweight library with high ease of integration for any app development team. We have a straight to the point Integration manual that will get you started in under 5 minutes.

Integration Guide

  1. Import the arr file (locationlib-debug.aar) in project
  2. Add these permissions to xml
<uses-permission android:name="android.permission.INTERNET"/>

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  • Then you can use SDK methods below to add all the code related integrations

SDK Methods

1.        Get Notification on location change

Location is the user’s current location

List <NotiDto> l4 = new LocationController(this).getNotis(this,location);

2.      Save User

new LocationController(this).saveToken(this, “user_id”, “fcm_token”, “Name”, “email”);

3.      Get Notification on location change by User ID

Location is the user’s current location

List <NotiDto> l4 = new LocationController(this).getNotisByUserId (this, “user_id”);

4.      Add Notification

new LocationController(this).AddNotification(this,name_of_camapign,image_url,locationString,latitude,longitude,offer_details,userId);
Yes No

Integrating with QubeEx © #

Getting Started #