Tag Methods

Use Cases

Get Contact Tags

Get tags sent to a contact with the given id.

GET https://api.bananatag.com/tags/contact/contactID
Query Parameters
Parameter Type Default Description
start string Return tags sent to contact after this date.
end string Return tags sent to contact before this date.
isClicked boolean false Only return clicked tags.
isUnclicked boolean false Only return unclicked tags.
isOpened boolean false Only return opened tags.
isUnopened boolean false Only return unopened tags.
rtn string json The format of the response "json", "text" or "html"
Response Parameters
Parameter Type Description
tagID string A tag id hash.
subject string The tag subject.
dateSent timestamp The date the tag was sent.
recipients array An array of recipient objects.
recipient . name string The recipient name.
recipient . email string The recipient email.
stats object A data object containing tag stats
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();

// build parameters to map
params.put("start", "2013-10-30");
params.put("end", "2013-11-30");

do {
    result = btag.request("tags/contact/21JJcT", 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 tag data
btag.request('tags/contact/21JJcT', {start : '2013-10-30', end : '2013-11-30'}, function (err, results) {
    console.log(results);
}
                                        
                                    
                                        
use Bananatag\Api;

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

// make request to get tag data
$results = $btag->request('tags/contact/21JJcT', [start => '2013-10-30', end => '2013-11-30']);

// 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 tag data
 data = btag.request('tags/contact/21JJcT', {start : '2013-10-30', end : '2013-11-30'})

 print data
                                         
                                     

Get Folder Tags

Get tag(s) from folder with the given id. The id endpoint can either be a folderID or folder name depending on the value of the type parameter.

GET https://api.bananatag.com/tags/folder/folderID || name
Query Parameters
Parameter Type Default Description
start string Return tags sent to contact after this date.
end string Return tags sent to contact before this date.
type string id Search for tags based on folder id or folder name.
isClicked boolean false Only return clicked tags.
isUnclicked boolean false Only return unclicked tags.
isOpened boolean> false Only return opened tags.
isUnopened boolean false Only return unopened tags.
rtn string json The format of the response "json", "text" or "html"
Response Parameters
Parameter Type Description
tagID string A tag id hash.
subject string The tag subject.
dateSent timestamp The date the tag was sent.
recipients array An array of recipient objects.
recipient . name string The recipient name.
recipient . email string The recipient email.
stats object A data object containing tag stats
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();

// build parameters to map
params.put("start", "2013-10-30");
params.put("end", "2013-11-30");

do {
    result = btag.request("tags/folder/eHtgqmp", 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 tag data
btag.request('tags/folder/eHtgqmp', {start : '2013-10-30', end : '2013-11-30', type : 'id'}, function (err, results) {
    console.log(results);
}
                                        
                                    
                                        
use Bananatag\Api;

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

// make request to get tag data
$results = $btag->request('tags/folder/eHtgqmp', [start => '2013-10-30', end => '2013-11-30', type => 'id']);

// 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 tag data
data = btag.request('tags/folder/eHtgqmp', {start : '2013-10-30', end : '2013-11-30', type : 'id'})

print data
                                         
                                     

Get Tag

Get tag(s) with the given id. The id endpoint can either be a tagID or subject line depending on the value of the type parameter.

GET https://api.bananatag.com/tags/tagID || subject
Query Parameters
Parameter Type Default Description
start string Return tags sent to contact after this date.
end string Return tags sent to contact before this date.
type string id Search for tags based on folder id or folder name.
isClicked boolean false Only return clicked tags.
isUnclicked boolean false Only return unclicked tags.
isOpened boolean> false Only return opened tags.
isUnopened boolean false Only return unopened tags.
rtn string json The format of the response "json", "text" or "html"
Response Parameters
Parameter Type Description
tagID string A tag id hash.
subject string The tag subject.
dateSent timestamp The date the tag was sent.
recipients array An array of recipient objects.
recipient . name string The recipient name.
recipient . email string The recipient email.
stats object A data object containing tag stats
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();

// build parameters to map
params.put("start", "2013-10-30");
params.put("end", "2013-11-30");

do {
    result = btag.request("tags/cBhtdcM", 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 tag data
btag.request('tags/cBhtdcM', {start : '2013-10-30', end : '2013-11-30'}, function (err, results) {
    console.log(results);
}
                                        
                                    
                                        
use Bananatag\Api;

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

// make request to get tag data
$results = $btag->request('tags/cBhtdcM', [start => '2013-10-30', end => '2013-11-30']);

// 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 tag data
data = btag.request('tags/cBhtdcM', {start : '2013-10-30', end : '2013-11-30'})

print data
                                         
                                     

Get Tags

Returns all user tags.

GET https://api.bananatag.com/tags
Query Parameters
Parameter Type Default Description
start string Return tags sent to contact after this date.
end string Return tags sent to contact before this date.
isClicked boolean false Only return clicked tags.
isUnclicked boolean false Only return unclicked tags.
isOpened boolean> false Only return opened tags.
isUnopened boolean false Only return unopened tags.
rtn string json The format of the response "json", "text" or "html"
Response Parameters
Parameter Type Description
tagID string A tag id hash.
subject string The tag subject.
dateSent timestamp The date the tag was sent.
recipients array An array of recipient objects.
recipient . name string The recipient name.
recipient . email string The recipient email.
stats object A data object containing tag stats
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();

// build parameters to map
params.put("start", "2013-10-30");
params.put("end", "2013-11-30");

do {
    result = btag.request("tags", 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 tag data
btag.request('tags', {start : '2013-10-30', end : '2013-11-30'}, function (user) {
    console.log(user);
}
                                        
                                    
                                        
use Bananatag\Api;

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

// make request to get tag data
$results = $btag->request('tags', [start => '2013-10-30', end => '2013-11-30']);

// print user 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 tag data
data = btag.request('tags', {start : '2013-10-30', end : '2013-11-30'})

print data