API Documentation

The Starloop API is organized around REST. Our API accepts form-encoded requests, returns JSON-encoded responses, and uses standard HTTP response codes.

You can use the Starloop API in test mode, which does not affect your live data and doesn't count for your monthly invite count or actually sends the invites, an response code will be returned accordingly. For testing purposes and no invites are sent.


Base URL

https://go.starloop.com/api


Authentication

The Starloop API uses API keys to authenticate requests. You can view and manage your API keys in the Starloop Dashboard Settings.

To use the API in test mode set the key -test_mode=true

Authentication to the API is performed via -token key

Your API key carry many privileges, so be sure to keep it secure! Do not share your secret API key in publicly accessible areas such as GitHub, client-side code, and so forth.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.


Getting Started

In order to send invites you need a business id or a profile id.

Using the business id will direct your customer to a list of all your profiles, given you have multiple profile locations and its up to the end user to select which location he visited before he choses where he pretends to write the review for, useful if you don't know from which location the customer comes from or only have single location.

Using the specific profile id your customer will be directed to the final step to chose where to write the review, if you have multiple locations is advised to direct your customer to the profile id instead of using business id.

Use the endpoint GET /list_ids to get a list of ids usable for your account to send invites.


Response Codes

200 - OK Everything worked as expected.
400 - Bad Request The request was unacceptable, often due to missing a required parameter.
401 - Unauthorized No valid API key provided.
402 - Request Failed The parameters were valid but the request failed.
403 - Forbidden The API key doesn't have permissions to perform the request.
404 - Not Found The requested resource doesn't exist.
500, 502, 503, 504 - Server Errors Something went wrong on our end.

On an error response the key -error_msg with a more specific error description.

All HTTPS responses will return code 200 unless its and 500 error code, response codes can be found in response key -status


List ID’s

POST /list_ids

Returns your business ID and a list of all profile ID’s and names


Parameters

-token (string | required)


Example (PHP)

Get your business ID and complete list of location profile ID’s

<?php  

$url = "https://go.starloop.com/api/list_ids";  

$curl = curl_init($url); 
curl_setopt($curl, CURLOPT_URL, $url); 
curl_setopt($curl, CURLOPT_POST, true); 
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);  
$headers = array("Accept: application/json", "Content-Type: application/x-www-form-urlencoded", ); 
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);


$data = ['token' => STARLOOP_API_KEY ];  
$params = http_build_query($data); 
curl_setopt($curl, CURLOPT_POSTFIELDS, $params);  

//for debug only! 
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); 
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);  

$resp = curl_exec($curl); 
curl_close($curl); 
var_dump($resp);

Returns
{   
   'status' : 200,   
   'business_id' : 8,   
   'profile_ids' : [     
       {       
           'id' : 57,       
           'name' : 'Profile 1'     
       },     
       {       
           'id' : 357,       
           'name' : 'Profile 2'     
       }   
   ] 
}


Send Invite (Single)

POST /send_invite

Creates a new recipient and sents an Starloop invite (Email | SMS | both) to your customer to leave a review.

-email or -phone are required fields or both can be provided to send both an email and/or SMS invite.

-business_id or -profile_id Only one of those key fields can be provided in order to send the invite.

-test_mode if false by default, turning test mode to true will prevent the invites from being sent.


Parameters

-token (string | required)

-first_name (string | required)

-email (string)

-phone (string)

-business_id (integer | optional)

-profile_id (integer | optional)

-test_mode (boolean | optional)

Example (CURL PHP)

Send a test invite request.

<?php

$url = "https://go.starloop.com/api/list_ids";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$headers = array("Accept: application/json",     "Content-Type: application/x-www-form-urlencoded",);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

$data = [
    'token' => STARLOOP_API_KEY,     
    'first_name' => CUSTOMER_FIRST_NAME,     
    'email' => 'CUSTOMER_EMAIL',     
    'business_id' => YOUR_BUSINESS_ID,     
    'test_mode' => true
];
$params = http_build_query($data);
curl_setopt($curl, CURLOPT_POSTFIELDS, $params);

//for debug only! 
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);
Returns

{'status' : 200, 'error_msg' : 'Invite queued to send now.'}


Still need help? Contact Us Contact Us