Hello,
I am trying to use the following code in a Curl Post and am having no success.
I am new to this and so am missing something to make this function properly:
Below is the PHP code used. Any help in getting this working is greatly appreciated.
$data = '{"serviceRequests": {"WELLNESS": {"activityRequests": [{"GET_ACTIVITY_SUMMARY": [{"activitySummaryRequest": {"consumerToken": "'.$_GET['oauth_token'].'",'.
'"userAccessToken": "'.$signatures['oauth_token'].'","unacknowledgedOnly":false,"beginTimeMillis": '.$starttime.',"endTimeMillis": '.$endtime.'},"app": {"appId": "IHP1","version": 1.0}}]}]}}}';
$content = json_decode($data, true);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: application/octet-stream","Protocol:JSON"));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, "http://gcsapitest.garmin.com/gcs-api/api/json");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
$r = curl_exec($ch);
curl_close($ch);
print_r($r);
Thanks for looking at this,
Kim H.