Contact Methods

Use Cases

Contacts

Get all contacts.

GET https://api.bananatag.com/contacts
Query Parameters
Parameter Type Default Description
rtn string json The format of the response "json", "text" or "html"
Response Parameters
Parameter Type Description
contactID string A contact id hash.
name string The contact name.
email string The contact email address
dateLastSent timestamp Datetime of last tag sent to contact.
stats object A stats object containing tag stats.
stats . totalSent integer The total number of tags sent to this contact.
stats . totalOpens integer The total number of opens for tags sent to this contact.
stats . uniqueOpens integer The total number of unique opens for tags sent to this contact.
stats . totalClicks integer The total number of clicks for tags sent to this contact.
stats . uniqueClicks integer The total number of unique clicks for tags sent to this contact.
stats . desktopOpens integer The total number of desktop opens for tags sent to this contact.
stats . mobileOpens integer The total number of mobile opens for tags sent to this contact.
stats . desktopClicks integer The total number of desktop clicks for tags sent to this contact.
stats . mobileClicks integer The total number of mobile clicks for tags sent to this contact.
Examples
                                        
import java.util.HashMap;
import java.util.concurrent.TimeUnit;
import org.json.simple.JSONObject;

// create BtagAPI class object using your AuthID and Access Key
BtagAPI btag = new BtagAPI("AuthID", "Access Key");
HashMap<String, Object> params = new HashMap<String, Object>();
JSONObject result = new JSONObject();

do {
    result = btag.request("contacts", params);
    System.out.println(result);
    TimeUnit.SECONDS.sleep(1);
} while (!result.isEmpty());
                                        
                                    
                                            
var BtagAPI = require('bananatag-api.js');

// create BtagAPI object using your AuthID and Access Key
var btag = new BTagAPI('AuthID', 'Access Key');

// Make request to get data
btag.request('contacts', {}, function (err, results) {
    console.log(results);
}
                                            
                                        
                                            
use Bananatag\Api;

// Create Api class instance
$btag = new Api('AuthID', 'Access Key');

// make request to get data
$results = $btag->request('contacts', []);

// print tag data
print_r($results);
                                            
                                        
                                             
# import BTagAPI class
from btapi.btapi import BTagAPI

# create BTagAPI object using your AuthID and Access Key
btag = BTagAPI('AuthID', 'Access Key')

# make request to get data
data = btag.request('contacts')

print data
                                             
                                         

Contact

Get contact with the given id.

GET https://api.bananatag.com/contacts/contactID
Query Parameters
Parameter Type Default Description
rtn string json The format of the response "json", "text" or "html"
Response Parameters
Parameter Type Description
contactID string A contact id hash.
name string The contact name.
email string The contact email address
dateLastSent timestamp Datetime of last tag sent to contact.
stats object A stats object containing tag stats.
stats . totalSent integer The total number of tags sent to this contact.
stats . totalOpens integer The total number of opens for tags sent to this contact.
stats . uniqueOpens integer The total number of unique opens for tags sent to this contact.
stats . totalClicks integer The total number of clicks for tags sent to this contact.
stats . uniqueClicks integer The total number of unique clicks for tags sent to this contact.
stats . desktopOpens integer The total number of desktop opens for tags sent to this contact.
stats . mobileOpens integer The total number of mobile opens for tags sent to this contact.
stats . desktopClicks integer The total number of desktop clicks for tags sent to this contact.
stats . mobileClicks integer The total number of mobile clicks for tags sent to this contact.
Examples
                                        
import java.util.HashMap;
import java.util.concurrent.TimeUnit;
import org.json.simple.JSONObject;

// create BtagAPI class object using your AuthID and Access Key
BtagAPI btag = new BtagAPI("AuthID", "Access Key");
HashMap<String, Object> params = new HashMap<String, Object>();
JSONObject result = new JSONObject();

do {
    result = btag.request("contacts/41JKcT", params);
    System.out.println(result);
    TimeUnit.SECONDS.sleep(1);
} while (!result.isEmpty());
                                        
                                    
                                            
var BtagAPI = require('bananatag-api.js');

// create BtagAPI object using your AuthID and Access Key
var btag = new BTagAPI('AuthID', 'Access Key');

// make request to get data
btag.request('contacts/41JKcT', {}, function (err, results) {
    console.log(results);
}
                                            
                                        
                                            
use Bananatag\Api;

// Create Api class instance
$btag = new Api('AuthID', 'Access Key');

// make request to get data
$results = $btag->request('contacts/41JKcT', []);

// print tag data
print_r($results);
                                            
                                        
                                             
# import BTagAPI class
from btapi.btapi import BTagAPI

# create BTagAPI object using your AuthID and Access Key
btag = BTagAPI('AuthID', 'Access Key')

# make request to get data
data = btag.request('contacts/41JKcT')

print data
                                             
                                         

Tag Contacts

Get contacts for tag with the given id.

GET https://api.bananatag.com/contacts/tag/tagID
Query Parameters
Parameter Type Default Description
rtn string json The format of the response "json", "text" or "html"
Response Parameters
Parameter Type Description
contactID string A contact id hash.
name string The contact name.
email string The contact email address
dateLastSent timestamp Datetime of last tag sent to contact.
stats object A stats object containing tag stats.
stats . totalSent integer The total number of tags sent to this contact.
stats . totalOpens integer The total number of opens for tags sent to this contact.
stats . uniqueOpens integer The total number of unique opens for tags sent to this contact.
stats . totalClicks integer The total number of clicks for tags sent to this contact.
stats . uniqueClicks integer The total number of unique clicks for tags sent to this contact.
stats . desktopOpens integer The total number of desktop opens for tags sent to this contact.
stats . mobileOpens integer The total number of mobile opens for tags sent to this contact.
stats . desktopClicks integer The total number of desktop clicks for tags sent to this contact.
stats . mobileClicks integer The total number of mobile clicks for tags sent to this contact.
Examples
                                        
import java.util.HashMap;
import java.util.concurrent.TimeUnit;
import org.json.simple.JSONObject;

// create BtagAPI class object using your AuthID and Access Key
BtagAPI btag = new BtagAPI("AuthID", "Access Key");
HashMap<String, Object> params = new HashMap<String, Object>();
JSONObject result = new JSONObject();

do {
    result = btag.request("contacts/tag/G5ht4s", params);
    System.out.println(result);
    TimeUnit.SECONDS.sleep(1);
} while (!result.isEmpty());
                                        
                                    
                                            
var BtagAPI = require('bananatag-api.js');

// create BtagAPI object using your AuthID and Access Key
var btag = new BTagAPI('AuthID', 'Access Key');

// make request to get data
btag.request('contacts/tag/G5ht4s', {}, function (err, results) {
    console.log(results);
}
                                            
                                        
                                            
use Bananatag\Api;

// Create Api class instance
$btag = new Api('AuthID', 'Access Key');

// make request to get data
$results = $btag->request('contacts/tag/G5ht4s', []);

// print tag data
print_r($results);
                                            
                                        
                                             
# import BTagAPI class
from btapi.btapi import BTagAPI

# create BTagAPI object using your AuthID and Access Key
btag = BTagAPI('AuthID', 'Access Key')

# make request to get data
data = btag.request('contacts/tag/G5ht4s')

print data