setApiKey('auth_token', 'ISNWF0P30WM0CMK'); $api_instance = new Braango\braangoapi\ConnectsApi(); // string | id of _sub_dealer_ $subdealerid = "subdealers2002"; // Braango\braangomodel\AddClientRequestInput | $addClientRequestInput = new \Braango\braangomodel\AddClientRequestInput(); /* * { "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("add-client-01"); $addClientRequestInput->setHeader($hrd); // This is where the action happens $addClientBody = new model\AddClient(); // This is the client that is going // to be seeded into the // braango system for this subdealer and/or // given personnel // // If the client already exists, it simply // becomes upsert operation $addClientBody->setClientNumber("4089874333"); // Specifies if the added client // is to be connected with // the dealer. Default is // true. If false // then, to enable connection // either call this api or dealerconnect // api and specify enable = true $addClientBody->setConnectEnable(FALSE); // specify the braango number // to be used. System will // verify if the braango number // is valid for given sub_dealer and/or personnel // // If not specified, partner's blast number will be // used // // As a fallback Braango's general number will be used // if everything fails $addClientBody->setBraangoNumber("555-555-5555"); // Allows to send initial seeding message // to the client if this flag is true $addClientBody->setSendMessage(TRUE); // If this flag is true, seeding will not // happen. This should be used after // seeding has happened and // api caller wants programmatic // control of sending message to the // client $addClientBody->setSendMessageOnly(FALSE); $message = array( "Line 1" ); $addClientBody->setMessage($message); $addClientRequestInput->setBody($addClientBody); try { $api_instance->addClientAllPersonnel($subdealerid, $addClientRequestInput); } catch (Exception $e) { echo 'Exception when calling ConnectsApi->addClientAllPersonnel: ', $e->getMessage(), PHP_EOL; } ?>