+use Braango\braangomodel as model;
+use Braango\braangomodel\RequestHeader as rhdr;
+require_once (__DIR__ . '/../../vendor/autoload.php');
+// TEST auth token. Please contact
+// sales@braango.com to have one
+Braango\Configuration::getDefaultConfiguration()->setApiKey('auth_token', 'ISNWF0P30WM0CMK');
+$api_instance = new Braango\braangoapi\PersonnelsApi();
+// string | Sub dealer for which this sales person belongs to.
+$subdealerid = "subdealers2002";
+// string | Sales person ID that was returned when this personnel was created
+$salespersonid = "945cddce-6ef6-46e4-ac70-09375cf5165a";
+// \Braango\braangomodel\PersonnelUpdateRequestInput |
+$personnelUpdateRequestInput = new \Braango\braangomodel\PersonnelUpdateRequestInput();
+$typeAdfCRMEmail = FALSE;
+ * { "api_key": "ISNGvAzwuy4X7vAqrtV", "id": "any value",
+ * "account_type": "partner" }
+// Set the account type to partner for
+// virtual dealer and partner hosted
+$hdr->setAccountType("partner");
+// dealer_api_key returned
+// when partner_dealer was created
+$hdr->setApiKey("ISNMdzuNiKG7jhl9d9v");
+// ID that will be reflected back
+$hdr->setId("create-personnel-s2002r2");
+$personnelUpdateRequestInput->setHeader($hdr);
+$personnelUpdateBody = new model\PersonnelUpdate();
+// Required field . Used for
+// SMS login in to the UI
+// For Braango Enterprise, this is don't care
+// unless partner implements UI with SMS login
+$personnelUpdateBody->setSmsLogin(FALSE);
+ * Password will be encrypted with SHA-25 and base64 encoded and stored
+ * internally within the braango system. pattern:
+ * ^(?=^.{6,10}$)(?=.*\d)(
+ * ?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()_+}{"
+ * ;:;'?/>.<,])(?!.*\s).*$
+ * Used for single sign on. needs to 6-10 characters with one capital,
+ * one numberal and one special character
+ * Chaning the password for the update call
+$personnelUpdateBody->setPassword("test2T$");
+$personnelUpdateBody->setEmail("s2002r2@subdealer2002.com");
+// If email specified is that for
+// CRM email (ADF XML compliant)
+$personnelUpdateBody->setTypeAdfCrm($typeAdfCRMEmail);
+ * Number where dealer's root account can be reached via SMS
+ * pattern:^\(?(\d{3})\)?[- ]?(\d{3})[- ]?(\d{4})$
+$personnelUpdateBody->setPhoneNumber("4089763434");
+ * Number where dealer's root account can be reached via SMS
+ * pattern:^\(?(\d{3})\)?[- ]?(\d{3})[- ]?(\d{4})$
+$personnelUpdateBody->setSmsNumber('4089763434');
+// Subscribe to the group
+$personnelUpdateBody->setGroup('s2002g');
+// List of dealer banners. Braango will
+// randomly choose one when sending
+// message to dealer via SMS
+$personnelUpdateBody->setDealerBanners($dealerBanners);
+// List of client banners. Braango
+// will randomly choose one when
+// sending dealer messages to client
+$personnelUpdateBody->setClientBanners($clientBanners);
+// List of dealer footers. Braango will
+// randomly choose one when sending
+// message to dealer via SMS
+$personnelUpdateBody->setDealerFooters($dealerFooters);
+// List of client footers. Braango
+// will randomly choose one when
+// sending dealer messages to client
+$personnelUpdateBody->setClientFooters($clientFooters);
+// List of supervisor banners. Braango
+// will randomly choose one when
+// sending messages to supervisor
+$supervisorBanners = array(
+$personnelUpdateBody->setSupervisorBanners($supervisorBanners);
+// List of supervisor footers. Braango
+// will randomly choose one when
+// sending messages to supervisor
+$supervisorFooters = array(
+$personnelUpdateBody->setSupervisorFooters($supervisorFooters);
+$personnelUpdateRequestInput->setBody($personnelUpdateBody);
+ $result = $api_instance->updatePersonnel($subdealerid, $salespersonid, $personnelUpdateRequestInput);
+ // 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();
+ $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");
+ $salesPersonId = $rspBdy->getData()->getSalesPersonId();
+ print_r("SUCCESS : Updated SalespersonID = " . $salesPersonId . "\n");
+} catch (Exception $e) {
+ echo 'Exception when calling PersonnelsApi->updatePersonnel: ', $e->getMessage(), PHP_EOL;