setApiKey('auth_token', 'ISNWF0P30WM0CMK'); $api_instance = new Braango\braangoapi\BannersApi(); // string | id of _sub_dealer_ $subdealerid = "subdealers2002"; // string | id of _personnel_ $salespersonid = "d1e5cb9c-def7-4273-85c7-46a1b5e46869"; // Braango\braangomodel\BannersInput | $bannersInput = new \Braango\braangomodel\BannersInput(); /* * { "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("banner-create-s2002"); $bannersInput->setHeader($hrd); $bannersInputBody = new model\BannersInputBody(); // Create Banners $bannersInputBody->setClientBanners($clientBanners = array( "s2002cb1-client api" )); $bannersInputBody->setDealerBanners($dealerBanners = array( "s2002db1-dealer api" )); $bannersInputBody->setSupervisorBanners($supervisorBanners = array( "s2002sb1-supervisor api" )); $bannersInput->setBody($bannersInputBody); try { $result = $api_instance->createBanners($subdealerid, $salespersonid, $bannersInput); 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"); $bannersOutPutBodyData = $rspBdy->getData(); $bannersDealer = $bannersOutPutBodyData->getDealerBanners(); $bannersClient = $bannersOutPutBodyData->getClientBanners(); $bannersSupervisor = $bannersOutPutBodyData->getSupervisorBanners(); // Prints the Client, Dealer, and Supervisor Banners print "Client Banners = "; print_r($bannersClient); print "Dealer Banners = "; print_r($bannersDealer); print "Supervisor Banners = "; print_r($bannersSupervisor); } } } catch (Exception $e) { echo 'Exception when calling BannersApi->createBanners: ', $e->getMessage(), PHP_EOL; } ?>