This page has sample code for :

  • Create footers for given personnel
  • Get footers for given personnel
  • Delete footers for given personnel

Above code wraps underlying API calls to create, delete, read footers . Please refer to here   for details about the group api.

Footers are what personnel and client see for every TEXT message received. There are three kind of footers based on entities that are being addressed in a particular TEXT message. These are client_footers , dealer_footers , supervisor_footers
/**
 * 
 */
package com.braango.virtualdealer.footers;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.braango.client.ApiCallback;
import com.braango.client.ApiClient;
import com.braango.client.ApiException;
import com.braango.client.braangoapi.FootersApi;
import com.braango.client.braangomodel.FootersInput;
import com.braango.client.braangomodel.FootersInputBody;
import com.braango.client.braangomodel.FootersOutputBodyData;
import com.braango.client.braangomodel.RequestHeader;
import com.braango.client.braangomodel.FootersOutput;

/**
 * @author braango
 * 
 *    Sample code showing how to add Footers for a personnel
 *
 */
public class CreateFooters {

	static String basePath = "https://testapi2.braango.com/v2/braango";

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		ApiClient braangoApiClient = new ApiClient();
		// TEST auth token. Please contact
		// sales@braango.com to have one
		// created for you
		String authToken = "ISNWF0P30WM0CMK";
		braangoApiClient.setBasePath(basePath);

		// Set the auth_token for api client to
		// interact with Braango system
		braangoApiClient.setApiKey(authToken);

		// Api key is authorization to to access
		// resources within braango system
		//
		// This key is different than auth_token
		// that is used to validate the master account

		String apiKey = "ISNfTMNOumV3xYNDd2g";

		// Create personnel api. Personnel is hosted by subDealer
		FootersApi footerApi = new FootersApi(braangoApiClient);
		
		final Boolean typeAdfCrmEmail = false;

		ApiCallback<FootersOutput> callBack = new ApiCallback<FootersOutput>() {

			@Override
			public void onUploadProgress(long bytesWritten, 
					long contentLength,
					boolean done) {

				System.out
						.println("Place holder for tracking"
								+ " request progress");

			}

			@Override
			public void onSuccess(FootersOutput result, int statusCode,
					Map<String, List<String>> responseHeaders) {

				FootersOutputBodyData FootersList = result.getBody()
						.getData();
				
				List<String> dealerFooters = FootersList.getDealerFooters();
				List<String> clientFooters = FootersList.getClientFooters();
				List<String> supervisorFooters =
						                     FootersList.getSupervisorFooters();
				
				System.out.println("Dealer Footers =  " + dealerFooters);
				System.out.println("Client Footers =  " + clientFooters);
				System.out.println("Supervisor Footers =  " + supervisorFooters);


			}

			@Override
			public void onFailure(ApiException e, int statusCode,
					Map<String, List<String>> responseHeaders) {
				System.out.println("Error is " + statusCode + " "
						+ e.getResponseBody());

			}

			@Override
			public void onDownloadProgress(long bytesRead, long contentLength,
					boolean done) {

			}
		};

		// PersonnelRequestInput wraps RequestHeader and personnelRequestBody
		FootersInput footersInput = new FootersInput();

		/*
		 * { "api_key": "ISNGvAzwuy4X7vAqrtV", "id": "any value",
		 * "account_type": "partner" }
		 */
		RequestHeader hdr = new RequestHeader();

		// Set the account type to partner for
		// virtual dealer and partner hosted
		// accounts

		hdr.setAccountType("partner");

		// dealer_api_key returned
		// when partner_dealer was created

		hdr.setApiKey(apiKey);

		// ID that will be reflected back
		hdr.setId("Footer-create-s1002r2");
		footersInput.setHeader(hdr);

		FootersInputBody body = new FootersInputBody();

		// Create Footers
		
		body.setDealerFooters(new ArrayList<String>());
		body.setClientFooters(new ArrayList<String>());
		body.setSupervisorFooters(new ArrayList<String>());
		
		body.addDealerFootersItem("s1002r2df1-Footers api \n\n");
		body.addClientFootersItem("s1002r2cf1-client api \n\n");
		body.addSupervisorFootersItem("s1002r2sf1-supervisor api \n\n");
		
		footersInput.setBody(body);


		try {
			String subDealerId = "subdealers1002";
			String salesPersonId = "0550c168-6117-45d5-a95f-e66593e6336b";
			footerApi.createFootersAsync(subDealerId, salesPersonId, footersInput, callBack);
		} catch (ApiException e1) {
			e1.printStackTrace();
		}
	}

}
/**
 * 
 */
package com.braango.virtualdealer.footers;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.braango.client.ApiCallback;
import com.braango.client.ApiClient;
import com.braango.client.ApiException;
import com.braango.client.braangoapi.FootersApi;
import com.braango.client.braangoapi.FootersApi;
import com.braango.client.braangomodel.FootersInput;
import com.braango.client.braangomodel.FootersInputBody;
import com.braango.client.braangomodel.FootersInputBody;
import com.braango.client.braangomodel.FootersOutput;
import com.braango.client.braangomodel.FootersOutputBodyData;
import com.braango.client.braangomodel.RequestHeader;
import com.braango.client.braangomodel.FootersOutput;

/**
 * @author braango
 * 
 *    Sample code showing how to get Footers for a personnel
 *
 */
public class GetFooters {

	static String basePath = "https://testapi2.braango.com/v2/braango";

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		ApiClient braangoApiClient = new ApiClient();
		// TEST auth token. Please contact
		// sales@braango.com to have one
		// created for you
		String authToken = "ISNWF0P30WM0CMK";
		braangoApiClient.setBasePath(basePath);

		// Set the auth_token for api client to
		// interact with Braango system
		braangoApiClient.setApiKey(authToken);

		// Api key is authorization to to access
		// resources within braango system
		//
		// This key is different than auth_token
		// that is used to validate the master account

		String apiKey = "ISNfTMNOumV3xYNDd2g";

		// Create personnel api. Personnel is hosted by subDealer
		FootersApi footerApi = new FootersApi(braangoApiClient);
		

		ApiCallback<FootersOutput> callBack = new ApiCallback<FootersOutput>() {

			@Override
			public void onUploadProgress(long bytesWritten, 
					long contentLength,
					boolean done) {

				System.out
						.println("Place holder for tracking"
								+ " request progress");

			}

			@Override
			public void onSuccess(FootersOutput result, int statusCode,
					Map<String, List<String>> responseHeaders) {

				FootersOutputBodyData footersList = result.getBody()
						.getData();
				
				List<String> dealerFooters = footersList.getDealerFooters();
				List<String> clientFooters = footersList.getClientFooters();
				List<String> supervisorFooters =
						                     footersList.getSupervisorFooters();
				
				System.out.println("Dealer Footers =  " + dealerFooters);
				System.out.println("Client Footers =  " + clientFooters);
				System.out.println("Supervisor Footers =  " + supervisorFooters);


			}

			@Override
			public void onFailure(ApiException e, int statusCode,
					Map<String, List<String>> responseHeaders) {
				System.out.println("Error is " + statusCode + " "
						+ e.getResponseBody());

			}

			@Override
			public void onDownloadProgress(long bytesRead, long contentLength,
					boolean done) {

			}
		};

	

		try {
			String subDealerId = "subdealers1002";
			String salesPersonId = "0550c168-6117-45d5-a95f-e66593e6336b";
			String accountType = "partner";
			String footerType = "client" ; // "dealer", "client", "supervisor"
			footerApi.getFootersAsync(subDealerId, salesPersonId,footerType, apiKey,accountType, callBack);
		} catch (ApiException e1) {
			e1.printStackTrace();
		}
	}

}


/**
 * @author braango
 * 
 *    Sample code showing how to delete footers for a personnel
 *
 */
public class DeleteFooters {

	static String basePath = "https://testapi2.braango.com/v2/braango";

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		ApiClient braangoApiClient = new ApiClient();
		// TEST auth token. Please contact
		// sales@braango.com to have one
		// created for you
		String authToken = "ISNWF0P30WM0CMK";
		braangoApiClient.setBasePath(basePath);

		// Set the auth_token for api client to
		// interact with Braango system
		braangoApiClient.setApiKey(authToken);

		// Api key is authorization to to access
		// resources within braango system
		//
		// This key is different than auth_token
		// that is used to validate the master account

		String apiKey = "ISNfTMNOumV3xYNDd2g";

		// Create personnel api. Personnel is hosted by subDealer
		FootersApi footerApi = new FootersApi(braangoApiClient);
		

		ApiCallback<FootersOutput> callBack = new ApiCallback<FootersOutput>() {

			@Override
			public void onUploadProgress(long bytesWritten, 
					long contentLength,
					boolean done) {

				System.out
						.println("Place holder for tracking"
								+ " request progress");

			}

			@Override
			public void onSuccess(FootersOutput result, int statusCode,
					Map<String, List<String>> responseHeaders) {

				FootersInputBody footersList = result.getBody()
						.getData();
				
				List<String> dealerFooters = footersList.getDealerFooters();
				List<String> clientFooters = footersList.getClientFooters();
				List<String> supervisorFooters =
						footersList.getSupervisorFooters();
				
				System.out.println("Dealer banners =  " + dealerFooters);
				System.out.println("Client banners =  " + clientFooters);
				System.out.println("Supervisor banners =  " + supervisorFooters);


			}

			@Override
			public void onFailure(ApiException e, int statusCode,
					Map<String, List<String>> responseHeaders) {
				System.out.println("Error is " + statusCode + " "
						+ e.getResponseBody());

			}

			@Override
			public void onDownloadProgress(long bytesRead, long contentLength,
					boolean done) {

			}
		};

	

		try {
			String subDealerId = "subdealers1002";
			String salesPersonId = "0550c168-6117-45d5-a95f-e66593e6336b";
			String accountType = "partner";
			String footerType = "dealer" ; // "dealer", "client", "supervisor"
			footerApi.deleteFootersAsync(subDealerId, salesPersonId,footerType, apiKey,accountType, callBack);
		} catch (ApiException e1) {
			e1.printStackTrace();
		}
	}

}
<?php
use Braango\braangomodel as model;
use Braango\braangomodel\RequestHeader as rhdr;
require_once (__DIR__ . '/../../vendor/autoload.php');

/**
 *
 * @author braango
 *        
 *         Sample code showing how to add Footers for a personnel
 *        
 */

// TEST auth token. Please contact
// sales@braango.com to have one
// created for you
Braango\Configuration::getDefaultConfiguration()->setApiKey('auth_token', 'ISNWF0P30WM0CMK');

$api_instance = new Braango\braangoapi\FootersApi();

// string | id of _sub_dealer_
$subdealerid = "subdealers2002";

// string | id of _personnel_
$salespersonid = "d1e5cb9c-def7-4273-85c7-46a1b5e46869";

// Braango\braangomodel\FootersInput |
$footersInput = new \Braango\braangomodel\FootersInput();

/*
 * { "api_key": "ISNGvAzwuy4X7vAqrtV", "id": "any value",
 * "account_type": "partner" }
 */
$hrd = new rhdr();

// dealer_api_key returned
// when partner_dealer was created
$hrd->setApiKey("ISNMdzuNiKG7jhl9d9v");

// Set the account type to partner for
// virtual dealer and partner hosted
// accounts
$hrd->setAccountType("partner");

// ID that will be reflected back

$hrd->setId("Footer-create-s1002");

$footersInput->setHeader($hrd);

$footersInputBody = new model\FootersInputBody();

// Create Banners

$footersInputBody->setClientFooters($clientFooters = array(
    "s2002cf1-client api"
));

$footersInputBody->setDealerFooters($dealerFooters = array(
    "s2002df1-dealer api"
));

$footersInputBody->setSupervisorFooters($supervisorFooters = array(
    "s2002sf1-supervisor api"
));

$footersInput->setBody($footersInputBody);

try {
    $result = $api_instance->createFooters($subdealerid, $salespersonid, $footersInput);
    
    if ($result != null) {
        // Extract out response hdr and bdy
        $rspHdr = $result->getHeader();
        
        if ($requestHdr = ! null) {
            $rspId = $rspHdr->getId();
            $braangoRequestId = $rspHdr->getIsnRequestId();
            print_r("Response ID = " . $rspId . ", API Request Id = " . $braangoRequestId . "\n");
        }
        
        $rspBdy = $result->getBody();
        if ($rspBdy != null) {
            $status = $rspBdy->getStatus();
            
            // Typically this value should be always SUCCESS else exception will be thrown
            // Sometimes, this can be WARNING to indicate if any resource conflicted or not
            // In case of SUCCESS or WARNING, resources are always created (excepting warned sub-resources)
            print_r("Status = " . $status . "\n");
            
            $footersOutPutBodyData = $rspBdy->getData();
            
            $footersDealer = $footersOutPutBodyData->getDealerFooters();
            $footersClient = $footersOutPutBodyData->getClientFooters();
            $footersSupervisor = $footersOutPutBodyData->getSupervisorFooters();
            
            // Prints the Client, Dealer, and Supervisor footers
            
            print "Dealer Footers = ";
            print_r($footersDealer);
            
            print "Client Footers = ";
            print_r($footersClient);
            
            print "Supervisor Footers = ";
            print_r($footersSupervisor);
        }
    }
} catch (Exception $e) {
    echo 'Exception when calling FootersApi->createFooters: ', $e->getMessage(), PHP_EOL;
}
?>
<?php
require_once (__DIR__ . '/../../vendor/autoload.php');

/**
 *
 * @author braango
 *        
 *         Sample code showing how to get Footers for a personnel
 *        
 */

// TEST auth token. Please contact
// sales@braango.com to have one
// created for you
Braango\Configuration::getDefaultConfiguration()->setApiKey('auth_token', 'ISNWF0P30WM0CMK');

$api_instance = new Braango\braangoapi\FootersApi();

// string | id of _sub_dealer_
$subdealerid = "subdealers2002";

// string | id of _personnel_
$salespersonid = "d1e5cb9c-def7-4273-85c7-46a1b5e46869";

// string | Footer type - `client` , `dealer` , `supervisor`
$footertype = "supervisor";

// string | API Key to access this dealer's resources.
// Value was returned when create_account api was called and dealer was created first time
$apiKey = "ISNMdzuNiKG7jhl9d9v";

// string | Dealer or partner is accessing this API
$accountType = "partner";
try {
    $result = $api_instance->getFooters($subdealerid, $salespersonid, $footertype, $apiKey, $accountType);
    if ($result != null) {
        // Extract out response hdr and bdy
        $rspHdr = $result->getHeader();
        
        if ($requestHdr = ! null) {
            $rspId = $rspHdr->getId();
            $braangoRequestId = $rspHdr->getIsnRequestId();
            print_r("Response ID = " . $rspId . ", API Request Id = " . $braangoRequestId . "\n");
        }
        
        $rspBdy = $result->getBody();
        if ($rspBdy != null) {
            
            $footersOutPutBodyData = $rspBdy->getData();
            
            $footersDealer = $footersOutPutBodyData->getDealerFooters();
            $footersClient = $footersOutPutBodyData->getClientFooters();
            $footersSupervisor = $footersOutPutBodyData->getSupervisorFooters();
            // Prints the Client, Dealer, and Supervisor footers
            if ($footertype == "dealer") {
                print "Dealer Footers = ";
                print_r($footersDealer);
            } else if ($footertype == "client") {
                print "Client Footers = ";
                print_r($footersClient);
            } else {
                print "Supervisor Footers = ";
                print_r($footersSupervisor);
            }
        }
    }
} catch (Exception $e) {
    echo 'Exception when calling FootersApi->getFooters: ', $e->getMessage(), PHP_EOL;
}
?>
<?php
require_once (__DIR__ . '/../../vendor/autoload.php');

/**
 *
 * @author braango
 *        
 *         Sample code showing how to delete footers for a personnel
 *        
 */

// TEST auth token. Please contact
// sales@braango.com to have one
// created for you
Braango\Configuration::getDefaultConfiguration()->setApiKey('auth_token', 'ISNWF0P30WM0CMK');

$api_instance = new Braango\braangoapi\FootersApi();

// string | id of _sub_dealer_
$subdealerid = "subdealers2002";

// string | id of _personnel_
$salespersonid = "d1e5cb9c-def7-4273-85c7-46a1b5e46869";

// string | Footer type - `client` , `dealer` , `supervisor`
$footertype = "client";

// string | API Key to access this dealer's resources. 
// Value was returned when create_account api was called and dealer was created first time
$apiKey = "ISNMdzuNiKG7jhl9d9v";

// string | Dealer or partner is accessing this API
$accountType = "partner";

try {
    $result = $api_instance->deleteFooters($subdealerid, $salespersonid, $footertype, $apiKey, $accountType);
    if ($result != null) {
        // Extract out response hdr and bdy
        $rspHdr = $result->getHeader();
        
        if ($requestHdr = ! null) {
            $rspId = $rspHdr->getId();
            $braangoRequestId = $rspHdr->getIsnRequestId();
            print_r("Response ID = " . $rspId . ", API Request Id = " . $braangoRequestId . "\n");
        }
        
        $rspBdy = $result->getBody();
        if ($rspBdy != null) {
            $status = $rspBdy->getStatus();
            
            // Typically this value should be always SUCCESS else exception will be thrown
            // Sometimes, this can be WARNING to indicate if any resource conflicted or not
            // In case of SUCCESS or WARNING, resources are always created (excepting warned sub-resources)
            print_r("Status = " . $status . "\n");
            
            $footersOutPutBodyData = $rspBdy->getData();
            
            $footersDealer = $footersOutPutBodyData->getDealerFooters();
            $footersClient = $footersOutPutBodyData->getClientFooters();
            $footersSupervisor = $footersOutPutBodyData->getSupervisorFooters();
            
            // Prints the Client, Dealer, and Supervisor footers
            if ($footertype == "dealer") {
                print "Dealer Footers = ";
                print_r($footersDealer);
            } else if ($footertype == "client") {
                print "Client Footers = ";
                print_r($footersClient);
            } else {
                print "Supervisor Footers = ";
                print_r($footersSupervisor);
            }
        }
    }
} catch (Exception $e) {
    echo 'Exception when calling FootersApi->deleteFooters: ', $e->getMessage(), PHP_EOL;
}
?>
Braango
CONTACT US
Unified customer engagement platform for inbound and outbound communications
Thank You. We will contact you as soon as possible.
PGlmcmFtZSB3aWR0aD0iNTYwIiBoZWlnaHQ9IjMxNSIgc3JjPSJodHRwczovL3d3dy55b3V0dWJlLmNvbS9lbWJlZC9sMVZqaUxUMUFKdyIgZnJhbWVib3JkZXI9IjAiIGFsbG93ZnVsbHNjcmVlbj48L2lmcmFtZT4=