Hallo,
ich will mit OAuth auf die etsy.com API zugreifen und bekomme folgenden Fehler den ich nicht ganz verstehe und auch Google mir nicht wirklich weiterhilft.
Notice: Use of undefined constant OAUTH_CONSUMER_KEY - assumed 'OAUTH_CONSUMER_KEY' in /var/www/vhosts/website/httpdocs/etsy-api/test.php on line 5 Notice: Use of undefined constant OAUTH_CONSUMER_SECRET - assumed 'OAUTH_CONSUMER_SECRET' in /var/www/vhosts/website/httpdocs/etsy-api/test.php on line 5
das ist mein Code
	
							
						
					ich will mit OAuth auf die etsy.com API zugreifen und bekomme folgenden Fehler den ich nicht ganz verstehe und auch Google mir nicht wirklich weiterhilft.
Notice: Use of undefined constant OAUTH_CONSUMER_KEY - assumed 'OAUTH_CONSUMER_KEY' in /var/www/vhosts/website/httpdocs/etsy-api/test.php on line 5 Notice: Use of undefined constant OAUTH_CONSUMER_SECRET - assumed 'OAUTH_CONSUMER_SECRET' in /var/www/vhosts/website/httpdocs/etsy-api/test.php on line 5
das ist mein Code
PHP Code:
	
	
<?php 
$access_token = "xxxxxxxxxxx";// get from db
$access_token_secret = "xxxxxxxxxxx";// get from db
$oauth = new OAuth(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET,
        OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI);
$oauth->setToken($access_token, $access_token_secret);
try {
    $data = $oauth->fetch("https://openapi.etsy.com/v2/users/__SELF__", null, OAUTH_HTTP_METHOD_GET);
    $json = $oauth->getLastResponse();
    print_r(json_decode($json, true));
} catch (OAuthException $e) {
    error_log($e->getMessage());
    error_log(print_r($oauth->getLastResponse(), true));
    error_log(print_r($oauth->getLastResponseInfo(), true));
    exit;
}
?>
 
          
Comment