2012-10-29 97 views
0

我是大商业新手。Bigcommerce API连接错误

我尝试连接下面的Big-commerce的PHP API是我的代码。

BigCommerce_Api::configure(array(
    'store_url' => 'mystore url', 
    'username' => 'admin', 
    'api_key' => 'my apikey' 
)); 

$ping = BigCommerce_Api::getTime(); 
if ($ping) 
{ 
    echo $ping->format('H:i:s'); 
} 
else 
{ 
    echo "error in connection"; 
} 

我试图显示连接完成但出现错误的时间。

在我的代码中是否有任何问题?

请帮我解决这个问题。

+0

难道他们提供支持和/或文档? – zerkms

+0

你有什么特别的错误? $ ping的var转储显示什么? –

回答

3

默认生成使用的Bigcommerce API删除URL api/v2当URL看起来像https://uniquestoreid.mybigcommerce.com/api/v2/,你的配置应该是这样的:

BigCommerce_Api::configure(
    array(
     'store_url' => 'https://uniquestoreid.mybigcommerce.com', 
     'username' => 'username', 
     'api_key' => 'longtokenstring' 
    ) 
);