title: How to get current date google fit steps count in laravel using gethealth api?
body: <p>I Have developed a fitness dashboard. which shows users current day steps count, calories burn, kilometers crossed. for that i'm using gethealth api <a href="https://platform.gethealth.io/docs" rel="nofollow noreferrer">https://platform.gethealth.io/docs</a> . I can get previous dates data correctly but can't get current date's data.it returns empty array. please give me alternatives for gethealth also.</p>
  <p>Followed steps:</p>
  <p>step 1: Create account in gethealth and add users using <a href="https://platform.gethealth.io/docs/#!/Account_API/CreateUser" rel="nofollow noreferrer">https://platform.gethealth.io/docs/#!/Account_API/CreateUser</a> and store accesstoken in mysql database</p>
  <p>step 2: Get devices for added users using <a href="https://platform.gethealth.io/docs/#!/Account_API/get_v1_health_user_devices" rel="nofollow noreferrer">https://platform.gethealth.io/docs/#!/Account_API/get_v1_health_user_devices</a> and get connection url from the response. send it to user. with that they can connect google fit with gethealth.</p>
  <p>step 3: Get current day activity using <a href="https://platform.gethealth.io/docs/#!/Health_Panel_API/post_v1_health_user_daily_summary" rel="nofollow noreferrer">https://platform.gethealth.io/docs/#!/Health_Panel_API/post_v1_health_user_daily_summary</a></p>
  <pre><code>public function getMembers(){
      $response_arr = array();
      try{
          $members = DB::table('users')
                      -&gt;select('user_id','name','email','role','get_health_id','get_health_access_token','profile_picture')
                      -&gt;where('status','A')
                      -&gt;get();
          
          $curr_date = date('Y-m-d');
          $st_date = $curr_date.&quot;T00:00:00&quot;;
          $end_date = $curr_date.&quot;T23:59:59&quot;;
          if(count($members) &gt; 0){
              foreach ($members as $member) {
                  $token = $member-&gt;get_health_access_token;
                  if(!empty($token)){
  
                  $url = &quot;https://platform.gethealth.io/v1/health/user/daily_summary?&quot;;
  
                  $get_daily_data_params = array(
                              &quot;access_token&quot; =&gt; $token,
                              &quot;limit&quot;        =&gt; 100,
                              &quot;start_date&quot;   =&gt; $st_date,
                              &quot;end_date&quot;     =&gt; $end_date,
                              &quot;source&quot;       =&gt; &quot;googlefit&quot;
                          );
                         
                          
                      $params_str = http_build_query($get_daily_data_params);
                      $url .= $params_str;
                      $ch = curl_init($url);
                      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
                      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
                      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
                      curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
  
                      $response = curl_exec($ch);
                      $daily_data_arr = json_decode($response,true);
                      curl_close($ch);
  
                      if(count($daily_data_arr['daily_summary']) &gt; 0){
                          $member-&gt;google_fit_data = $daily_data_arr['daily_summary'][0];
                      }else{
                          $member-&gt;google_fit_data = &quot;&quot;;
                      }
                  }
                  }
                 
              $response_arr['status'] = &quot;success&quot;;
              $response_arr['data']   = $members;
              $response_arr['date']   = $curr_date;
          }else{
              $response_arr['status'] = &quot;error&quot;;
              $response_arr['message'] = &quot;User Not Found&quot;;
          }
          
      } catch(Exception $e){
          $response_arr['status'] = &quot;error&quot;;
          $response_arr['message']   = $e-&gt;getMessage();
      }
  
      return $response_arr;
  }
  </code></pre>
  <p>These steps are i have followed. But i cant get current date's data.
  I have also tried sync api <a href="https://platform.gethealth.io/docs/#!/Account_API/post_v1_health_account_syncs" rel="nofollow noreferrer">https://platform.gethealth.io/docs/#!/Account_API/post_v1_health_account_syncs</a>. but no use.
  Please help me.</p>