This page has sample code for :
- Add supervisor for a personnel for a given group
- Delete supervisor for a personnel for a given group
- Delete all supervisor for a personnel
- Get supervisor for a personnel for a given group
- List all supervisors for a personnel
Each of the sample code reflect the low level api calls
Supervisor is a personnel that can monitor voice calls and TEXT messages, can also interject for TEXT messages. To add supervisor, that personnel needs to exist in the system. A personnel can have many supervisors per group and supervisors can monitor many personnel. Plus supervisor need not be subscribed to the group for personnel that he or she is monitoring
/**
*
*/
package com.braango.virtualdealer.supervisors;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.braango.client.ApiCallback;
import com.braango.client.ApiClient;
import com.braango.client.ApiException;
import com.braango.client.braangoapi.EmailsApi;
import com.braango.client.braangoapi.GroupsApi;
import com.braango.client.braangoapi.SupervisorsApi;
import com.braango.client.braangomodel.EmailOutputBodyData;
import com.braango.client.braangomodel.GroupInput;
import com.braango.client.braangomodel.GroupInputBody;
import com.braango.client.braangomodel.GroupOutput;
import com.braango.client.braangomodel.GroupOutputBodyData;
import com.braango.client.braangomodel.RequestHeader;
import com.braango.client.braangomodel.EmailInput;
import com.braango.client.braangomodel.EmailInputBody;
import com.braango.client.braangomodel.EmailOutput;
import com.braango.client.braangomodel.SupervisorInput;
import com.braango.client.braangomodel.SupervisorInputBody;
import com.braango.client.braangomodel.SupervisorOutput;
import com.braango.client.braangomodel.SupervisorOutputBodyData;
/**
* @author braango
*
* Sample code showing how to add supervisor
* for personnel for given group
*
* Note supervisor is another
* personnel within the system
*
* Both personnel i.e. supervisor
* and personnel to be supervised
* need to exist in the system
*
*/
public class AddSupervisor {
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
SupervisorsApi supervisorApi = new SupervisorsApi(braangoApiClient);
ApiCallback<SupervisorOutput> callBack = new ApiCallback<SupervisorOutput>() {
@Override
public void onUploadProgress(long bytesWritten,
long contentLength,
boolean done) {
System.out
.println("Place holder for tracking"
+ " request progress");
}
@Override
public void onSuccess(SupervisorOutput result, int statusCode,
Map<String, List<String>> responseHeaders) {
SupervisorOutputBodyData supervisorList = result.getBody()
.getData();
System.out.println("Group List : " + supervisorList);
}
@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) {
}
};
// SupervisorInput wraps RequestHeader and SupervisorRequestBody
SupervisorInput supervisorInput = new SupervisorInput();
/*
* { "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("group-create-s1002r1");
supervisorInput.setHeader(hdr);
SupervisorInputBody body = new SupervisorInputBody();
String supervisorPersonnelId = "0550c168-6117-45d5-a95f-e66593e6336b";
UUID supervisorId = UUID.fromString(supervisorPersonnelId);
body.setSupervisor(supervisorId);
supervisorInput.setBody(body);
try {
String subDealerId = "subdealers1002";
String salesPersonId = "b6520174-f4de-4ae6-b3e9-7f74174cb2d2";
String group = "DEFAULT";
supervisorApi.createSupervisorAsync(subDealerId, salesPersonId, group, supervisorInput, callBack);
} catch (ApiException e1) {
e1.printStackTrace();
}
}
}
/**
*
*/
package com.braango.virtualdealer.supervisors;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.braango.client.ApiCallback;
import com.braango.client.ApiClient;
import com.braango.client.ApiException;
import com.braango.client.braangoapi.EmailsApi;
import com.braango.client.braangoapi.GroupsApi;
import com.braango.client.braangoapi.SupervisorsApi;
import com.braango.client.braangomodel.EmailOutputBodyData;
import com.braango.client.braangomodel.GroupInput;
import com.braango.client.braangomodel.GroupInputBody;
import com.braango.client.braangomodel.GroupOutput;
import com.braango.client.braangomodel.GroupOutputBodyData;
import com.braango.client.braangomodel.RequestHeader;
import com.braango.client.braangomodel.EmailInput;
import com.braango.client.braangomodel.EmailInputBody;
import com.braango.client.braangomodel.EmailOutput;
import com.braango.client.braangomodel.SupervisorInput;
import com.braango.client.braangomodel.SupervisorInputBody;
import com.braango.client.braangomodel.SupervisorOutput;
import com.braango.client.braangomodel.SupervisorOutputBodyData;
/**
* @author braango
*
* Sample code to get supervisors
*
*/
public class GetSupervisor {
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
SupervisorsApi supervisorApi = new SupervisorsApi(braangoApiClient);
ApiCallback<SupervisorOutput> callBack = new ApiCallback<SupervisorOutput>() {
@Override
public void onUploadProgress(long bytesWritten,
long contentLength,
boolean done) {
System.out
.println("Place holder for tracking"
+ " request progress");
}
@Override
public void onSuccess(SupervisorOutput result, int statusCode,
Map<String, List<String>> responseHeaders) {
SupervisorOutputBodyData supervisorList = result.getBody()
.getData();
System.out.println("Group List : " + supervisorList);
}
@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 = "b6520174-f4de-4ae6-b3e9-7f74174cb2d2";
String group = "DEFAULT";
String accountType = "partner";
supervisorApi.getSupervisorAsync(subDealerId, salesPersonId,
group, apiKey,
accountType, callBack);
} catch (ApiException e1) {
e1.printStackTrace();
}
}
}
/**
*
*/
package com.braango.virtualdealer.supervisors;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.braango.client.ApiCallback;
import com.braango.client.ApiClient;
import com.braango.client.ApiException;
import com.braango.client.braangoapi.EmailsApi;
import com.braango.client.braangoapi.GroupsApi;
import com.braango.client.braangoapi.SupervisorsApi;
import com.braango.client.braangomodel.EmailOutputBodyData;
import com.braango.client.braangomodel.GroupInput;
import com.braango.client.braangomodel.GroupInputBody;
import com.braango.client.braangomodel.GroupOutput;
import com.braango.client.braangomodel.GroupOutputBodyData;
import com.braango.client.braangomodel.RequestHeader;
import com.braango.client.braangomodel.EmailInput;
import com.braango.client.braangomodel.EmailInputBody;
import com.braango.client.braangomodel.EmailOutput;
import com.braango.client.braangomodel.SupervisorInput;
import com.braango.client.braangomodel.SupervisorInputBody;
import com.braango.client.braangomodel.SupervisorOutput;
import com.braango.client.braangomodel.SupervisorOutputBodyData;
/**
* @author braango
*
* Sample code to get all supervisors all groups
*
*/
public class ListSupervisors {
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
SupervisorsApi supervisorApi = new SupervisorsApi(braangoApiClient);
ApiCallback<SupervisorOutput> callBack = new ApiCallback<SupervisorOutput>() {
@Override
public void onUploadProgress(long bytesWritten,
long contentLength,
boolean done) {
System.out
.println("Place holder for tracking"
+ " request progress");
}
@Override
public void onSuccess(SupervisorOutput result, int statusCode,
Map<String, List<String>> responseHeaders) {
SupervisorOutputBodyData supervisorList = result.getBody()
.getData();
System.out.println("Group List : " + supervisorList);
}
@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 = "b6520174-f4de-4ae6-b3e9-7f74174cb2d2";
String group = "DEFAULT";
String accountType = "partner";
supervisorApi.getAllSupervisorsAsync(subDealerId,
salesPersonId,
apiKey,
accountType, callBack);
} catch (ApiException e1) {
e1.printStackTrace();
}
}
}
/**
*
*/
package com.braango.virtualdealer.supervisors;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.braango.client.ApiCallback;
import com.braango.client.ApiClient;
import com.braango.client.ApiException;
import com.braango.client.braangoapi.EmailsApi;
import com.braango.client.braangoapi.GroupsApi;
import com.braango.client.braangoapi.SupervisorsApi;
import com.braango.client.braangomodel.EmailOutputBodyData;
import com.braango.client.braangomodel.GroupInput;
import com.braango.client.braangomodel.GroupInputBody;
import com.braango.client.braangomodel.GroupOutput;
import com.braango.client.braangomodel.GroupOutputBodyData;
import com.braango.client.braangomodel.RequestHeader;
import com.braango.client.braangomodel.EmailInput;
import com.braango.client.braangomodel.EmailInputBody;
import com.braango.client.braangomodel.EmailOutput;
import com.braango.client.braangomodel.SupervisorInput;
import com.braango.client.braangomodel.SupervisorInputBody;
import com.braango.client.braangomodel.SupervisorOutput;
import com.braango.client.braangomodel.SupervisorOutputBodyData;
/**
* @author braango
*
* Sample code to delete supervisors per group
*
*/
public class DeleteSupervisor {
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
SupervisorsApi supervisorApi = new SupervisorsApi(braangoApiClient);
ApiCallback<SupervisorOutput> callBack = new ApiCallback<SupervisorOutput>() {
@Override
public void onUploadProgress(long bytesWritten,
long contentLength,
boolean done) {
System.out
.println("Place holder for tracking"
+ " request progress");
}
@Override
public void onSuccess(SupervisorOutput result, int statusCode,
Map<String, List<String>> responseHeaders) {
SupervisorOutputBodyData supervisorList = result.getBody()
.getData();
System.out.println("Group List : " + supervisorList);
}
@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 = "b6520174-f4de-4ae6-b3e9-7f74174cb2d2";
String group = "DEFAULT";
String accountType = "partner";
supervisorApi.deleteSupervisorAsync(subDealerId, salesPersonId,
group, apiKey,
accountType, callBack);
} catch (ApiException e1) {
e1.printStackTrace();
}
}
}
/**
*
*/
package com.braango.virtualdealer.supervisors;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.braango.client.ApiCallback;
import com.braango.client.ApiClient;
import com.braango.client.ApiException;
import com.braango.client.braangoapi.EmailsApi;
import com.braango.client.braangoapi.GroupsApi;
import com.braango.client.braangoapi.SupervisorsApi;
import com.braango.client.braangomodel.EmailOutputBodyData;
import com.braango.client.braangomodel.GroupInput;
import com.braango.client.braangomodel.GroupInputBody;
import com.braango.client.braangomodel.GroupOutput;
import com.braango.client.braangomodel.GroupOutputBodyData;
import com.braango.client.braangomodel.RequestHeader;
import com.braango.client.braangomodel.EmailInput;
import com.braango.client.braangomodel.EmailInputBody;
import com.braango.client.braangomodel.EmailOutput;
import com.braango.client.braangomodel.SupervisorInput;
import com.braango.client.braangomodel.SupervisorInputBody;
import com.braango.client.braangomodel.SupervisorOutput;
import com.braango.client.braangomodel.SupervisorOutputBodyData;
/**
* @author braango
*
* Sample code to delete all supervisors all group
*
*/
public class DeleteAllSupervisor {
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
SupervisorsApi supervisorApi = new SupervisorsApi(braangoApiClient);
ApiCallback<SupervisorOutput> callBack = new ApiCallback<SupervisorOutput>() {
@Override
public void onUploadProgress(long bytesWritten,
long contentLength,
boolean done) {
System.out
.println("Place holder for tracking"
+ " request progress");
}
@Override
public void onSuccess(SupervisorOutput result, int statusCode,
Map<String, List<String>> responseHeaders) {
SupervisorOutputBodyData supervisorList = result.getBody()
.getData();
System.out.println("Group List : " + supervisorList);
}
@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 = "b6520174-f4de-4ae6-b3e9-7f74174cb2d2";
String group = "DEFAULT";
String accountType = "partner";
supervisorApi.deleteAllSupervisorsAsync(subDealerId,
salesPersonId,
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 supervisor
* for personnel for given group
*
* Note supervisor is another
* personnel within the system
*
* Both personnel i.e. supervisor
* and personnel to be supervised
* need to exist in the system
*
*/
// 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\SupervisorsApi();
// string | id of _sub_account_
$subdealerid = "subdealers2002";
// string | id of salesperson
$salespersonid = "aed72631-c968-4362-a9a4-ebe5bef8310b";
// string | group
$group = "Test Group";
// Braango\braangomodel\SupervisorInput |
$supervisorInput = new \Braango\braangomodel\SupervisorInput();
/*
* { "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("group-create-s2002r4");
$supervisorInput->setHeader($hrd);
$supervisorInputBody = new model\SupervisorInputBody();
$supervisorPersonnelId = "945cddce-6ef6-46e4-ac70-09375cf5165a";
$supervisorInputBody->setSupervisor($supervisorPersonnelId);
$supervisorInput->setBody($supervisorInputBody);
try {
$result = $api_instance->createSupervisor($subdealerid, $salespersonid, $group, $supervisorInput);
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");
$supervisorOutputBodyData = $rspBdy->getData();
print_r("Group List : " . $supervisorOutputBodyData);
}
}
} catch (Exception $e) {
echo 'Exception when calling SupervisorsApi->createSupervisor: ', $e->getMessage(), PHP_EOL;
}
?>
<?php
require_once (__DIR__ . '/../../vendor/autoload.php');
/**
*
* @author braango
*
* Sample code to get supervisors
*
*/
// 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\SupervisorsApi();
// string | id of _sub_account_
$subdealerid = "subdealers2002";
// string | id of salesperson
$salespersonid = "aed72631-c968-4362-a9a4-ebe5bef8310b";
// string | group
$group = "Test Group";
// 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->getSupervisor($subdealerid, $salespersonid, $group, $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");
$supervisorOutputBodyData = $rspBdy->getData();
print_r("Group List : " . $supervisorOutputBodyData);
}
}
} catch (Exception $e) {
echo 'Exception when calling SupervisorsApi->getSupervisor: ', $e->getMessage(), PHP_EOL;
}
?>
<?php
require_once (__DIR__ . '/../../vendor/autoload.php');
/**
*
* @author braango
*
* Sample code to get all supervisors all groups
*
*/
// 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\SupervisorsApi();
// string | id of _sub_account_
$subdealerid = "subdealers2002";
// string | id of salesperson
$salespersonid = "aed72631-c968-4362-a9a4-ebe5bef8310b";
// 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->getAllSupervisors($subdealerid, $salespersonid, $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");
$supervisorOutputBodyData = $rspBdy->getData();
print_r("Group List : " . $supervisorOutputBodyData);
}
}
} catch (Exception $e) {
echo 'Exception when calling SupervisorsApi->getAllSupervisors: ', $e->getMessage(), PHP_EOL;
}
?>
<?php
require_once (__DIR__ . '/../../vendor/autoload.php');
/**
*
* @author braango
*
* Sample code to delete supervisors per group
*
*/
// 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\SupervisorsApi();
// string | id of _sub_account_
$subdealerid = "subdealers2002";
// string | id of salesperson
$salespersonid = "aed72631-c968-4362-a9a4-ebe5bef8310b";
// string | group
$group = "Test Group";
// 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->deleteSupervisor($subdealerid, $salespersonid, $group, $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");
$supervisorOutputBodyData = $rspBdy->getData();
print_r("Group List : " . $supervisorOutputBodyData);
}
}
} catch (Exception $e) {
echo 'Exception when calling SupervisorsApi->deleteSupervisor: ', $e->getMessage(), PHP_EOL;
}
?>
<?php
require_once (__DIR__ . '/../../vendor/autoload.php');
/**
*
* @author braango
*
* Sample code to delete all supervisors all group
*
*/
// 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\SupervisorsApi();
// string | id of _sub_account_
$subdealerid = "subdealers2002";
// string | id of salesperson
$salespersonid = "aed72631-c968-4362-a9a4-ebe5bef8310b";
// 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->deleteAllSupervisors($subdealerid, $salespersonid, $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");
$supervisorOutputBodyData = $rspBdy->getData();
print_r("Group List : " . $supervisorOutputBodyData);
}
}
} catch (Exception $e) {
echo 'Exception when calling SupervisorsApi->deleteAllSupervisors: ', $e->getMessage(), PHP_EOL;
}
?>