2015-11-02 39 views
0

我使用php oAuth創建了Etsy列表。我將以下參數發送給api調用「數量,標題,描述,價格,who_made,when_made,is_supply」。 我正在關注的文檔作爲參考here在Etsy中使用PHP api創建列表不起作用

這是過程流程

  1. 使用OAuth與Etsy的身份驗證。

  2. 獲取範圍使用此API調用https://openapi.etsy.com/v2/oauth/scopes

這些工作fine.But同時創造上市我得到下面的錯誤。

"Invalid auth/bad request (got a 403, expected HTTP/1.1 20X or a redirect)" 

3.過程中,我遵循的創造上市

$url = "https://openapi.etsy.com/v2/listings/"; 

    $params = array('description' => 'thisisdesc', 'price'=>'1.00', 'quantity'=>'2', 'title'=>'thisistitle', 'who_made'=>'collective', 'is_supply'=>'false','when_made'=>'2010_2015', 'category_id' => '69105467','shipping_template_id' => '110906760173'); 
    $data = $oauth->fetch($url, $params , OAUTH_HTTP_METHOD_POST); 
    $json = $oauth->getLastResponse(); 
    print_r($json); 

它顯示錯誤message.Invalid認證/錯誤的請求。

任何想法/建議請。

回答

0

變化

$url = "https://openapi.etsy.com/v2/listings/"; 

$url = "https://openapi.etsy.com/v2/listings"; 

額外的/在年底可能會導致問題

你可以嘗試去掉「/」,如果可能的顯示響應的詳情。