+use Braango\braangomodel as model;
+use Braango\braangomodel\RequestHeader as rhdr;
+require_once (__DIR__ . '/../../vendor/autoload.php');
+ * Sample code showing how to create new SMS number for personnel
+// TEST auth token. Please contact
+// sales@braango.com to have one
+Braango\Configuration::getDefaultConfiguration()->setApiKey('auth_token', 'ISNWF0P30WM0CMK');
+$api_instance = new Braango\braangoapi\SmsApi();
+// string | id of _sub_account_
+$subdealerid = "subdealers2002";
+// string | id of salesperson
+$salespersonid = "d1e5cb9c-def7-4273-85c7-46a1b5e46869";
+// Braango\braangomodel\SmsInput |
+$smsInput = new \Braango\braangomodel\SmsInput();
+// dealer_api_key returned
+// when partner_dealer was created
+$hrd->setApiKey("ISNMdzuNiKG7jhl9d9v");
+// Set the account type to partner for
+// virtual dealer and partner hosted
+$hrd->setAccountType("partner");
+// ID that will be reflected back
+$hrd->setId("sms-create-s2002");
+$smsInput->setHeader($hrd);
+$smsInputBody = new model\SmsInputBody();
+// Create new SMS number for this personnel
+$smsInputBody->setSmsNumber("4088723449");
+$smsInput->setBody($smsInputBody);
+ $result = $api_instance->createSms($subdealerid, $salespersonid, $smsInput);
+ // 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");
+ $smsOutPutBodyData = $rspBdy->getData();
+ $smsList = $smsOutPutBodyData->getSmsList();
+ print_r(array_values($smsList));
+} catch (Exception $e) {
+ echo 'Exception when calling SmsApi->createSms: ', $e->getMessage(), PHP_EOL;