Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How To Use Api? Rate Topic   - - - - -

 
  • thomas
  • Advanced Member
  • Members
  • Join Date: 19-Nov 12
  • 83 posts

Posted 15 September 2015 - 11:51 AM #1

Hello,

 

I am looking for help.

 

I am using CS-CART API using PHP curl form outside. 

 

$username='xxxx@xxxxxxxxxxxx.com';
$password='TSw5a0YQ2eTSJk89O62y6i4XXjn40D9u';
 
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$URL);
curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);   //get status code
$result=curl_exec ($ch);
curl_close ($ch);
 
print_r($result);
 
OUTPUT

Page Not Found

We cannot locate the page you're looking for. Please check the address and make sure all letters are lowercased with no spaces. 

 

Thank you in advance.

 

Thank you.

 


Cheers!
Thomas

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19158 posts

Posted 15 September 2015 - 01:10 PM #2

Are you sure that the correct URL is used? We receive the same error if the URLs are used in the browser:

http://citytech.mage.com/sewpersonalgifts/api.php

http://citytech.mage.com/sewpersonalgifts

http://citytech.mage.com

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • thomas
  • Advanced Member
  • Members
  • Join Date: 19-Nov 12
  • 83 posts

Posted 15 September 2015 - 01:24 PM #3

Hello,

 

Thank you for your reply.

Actually I am using localhost as a <virtual host> 

 

My requirement is i will call API page using PHP CURL and get response in json or XML.

 

Thank you in advance.

Thank you.


Cheers!
Thomas