How we can get Garmin Api data using oAuth 1.0 using C# code. Ask Question
By   Junaid A     29-Dec-2024    1

How we can get Garmin Api data using oAuth 1.0 using C# code.

below is some refrence code of php

//Sample Request URL - https://apis.garmin.com/wellne...

$requestBaseUrl = 'https://apis.garmin.com/wellne...'; //this is the base URL needed for signature generation, notice there are no parameters

$uploadStartTimeInSeconds = '1594940400';

$uploadEndTimeInSeconds = '1595025118';

$oauth_timestamp = 1595025902;

$oauth_nonce = "VRrwgTiPw5e" ;

$oauth_token = "token";

$oauth_token_secret= "t.secret";

$oauth_consumer_key = "key";

$oauth_consumer_secret = "k.secret";

$oauth_signatureMethod = "HMAC-SHA1";

$oauth_version = "1.0";

$base_signature = "GET&" . rawurlencode($requestBaseUrl) ."&" .

rawurlencode("oauth_consumer_key=$oauth_consumer_key"

. "&oauth_nonce=$oauth_nonce"

. "&oauth_signature_method=$oauth_signatureMethod"

. "&oauth_timestamp=$oauth_timestamp"

. "&oauth_token=$oauth_token"

. "&oauth_version=$oauth_version"

. "&uploadEndTimeInSeconds=$uploadEndTimeInSeconds"

. "&uploadStartTimeInSeconds=$uploadStartTimeInSeconds");

echo "base_signature= $base_signature ";

$oauthSig = hash_hmac("SHA1", $base_signature, $oauth_consumer_secret . "&" . $oauth_token_secret, false);

$oauthSig = rawurlencode(base64_encode(pack('H*', $oauthSig)));

echo "oauth_signature= $oauthSig";

?>

'Authorization: OAuth oauth_nonce="2912044693", oauth_signature="jnR1z5DHnszm1tO3d1Dfi1Y%2FeA4%3D", oauth_consumer_key="key", oauth_token="token", oauth_timestamp="1685135707", oauth_signature_method="HMAC-SHA1", oauth_version="1.0"'

Request:

GET https://apis.garmin.com/wellne...

Request:

GET https://apis.garmin.com/wellne...

Request:

GET https://apis.garmin.com/wellne... moveiq?uploadStartTimeInSeconds=1490372394&uploadEndTimeInSeconds=1490372634

backfill d=historic data - data prior to user onboarding with KFS Rx Meals

GET https://apis.garmin.com/wellne...

Solutions


10351
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM