Probleme mit OAuth - Use of undefined constant OAUTH_CONSUMER_KEY

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Probleme mit OAuth - Use of undefined constant OAUTH_CONSUMER_KEY

    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
    PHP-Code:
    <?php 
    $access_token 
    "xxxxxxxxxxx";// get from db
    $access_token_secret "xxxxxxxxxxx";// get from db

    $oauth = new OAuth(OAUTH_CONSUMER_KEYOAUTH_CONSUMER_SECRET,
            
    OAUTH_SIG_METHOD_HMACSHA1OAUTH_AUTH_TYPE_URI);

    $oauth->setToken($access_token$access_token_secret);

    try {
        
    $data $oauth->fetch("https://openapi.etsy.com/v2/users/__SELF__"nullOAUTH_HTTP_METHOD_GET);
        
    $json $oauth->getLastResponse();
        
    print_r(json_decode($jsontrue));

    } catch (
    OAuthException $e) {
        
    error_log($e->getMessage());
        
    error_log(print_r($oauth->getLastResponse(), true));
        
    error_log(print_r($oauth->getLastResponseInfo(), true));
        exit;
    }
    ?>

  • #2
    Du musst die Konstanten vorher definieren …
    I don't believe in rebirth. Actually, I never did in my whole lives.

    Kommentar

    Lädt...
    X