Developer Documentation
BitcoTasks Integration Guide
Everything you need to integrate our offerwall, APIs, and S2S postback into your website or mobile app — in just a few minutes.
Before integrating, make sure you have a registered account on BitcoTasks. An account is required to generate your API Key, Secret Key, and Bearer Token.
Getting Started
Add your Website
To integrate our offerwall, you first need to register your website. Once done, you will receive an API Key and a Secret Key required for all integrations.
Integration
Integrate Offerwall
Our offerwall is segmented, auto-translated, and fully responsive. It adapts to any screen size and serves targeted offers to your users.
Before proceeding, make sure you have your API Key, Secret Key, and Bearer Token from your app's edit page.
Go to My Apps → Edit to get your full integration code and keys.
Website Integration
Embed the offerwall via JavaScript popup or iFrame — replace [API_KEY] and [USER_ID] with your actual values.
JavaScript (New Tab / Popup)
window.open("https://bitcotasks.com/offerwall/[API_KEY]/[USER_ID]")
iFrame Embed
<iframe
scrolling="yes"
frameborder="0"
style="width:100%;height:800px;border:0;"
src="https://bitcotasks.com/offerwall/[API_KEY]/[USER_ID]">
</iframe>
Replace [API_KEY] with your website API key and [USER_ID] with the unique identifier of the user currently viewing the wall.
PTC API Integration NEW
Fetch PTC campaign data directly and render it with your own UI. Useful when you want a fully custom look and feel.
Endpoint
curl -X GET https://bitcotasks.com/api/[API_KEY]/[USER_ID]/[USER_IP] \
-H "Authorization: Bearer [BEARER_TOKEN]"
JSON Response
{
"status": "200",
"message": "success",
"data": [
{
"id": "8098",
"image": "",
"title": "Free spin, win BTC! Up to 5 BTC daily!",
"description": "760% deposit bonus! Earn While Playing!",
"duration": "30",
"reward": "600.00",
"currency_name": "Cash",
"url": "https://bitcotasks.com/view/...",
"boosted_campaign": false,
"ad_type": "Iframe"
}
]
}
PHP Example
function requestWithFileGetContents($url, $token) {
$userAgent = $_SERVER['HTTP_USER_AGENT'] ?? 'Unknown';
$options = [
'http' => [
'header' => "Authorization: Bearer $token\r\nUser-UA: $userAgent\r\n",
]
];
return file_get_contents($url, false, stream_context_create($options));
}
function requestWithCurl($url, $token) {
$userAgent = $_SERVER['HTTP_USER_AGENT'] ?? 'Unknown';
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $token",
"User-UA: $userAgent"
],
]);
$response = curl_exec($ch);
if (curl_errno($ch)) $response = false;
curl_close($ch);
return $response;
}
$url = 'https://bitcotasks.com/api/[API_KEY]/[USER_ID]/[USER_IP]';
$token = '[BEARER_TOKEN]';
$response = requestWithFileGetContents($url, $token) ?: requestWithCurl($url, $token);
if ($response) {
$data = json_decode($response, true);
if (isset($data['status']) && $data['status'] == 200) {
foreach ($data['data'] as $ptc) {
echo $ptc['title'] . " — " . $ptc['reward'] . "\n";
}
} else {
echo $data['message'];
}
} else {
echo "Request Failed";
}
Shortlink API Integration NEW
Fetch shortlink campaigns directly from our API to display them in your own UI.
Endpoint
curl -X GET https://bitcotasks.com/sl-api/[API_KEY]/[USER_ID]/[USER_IP] \
-H "Authorization: Bearer [BEARER_TOKEN]"
JSON Response
{
"status": "200",
"message": "success",
"data": [
{
"id": "1",
"title": "earnow.online",
"reward": "600.00",
"currency_name": "Cash",
"completion_rate": "100.00",
"available": "2",
"limit": "2",
"url": "https://bitcotasks.com/start/...",
"boosted_campaign": false
}
]
}
PHP Example
$url = 'https://bitcotasks.com/sl-api/[API_KEY]/[USER_ID]/[USER_IP]';
$token = '[BEARER_TOKEN]';
$response = requestWithFileGetContents($url, $token) ?: requestWithCurl($url, $token);
if ($response) {
$data = json_decode($response, true);
if (isset($data['status']) && $data['status'] == 200) {
foreach ($data['data'] as $shortlink) {
echo $shortlink['title'] . " — " . $shortlink['reward'] . "\n";
}
} else {
echo $data['message'];
}
} else {
echo "Request Failed";
}
Read Article API Integration NEW
Fetch Read Article campaigns directly from our API to display them in your own UI.
Endpoint
curl -X GET https://bitcotasks.com/ra-api/[API_KEY]/[USER_ID]/[USER_IP] \
-H "Authorization: Bearer [BEARER_TOKEN]"
JSON Response
{
"status": "200",
"message": "success",
"data": [
{
"id": "1",
"title": "Read Article 1",
"reward": "600.00",
"currency_name": "Cash",
"available": "2",
"limit": "2",
"url": "https://bitcotasks.com/read-article/..."
}
]
}
PHP Example
$url = 'https://bitcotasks.com/ra-api/[API_KEY]/[USER_ID]/[USER_IP]';
$token = '[BEARER_TOKEN]';
$response = requestWithFileGetContents($url, $token) ?: requestWithCurl($url, $token);
if ($response) {
$data = json_decode($response, true);
if (isset($data['status']) && $data['status'] == 200) {
foreach ($data['data'] as $article) {
echo $article['title'] . " — " . $article['reward'] . "\n";
}
} else {
echo $data['message'];
}
} else {
echo "Request Failed";
}
Replace [API_KEY] with your API key, [BEARER_TOKEN] with your bearer token (generate it from Edit App), [USER_IP] with the user's IP, and [USER_ID] with the user's unique identifier.
Android Integration
Open the offerwall in Chrome or embed it in a WebView inside your Android app.
Offerwall URL
https://bitcotasks.com/offerwall/[API_KEY]/[USER_ID]
WebView Example
WebView myWebView = new WebView(activityContext);
setContentView(myWebView);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.loadUrl("https://bitcotasks.com/offerwall/[API_KEY]/[USER_ID]");
iOS Integration
Open the offerwall in Safari or use WKWebView inside your iOS app.
Swift / WKWebView Example
import UIKit
import WebKit
class ViewController: UIViewController, WKUIDelegate {
var webView: WKWebView!
override func loadView() {
let webConfiguration = WKWebViewConfiguration()
webView = WKWebView(frame: .zero, configuration: webConfiguration)
webView.uiDelegate = self
view = webView
}
override func viewDidLoad() {
super.viewDidLoad()
let myURL = URL(string: "https://bitcotasks.com/offerwall/[API_KEY]/[USER_ID]")
webView.load(URLRequest(url: myURL!))
}
}
React Native
Use the Linking API to open in the system browser, or embed with react-native-webview.
import { Linking } from 'react-native';
Linking.openURL('https://bitcotasks.com/offerwall/[API_KEY]/[USER_ID]');
// Install: yarn add react-native-webview
// or: npm install --save react-native-webview
// or (Expo): npx expo install react-native-webview
import { WebView } from 'react-native-webview';
export default function OfferwallScreen() {
return (
<WebView
source={{ uri: 'https://bitcotasks.com/offerwall/[API_KEY]/[USER_ID]' }}
/>
);
}
Offerwall Parameters
| Parameter | Description | Type |
|---|---|---|
[API_KEY] | Unique API code provided when you registered your website | varchar(32) |
[USER_ID] | Unique identifier of the user viewing the wall on your site | varchar(32) |
[USER_IP] | IP address of the user (for API endpoints) | string |
[BEARER_TOKEN] | Authorization token for API access, generated in Edit App | string |
Faucet Scripts
Integration on Faucet Scripts
We provide ready-made integration guides for the most popular faucet scripts. Follow the steps for your specific platform below.
VieFaucet 4.3 Integration
Three steps to integrate the BitcoTasks offerwall into VieFaucet 4.3.
Step 1 — Open application/controllers/wh.php and add this before the last closing bracket (}):
Enter your Secret Key under the $secret variable. Without it, postback will not credit users correctly.
public function bitcotasks()
{
$secret = ""; // YOUR SECRET KEY
$hold = 3; // Hold days (0 = instant)
$minHold = 0.5; // Rewards below this are not held
$userId = isset($_REQUEST['subId']) ? $this->db->escape_str($_REQUEST['subId']) : null;
$transactionId = isset($_REQUEST['transId']) ? $this->db->escape_str($_REQUEST['transId']) : null;
$reward = isset($_REQUEST['reward']) ? $this->db->escape_str($_REQUEST['reward']) : null;
$action = isset($_REQUEST['status']) ? $this->db->escape_str($_REQUEST['status']) : null;
$userIp = isset($_REQUEST['userIp']) ? $this->db->escape_str($_REQUEST['userIp']) : "0.0.0.0";
$signature = isset($_REQUEST['signature']) ? $this->db->escape_str($_REQUEST['signature']) : null;
if (md5($userId . $transactionId . $reward . $secret) != $signature) {
echo "ERROR: Signature doesn't match";
return;
}
$reward = $reward * $this->data['settings']['currency_rate'];
$trans = $this->m_offerwall->getTransaction($transactionId, 'bitcotasks');
if ($action == 2) {
$this->m_offerwall->reduceUserBalance($userId, abs($reward));
$this->m_offerwall->insertTransaction($userId, 'BitcoTasks', $userIp, $reward, $transactionId, 1, time());
echo "ok";
} else {
if (!$trans) {
$hold = ($reward > $minHold) ? 3 : 0;
if ($hold == 0) {
$offerId = $this->m_offerwall->insertTransaction($userId, 'BitcoTasks', $userIp, $reward, $transactionId, 2, time());
$this->m_offerwall->updateUserBalance($userId, $reward);
$this->m_core->addNotification($userId, currency($reward, $this->data['settings']['currency_rate']) . " from BitcoTasks Offer #$offerId was credited.", 1);
$user = $this->m_core->get_user_from_id($userId);
$this->m_core->addExp($user['id'], $this->data['settings']['offerwall_exp_reward']);
if (($user['exp'] + $this->data['settings']['offerwall_exp_reward']) >= ($user['level'] + 1) * 100) {
$this->m_core->levelUp($user['id']);
}
} else {
$availableAt = time() + $hold * 86400;
$offerId = $this->m_offerwall->insertTransaction($userId, 'BitcoTasks', $userIp, $reward, $transactionId, 0, $availableAt);
$this->m_core->addNotification($userId, "Your BitcoTasks Offer #$offerId is pending approval.", 0);
}
echo "ok";
} else {
echo "DUP";
}
}
}
Step 2 — Open application/controllers/offerwall.php and add before the last }:
public function bitcotasks()
{
$api_key = ""; // YOUR API KEY
$this->data['page'] = 'BitcoTasks Offerwall';
$this->data['iframe'] = '<iframe style="width:100%;height:800px;border:0;" scrolling="yes" frameborder="0"
src="https://bitcotasks.com/offerwall/' . $api_key . '/' . $this->data['user']['id'] . '"></iframe>';
$this->data['wait'] = 3; // Hold days
$this->render('offerwall', $this->data);
}
Step 3 — Add a menu link in application/views/user_template/template.php:
<li><a href="<?= site_url('offerwall/bitcotasks') ?>" key="t-bitcotasks">BitcoTasks</a></li>
Step 4 — Open Application/Config/config.php, find $config['csrf_exclude_uris'] and add:
'wh/bitcotasks',
Set your Postback URL in BitcoTasks dashboard to: https://yourdomain.com/wh/bitcotasks
VieFaucet 4.4 Integration
Integration for VieFaucet 4.4 follows the same steps as 4.3 with a minor difference in the notification helper function name.
Step 1 — Open application/controllers/wh.php and add this function:
public function bitcotasks()
{
$secret = ""; // YOUR SECRET KEY
$hold = 3;
$minHold = 0.5;
$userId = isset($_REQUEST['subId']) ? $this->db->escape_str($_REQUEST['subId']) : null;
$transactionId = isset($_REQUEST['transId']) ? $this->db->escape_str($_REQUEST['transId']) : null;
$reward = isset($_REQUEST['reward']) ? $this->db->escape_str($_REQUEST['reward']) : null;
$action = isset($_REQUEST['status']) ? $this->db->escape_str($_REQUEST['status']) : null;
$userIp = isset($_REQUEST['userIp']) ? $this->db->escape_str($_REQUEST['userIp']) : "0.0.0.0";
$signature = isset($_REQUEST['signature']) ? $this->db->escape_str($_REQUEST['signature']) : null;
if (md5($userId . $transactionId . $reward . $secret) != $signature) {
echo "ERROR: Signature doesn't match";
return;
}
$reward = $reward * $this->data['settings']['currency_rate'];
$trans = $this->m_offerwall->getTransaction($transactionId, 'BitcoTasks');
if ($action == 2) {
$this->m_offerwall->reduceUserBalance($userId, abs($reward));
$this->m_offerwall->insertTransaction($userId, 'BitcoTasks', $userIp, $reward, $transactionId, 1, time());
echo "ok";
} else {
if (!$trans) {
$hold = ($reward > $minHold) ? 3 : 0;
if ($hold == 0) {
$offerId = $this->m_offerwall->insertTransaction($userId, 'BitcoTasks', $userIp, $reward, $transactionId, 2, time());
$this->m_offerwall->updateUserBalance($userId, $reward);
// Note: 4.4 uses currencyDisplay() instead of currency()
$this->m_core->addNotification($userId, currencyDisplay($reward, $this->data['settings']) . " from BitcoTasks Offer #$offerId was credited.", 1);
$user = $this->m_core->getUserFromId($userId);
$this->m_core->addExp($user['id'], $this->data['settings']['offerwall_exp_reward']);
if (($user['exp'] + $this->data['settings']['offerwall_exp_reward']) >= ($user['level'] + 1) * 100) {
$this->m_core->levelUp($user['id']);
}
} else {
$availableAt = time() + $hold * 86400;
$offerId = $this->m_offerwall->insertTransaction($userId, 'BitcoTasks', $userIp, $reward, $transactionId, 0, $availableAt);
$this->m_core->addNotification($userId, "Your BitcoTasks Offer #$offerId is pending approval.", 0);
}
echo "ok";
} else {
echo "DUP";
}
}
}
Steps 2, 3 & 4 — Identical to VieFaucet 4.3. See the section above.
Postback URL: https://yourdomain.com/wh/bitcotasks
CryptoFaucet / ClaimBits Integration
Create one file and modify two lines — under 5 minutes.
Create the file system/gateways/bitcotasks.php with the following content:
<?php
define('BASEPATH', true);
require('../init.php');
$secret = "YOUR_SECRET_KEY";
$userId = isset($_REQUEST['subId']) ? $_REQUEST['subId'] : null;
$transId = isset($_REQUEST['transId']) ? $_REQUEST['transId'] : null;
$reward = isset($_REQUEST['reward']) ? $_REQUEST['reward'] : null;
$status = isset($_REQUEST['status']) ? $_REQUEST['status'] : null;
$signature = isset($_REQUEST['signature']) ? $_REQUEST['signature'] : null;
$userIp = isset($_REQUEST['userIp']) ? $_REQUEST['userIp'] : "0.0.0.0";
if (md5($userId . $transId . $reward . $secret) != $signature) {
echo "ERROR: Signature doesn't match";
exit;
}
if ($status == 2) {
// Chargeback — subtract reward
// Your chargeback logic here
} else {
// Credit reward to user
// Your crediting logic here
}
echo "ok";
Currency must be set to credits in your app settings.
Postback URL: http://yourdomain.com/system/gateways/bitcotasks.php
S2S Postback
Server-to-Server Postback
Whenever a user completes an offer, BitcoTasks sends an HTTP POST request to your Postback URL with all the information needed to credit your users automatically.
Postback Parameters
| Parameter | Description | Example |
|---|---|---|
subId | Unique identifier of the user on your platform | user123 |
transId | Unique transaction ID — use this to prevent double-crediting | XX-12345678 |
offer_name | Name of the completed offer | BitcoTasks - Register and Earn |
offer_type | Type of offer (ptc, offer, task, shortlink) | ptc |
reward | Amount of virtual currency to credit | 1.25 |
reward_name | Your currency name as set in app settings | Points |
reward_value | Units of your currency per $1 USD (exchange rate) | 1000.00 |
payout | USD payout value of the offer | 0.100000 |
userIp | User's IP address at time of completion | 192.168.1.0 |
country | User's country in ISO2 format | US |
status | 1 = credit 2 = chargeback | 1 |
debug | Whether this is a test postback | 1 (test) / 0 (live) |
signature | MD5 hash for signature verification | 17b4e2a70d6efe9796dd4c5507a9f9ab |
reward and payout are always absolute values. Use the status field to determine whether to add or subtract.
Postback Security
Always verify the signature parameter to confirm the postback originates from BitcoTasks servers. The signature is computed as:
IPs to whitelist
We will be sending the postbacks from any of the following IP addresses. Please make sure they are whitelisted if needed to be in your server.
45.14.135.48md5($subId . $transId . $reward . $secretKey)
You can find your Secret Key in the My Apps section of your dashboard.
<?php
$secret = ""; // Your Secret Key from BitcoTasks
$subId = $_REQUEST['subId'] ?? null;
$transId = $_REQUEST['transId'] ?? null;
$reward = $_REQUEST['reward'] ?? null;
$signature = $_REQUEST['signature'] ?? null;
if (md5($subId . $transId . $reward . $secret) !== $signature) {
echo "ERROR: Signature doesn't match";
exit;
}
?>
Our servers wait up to 60 seconds for a response before marking the postback as failed. Always check the transId against your database to prevent duplicate credits.
Respond to Postback
Your endpoint must respond with exactly ok (lowercase, no extra whitespace). If it doesn't, the postback will be marked as failed — even if processing was successful — and you will need to resend it manually.
echo "ok"; // Required — must be the only output
Full Postback Example
<?php
$secret = ""; // Your Secret Key
// Optional: restrict to BitcoTasks IP addresses
$allowed_ips = ['1.2.3.4', '5.6.7.8']; // Replace with real IPs from (IPs to whitelist Section)
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'] ?? $_SERVER['REMOTE_ADDR'];
if (!in_array($ip, $allowed_ips)) {
echo "ERROR: Invalid source";
exit;
}
// Read postback parameters
$userId = $_REQUEST['subId'] ?? null;
$transId = $_REQUEST['transId'] ?? null;
$reward = $_REQUEST['reward'] ?? null;
$rewardName = $_REQUEST['reward_name'] ?? null;
$offerName = $_REQUEST['offer_name'] ?? null;
$offerType = $_REQUEST['offer_type'] ?? null;
$payout = $_REQUEST['payout'] ?? null;
$userIp = $_REQUEST['userIp'] ?? "0.0.0.0";
$country = $_REQUEST['country'] ?? null;
$status = $_REQUEST['status'] ?? null;
$signature = $_REQUEST['signature'] ?? null;
// Validate signature
if (md5($userId . $transId . $reward . $secret) !== $signature) {
echo "ERROR: Signature doesn't match";
exit;
}
// Handle chargeback
if ($status == 2) {
$reward = -abs($reward);
}
// Prevent duplicates — check if transaction already exists
if (isNewTransaction($transId)) {
processTransaction($userId, $reward, $transId);
}
// else: already processed, skip silently
echo "ok"; // Important!
?>
Changelog
Publisher Updates
- Games added (more coming soon)
- PTC earning increased by 25–50%
- Faucet Claims added: 4 intervals (10/30/60/90 min) with 16 daily claims each
- Chargebacks tab added for offers
- Resend all postbacks button added for shortlinks and PTC
- New offerwalls added: Timewall, Bitlabs, Monlix, AdsPenny
- Paid to Promote (PTP) campaigns added
- Control which features appear in the offerwall
- New 3rd-party offers and surveys added
- Shortlinks generation fixed
- Shortlinks fake views fixed
- IPQualityScore fraud detection added
- App approval/rejection email notifications added
- Publisher dashboard redesigned for faster load times
- Detailed stats (1 day / 7 days / 30 days) with graphs added
- Payments Proofs section added
- Read/Surf Article added to Offerwall menu
- More info added to Advertiser Dashboard
- PTC API added
- PTC API integration docs added
- OfferWall fraud fixes
- Separate stats for API PTC
- New security system against fraud
- Promoted Links (PTP) stats page load improved
- PTP estimated daily visits per IP added
- Banner publishing added — request access via My Apps
- Supported dimensions: 728×90, 468×60, 300×250, 300×100, 160×600, 300×600, adaptive
- CPM: $0.15 (unique) / $0.015 (10 daily). CPC: $0.005 (unique) / $0.0005
- Detailed banner stats added
- ChatBot / Support AI added
- Google Login/Register added
- Major & minor bug fixes
- PopUp publishing added — $0.50 CPM, configurable frequency
- New games added — 10× daily, $0.001 per reward
- New captcha system (faster and easier)
- Major & minor bug fixes
- Banner Fallback (show your own banner when no ads available)
- New design for HomePage, Login, Register, and User Dashboard
Advertiser Updates
- Tasks (CPA/CPC) advertising added
- Task approval workflow, categories, image upload, dispute system
- Shortlinks advertising via API added
- Adblocker & bot protection added
- Campaign Booster added (PTC $1/day, Task $1.5/day, Shortlink $2/day)
- New Tab / Window PTC option (+10% price)
- Task & Shortlink editing enabled
- All campaigns now require admin approval before going live
- Campaign approval/rejection notifications via email
- Advertiser dashboard redesigned for speed
- Detailed stats (1/7/30 days) added
- Rejection reason system added
- PTC campaign editing enabled (Title, Description, Geo, URL)
- Advertise the same shortlink up to 3 times simultaneously
- Coinbase removed; Direct Deposit with 50+ cryptocurrencies added (min $0.01)
- Push Notifications advertising added — $0.0001/view, $0.001/click
- Russia (RU) traffic toggle for shortlinks
- Banner advertising added (728×90, 468×60, 300×250, 300×100, 160×600, 300×600)
- CPM: $0.30 (unique) / $0.03. CPC: $0.01 (unique) / $0.001
- HTML banner generator added
- Geo-targeting and device targeting for banners
- Pause any campaign added
- Estimated views for PTC, Shortlinks, Banners added
- PopUp advertising added — $1 CPM, shown across 100+ crypto websites
- Captcha required after completing advertising campaigns
Earner Updates
- New offerwall design
- Earning history tab with filters and search
- Task approval rate system (ban if below 20%)
- Task rejection reasons and dispute option
- Photo upload for task submission proof
- New 3rd-party offers and surveys added
- Direct work on gainbtc.click with 80% revshare
- IPQualityScore proxy/VPN/fraud detection added
- Read/Surf Article added to Offerwall menu
- Read Article views limit increased to 10 per blog
- Surf time between posts reduced to 15s
- Read Article reward: $0.003
- IP change firewall added
- New games added — 10×/day at $0.0001/play
- New captcha system deployed
- Bug fixes