Prelauncher API

Overview

Our RESTful API easily integrates into whatever setup you have. We provide client libraries for various programming languages that allow you to more easily integrate with Prelauncher.

Client Libraries

Programming language Repository Primary Contributor
PHP https://github.com/Techofficer/php-prelauncher Techofficer

Credentials

Company ID and private key can be found in "Company/API" section of your Prelauncher dashboard.

Subscribers

JSON Schema

{
	"title": "Client",
	"type": "object",
	"properties": {
		"email": { "type": "string"},
		"ip_address": { "type": "string"},
		"referrer_id": { "type": "string"},
		"referral_url": { "type": "string"},
		"created_at": { "type": "string"},
		"referral_code": { "type": "string"},
		"number_of_referrals": { "type": "string"},
		"progress": { "type": "string"},
		"prize_id": { "type": "string"},
		"website_url": { "type": "string"},
		"traffic_source": { "type": "string"},
		"utm_campaign": { "type": "string"},
		"utm_medium": { "type": "string"},
		"utm_source": { "type": "string"},
		"name": { "type": "string"},
		"shipping_address": { "type": "string"},
		"telephone_number": { "type": "string"}
	},
	"required": ["email"]
}

Retrieve a subscriber

PHP Curl
> curl http://prelauncher.info/companies/:company_id/clients/:subscriber_referral_code  \  
-H "Authorization: Token token=private_api_key" \
-H "Accept: application/json" \
PHP Curl
require(__DIR__ . '/vendor/autoload.php');

\Httpful\Bootstrap::init();
\RESTful\Bootstrap::init();
\Prelauncher\Bootstrap::init();

Prelauncher\Settings::configure(:company_id, :private_api_key);

$subscriber = Prelauncher\Subscriber::get(:subscriber_referral_code);

List of subscribers

PHP Curl
> curl http://prelauncher.info/companies/:company_id/clients \  
-H "Authorization: Token token=private_api_key" \
-H "Accept: application/json" \
PHP Curl
require(__DIR__ . '/vendor/autoload.php');

\Httpful\Bootstrap::init();
\RESTful\Bootstrap::init();
\Prelauncher\Bootstrap::init();

Prelauncher\Settings::configure(:company_id, :private_api_key);

$subscribers = Prelauncher\Subscriber::all();

Create a subscriber

PHP Curl
> curl http://prelauncher.info/companies/:company_id/clients \  
-H "Authorization: Token token=:private_api_key" \
-H "Accept: application/json" \
-X POST
-d "client[email]=contact@techofficer.co"
-d "client[referrer_id]=12345"
-d "client[ip_address]=127.0.0.1"
PHP Curl
require(__DIR__ . '/vendor/autoload.php');

\Httpful\Bootstrap::init();
\RESTful\Bootstrap::init();
\Prelauncher\Bootstrap::init();

Prelauncher\Settings::configure(:company_id, :private_api_key);

$subscriber = Prelauncher\Subscriber::create(array("email"=>"contact@techofficer.co", "referrer_id"=>"12345", "ip_address"=> "27.0.0.1"))

Update a subsciber

PHP Curl
> curl http://prelauncher.info/companies/:company_id/clients/:subscriber_referral_code \  
-H "Authorization: Token token=:private_api_key" \
-H "Accept: application/json" 
-X PUT
-d "client[name]=John"
PHP Curl
require(__DIR__ . '/vendor/autoload.php');

\Httpful\Bootstrap::init();
\RESTful\Bootstrap::init();
\Prelauncher\Bootstrap::init();

Prelauncher\Settings::configure(:company_id, :private_api_key);

$subscriber = Prelauncher\Subscriber::get(:subscriber_referral_code);
$subscriber->email = "test@test.com";
$subscriber->save();

Delete a subsciber

PHP Curl
> curl http://prelauncher.info/companies/:company_id/clients/:subscriber_referral_code \  
-H "Authorization: Token token=:private_api_key" \
-H "Accept: application/json" 
-X DELETE
PHP Curl
require(__DIR__ . '/vendor/autoload.php');

\Httpful\Bootstrap::init();
\RESTful\Bootstrap::init();
\Prelauncher\Bootstrap::init();

Prelauncher\Settings::configure(:company_id, :private_api_key);

$subscriber = Prelauncher\Subscriber::get(:subscriber_referral_code);
$subscriber->unstore();

Prizes

JSON Schema

{
	"title": "Prize",
	"type": "object",
	"properties": {
		"id": { "type": "string"},
		"name": { "type": "string"},
		"number_of_referrals": { "type": "integer"},
		"number_of_winners": { "type": "integer"},
		"email_message": { "type": "string"},
		"created_at": { "type": "string"},
	},
	"required": ["name", "number_of_referrals"]
}

Retrieve a prize

PHP Curl
> curl http://prelauncher.info/companies/:company_id/prizes/:prize_id  \  
-H "Authorization: Token token=private_api_key" \
-H "Accept: application/json" \
PHP Curl
require(__DIR__ . '/vendor/autoload.php');

\Httpful\Bootstrap::init();
\RESTful\Bootstrap::init();
\Prelauncher\Bootstrap::init();

Prelauncher\Settings::configure(:company_id, :private_api_key);

$prize = Prelauncher\Prize::get(:prize_id);

List of prizes

PHP Curl
> curl http://prelauncher.info/companies/:company_id/prizes \  
-H "Authorization: Token token=private_api_key" \
-H "Accept: application/json" \
PHP Curl
require(__DIR__ . '/vendor/autoload.php');

\Httpful\Bootstrap::init();
\RESTful\Bootstrap::init();
\Prelauncher\Bootstrap::init();

Prelauncher\Settings::configure(:company_id, :private_api_key);

$prizes = Prelauncher\Prize::all();

Create a prize

PHP Curl
> curl http://prelauncher.info/companies/:company_id/prizes \  
-H "Authorization: Token token=:private_api_key" \
-H "Accept: application/json" \
-X POST
-d "client[name]=awesome prizes"
-d "client[number_of_referrals]=5"
PHP Curl
require(__DIR__ . '/vendor/autoload.php');

\Httpful\Bootstrap::init();
\RESTful\Bootstrap::init();
\Prelauncher\Bootstrap::init();

Prelauncher\Settings::configure(:company_id, :private_api_key);

$prize = Prelauncher\Prize::::create(array("name"=>"awesome prizes", "number_of_referrals"=>5));

Update a prize

PHP Curl
> curl http://prelauncher.info/companies/:company_id/prizes/:prize_id \  
-H "Authorization: Token token=:private_api_key" \
-H "Accept: application/json" 
-X PUT
-d "client[name]=Small gift"
PHP Curl
require(__DIR__ . '/vendor/autoload.php');

\Httpful\Bootstrap::init();
\RESTful\Bootstrap::init();
\Prelauncher\Bootstrap::init();

Prelauncher\Settings::configure(:company_id, :private_api_key);

$prize = Prelauncher\Prize::get(:prize_id);
$subscriber->name = "Small gift";
$subscriber->save();

Delete a prize

PHP Curl
> curl http://prelauncher.info/companies/:company_id/prizes/:prize_id \  
-H "Authorization: Token token=:private_api_key" \
-H "Accept: application/json" 
-X DELETE
PHP Curl
require(__DIR__ . '/vendor/autoload.php');

\Httpful\Bootstrap::init();
\RESTful\Bootstrap::init();
\Prelauncher\Bootstrap::init();

Prelauncher\Settings::configure(:company_id, :private_api_key);

$prize = Prelauncher\Prize::get(:prize_id);
$prize->unstore();