0

I have written as

<?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;
   }
  }
 ?>

I am very new to Harvest API. Please help me how to get other contact details of the client like email, mobile no's, office...etc in Harvest API in php?

Nida
  • 1,672
  • 3
  • 35
  • 68

1 Answers1

0

You might find the email address in the client details. Try the following:

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

Then you should get an output of what is in the details variable. Hopefully it will be an array and you can extract the email address out of it.

sebbo
  • 2,929
  • 2
  • 20
  • 37
  • No, I think $client-details is not an array as it displays text (address field of the Client) – Nida Oct 22 '13 at 07:35
  • What if you var_dump the whole $client object? Do you find an email address in the output? – sebbo Oct 22 '13 at 10:53
  • So it seems that either your client object de facto has no email address or the API has no functionality to return it. – sebbo Oct 22 '13 at 22:53