簡體   English   中英

如何使用PHP獲取Harvest API中的其他聯系方式

[英]How to get other contact details in harvest api using php

我寫成

<?php
 require_once 'HarvestAPI.php';

  /* Register Auto Loader */
   spl_autoload_register(array('HarvestAPI', 'autoload'));

   $api = new HarvestAPI();
   $api->setUser( "nida.amin@gmail.com" );
   $api->setPassword( "aaabbb12345" );
   $api->setAccount( "heavenscompany" );

   $api->setRetryMode( HarvestAPI::RETRY );
   $api->setSSL(true);

   $result = $api->getClients();
   foreach( $result->data as $client ) {
   if( $result->isSuccess() ) {
   echo $client->get( "name" );
   echo $client->details;
   }
  }
 ?>

我是Harvest API的新手。 請幫助我如何在PHP的Harvest API中獲取客戶端的其他聯系方式,例如電子郵件,手機號碼,辦公室等。

您可能會在客戶詳細信息中找到該電子郵件地址。 請嘗試以下操作:

var_dump($client->details);die();

然后,您應該獲得details變量中內容的輸出。 希望它將是一個數組,您可以從中提取電子郵件地址。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM