當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BaseService::getHeaders方法代碼示例

本文整理匯總了PHP中BaseService::getHeaders方法的典型用法代碼示例。如果您正苦於以下問題:PHP BaseService::getHeaders方法的具體用法?PHP BaseService::getHeaders怎麽用?PHP BaseService::getHeaders使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BaseService的用法示例。


在下文中一共展示了BaseService::getHeaders方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: updateCampaign

 /**
  * Update a specific email campaign
  * @param string $accessToken - Constant Contact OAuth2 access token
  * @param Campaign $campaign - Campaign to be updated
  * @return Campaign
  */
 public function updateCampaign($accessToken, Campaign $campaign)
 {
     $baseUrl = Configs::get('endpoints.base_url') . sprintf(Configs::get('endpoints.campaign'), $campaign->id);
     $url = $this->buildUrl($baseUrl);
     $response = parent::getRestClient()->put($url, parent::getHeaders($accessToken), $campaign->toJson());
     return Campaign::create(json_decode($response->body, true));
 }
開發者ID:CreatrixeNew,項目名稱:carparking,代碼行數:13,代碼來源:EmailMarketingService.php

示例2: getVerifiedEmailAddresses

 /**
  * Get all verified email addresses associated with an account
  * @param string $accessToken - Constant Contact OAuth2 Access Token
  * @param array $params - array of query parameters/values to append to the request
  * @return array of VerifiedEmailAddress
  */
 public function getVerifiedEmailAddresses($accessToken, array $params)
 {
     $baseUrl = Config::get('endpoints.base_url') . sprintf(Config::get('endpoints.account_verified_addresses'));
     $url = $this->buildUrl($baseUrl, $params);
     $response = parent::getRestClient()->get($url, parent::getHeaders($accessToken));
     $verifiedAddresses = array();
     foreach (json_decode($response->body, true) as $verifiedAddress) {
         $verifiedAddresses[] = VerifiedEmailAddress::create($verifiedAddress);
     }
     return $verifiedAddresses;
 }
開發者ID:CreatrixeNew,項目名稱:carparking,代碼行數:17,代碼來源:AccountService.php

示例3: getContactsFromList

 /**
  * Get all contacts from an individual list
  * @param string $accessToken - Constant Contact OAuth2 access token
  * @param string $list_id - list id to retrieve contacts for
  * @param array $params - query params to attach to request
  * @return ResultSet
  */
 public function getContactsFromList($accessToken, $list_id, $params = null)
 {
     $baseUrl = Configs::get('endpoints.base_url') . sprintf(Configs::get('endpoints.list_contacts'), $list_id);
     $url = $this->buildUrl($baseUrl, $params);
     $response = parent::getRestClient()->get($url, parent::getHeaders($accessToken));
     $body = json_decode($response->body, true);
     $contacts = array();
     foreach ($body['results'] as $contact) {
         $contacts[] = Contact::create($contact);
     }
     //return new ResultSet($contacts, $body['meta']);
     return $contacts;
 }
開發者ID:CreatrixeNew,項目名稱:carparking,代碼行數:20,代碼來源:ListService.php

示例4: getSummary

 /**
  * Get a summary of reporting data for a given contact
  * @param string $accessToken - Constant Contact OAuth2 access token
  * @param int $contact_id - Contact id
  * @return TrackingSummary
  */
 public function getSummary($accessToken, $contact_id)
 {
     $baseUrl = Config::get('endpoints.base_url') . sprintf(Config::get('endpoints.contact_tracking_summary'), $contact_id);
     $url = $this->buildUrl($baseUrl);
     $response = parent::getRestClient()->get($url, parent::getHeaders($accessToken));
     return TrackingSummary::create(json_decode($response->body, true));
 }
開發者ID:CreatrixeNew,項目名稱:carparking,代碼行數:13,代碼來源:ContactTrackingService.php

示例5: addRemoveContactsFromListsActivity

 /**
  * Create a Remove Contacts From Lists Activity
  * @param string $accessToken - Constant Contact OAuth2 access token
  * @param array $emailAddresses - array of email addresses to remove
  * @param array $lists - array of lists to remove the provided email addresses from
  * @return array - Array of all ActivitySummaryReports
  */
 public function addRemoveContactsFromListsActivity($accessToken, array $emailAddresses, array $lists)
 {
     $baseUrl = Config::get('endpoints.base_url') . Config::get('endpoints.remove_from_lists_activity');
     $url = $this->buildUrl($baseUrl);
     $payload = array('import_data' => array(), 'lists' => $lists);
     foreach ($emailAddresses as $emailAddress) {
         $payload['import_data'][] = array('email_addresses' => array($emailAddress));
     }
     $response = parent::getRestClient()->post($url, parent::getHeaders($accessToken), json_encode($payload));
     return Activity::create(json_decode($response->body, true));
 }
開發者ID:CreatrixeNew,項目名稱:carparking,代碼行數:18,代碼來源:ActivityService.php

示例6: sendTest

 /**
  * Send a test send of a campaign
  * @param string $accessToken - Constant Contact OAuth2 access token
  * @param int $campaignId - Id of campaign to send test of
  * @param TestSend $test_send - Test send details
  * @return TestSend
  */
 public function sendTest($accessToken, $campaignId, TestSend $test_send)
 {
     $baseUrl = Config::get('endpoints.base_url') . sprintf(Config::get('endpoints.campaign_test_sends'), $campaignId);
     $url = $this->buildUrl($baseUrl);
     $response = parent::getRestClient()->post($url, parent::getHeaders($accessToken), $test_send->toJson());
     return TestSend::create(json_decode($response->body, true));
 }
開發者ID:CreatrixeNew,項目名稱:carparking,代碼行數:14,代碼來源:CampaignScheduleService.php


注:本文中的BaseService::getHeaders方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。