I am working with Magento Rest API for the first time, i went through the tutorials of Rest API on http://www.magentocommerce.com/api/rest and tried one example to fetch product through API:

$callbackUrl = "http://localhost/wineshop/products.php";
$temporaryCredentialsRequestUrl = "http://localhost/wineshop/oauth/initiate?     oauth_callback=" . urlencode($callbackUrl);
$adminAuthorizationUrl = 'http://localhost/wineshop/admin/oauth_authorize';
$accessTokenRequestUrl = 'http://localhost/wineshop/oauth/token';
$apiUrl = 'http://localhost/wineshop/api/rest';
$consumerKey = 'u48p1x9gzrg7r82c94woa5z7g805uw0i';
$consumerSecret = '96ydrk8s89xxath8h5z71vcl5abfq0zg';

if (!isset($_GET['oauth_token']) && isset($_SESSION['state']) && $_SESSION['state'] == 1) {
$_SESSION['state'] = 0;
try {
$oauthClient = new OAuth($consumerKey, $consumerSecret,  OAUTH_SIG_METHOD_HMACSHA1, $authType);

I've also installed the latest version of OAUTH and it also shows in my WampServer PHP Extensions but it doesn't show in phpinfo(). I coped the php_oauth.dll file into ..\www\bin\php\ext and i also edited php.ini and entered extension=php_oauth.dll but on running the products.php it shows me the

Fatal error: Class 'OAuth' not found in P:\wamp\www\products.php on line 19
And i also want to know that how to request for the token i've got key and secret after entering new consumer in Magento Admin Panel. But i don't know how to get Access Token & Access Token Secret that we enter in RESTClient

Please Help, Thanks in advance

  • This appears to be an issue loading the library. WAMP can be a... fickle thing. Are you use you edited the correct php.ini? If it doesn't show in your phpinfo something is wrong, either your DLL is in the wrong place, or the php.ini is the wrong one. – Tim Reynolds Jul 19 '13 at 15:47
  • I edited the php.ini in wamp\bin\php\php5.4.3 and copied the DLL in wamp\bin\php\php5.4.3\ext – Maulik Goswami Jul 20 '13 at 6:06
  • Just asking to be sure, but did you restart apache after modifying your php.ini file? – Dan Jul 20 '13 at 10:34
  • Yes i did, i restarted my WAMP Server after it. – Maulik Goswami Jul 20 '13 at 13:06
  • Instead of new OAuth(..., try using new \OAuth(... (add a backslash before the class name) – Dan Aug 2 '13 at 15:48

I can partially answer your question.

Access Token and Access Token secret are provided by the authentication server upon request and they validate the further requests.

Just a matter of chance, you can check if oAuth works for you by following this link

  • Yes i followed all the steps on given link but the thing is i'm having this oAuth error so i can't go ahead and without running this file i will not be able to get Access Token or Access Token Secret. – Maulik Goswami Jul 20 '13 at 13:10
  • Can you tell the exact error? In case I might know the solution.... – Ankur Kumar Oct 24 '13 at 7:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.