我正在编写一个用于管理Etsy列表的Mac应用程序。我正在使用objective-c和OauthConsumer库。
我已成功获取身份验证令牌并检索了列表和类别。
现在我要创建一个列表。我创建了一个字典,其中包含测试所需的最少字段。
这是调试输出。我刚刚修改了oauth_token。
你能看到这个问题吗?感谢
2016-08-28 12:31:09.042商品[32465:16639890] listingDictionary:{
params = {
"category_id" = 323;
description = "testing - not for sale";
"is_supply" = false;
price = 3000;
quantity = 1;
title = "testing - not for sale";
"when_made" = 1920s;
"who_made" = "someone_else";
};
}
2016-08-28 12:31:09.042商品[32465:16639890] jsonString:{" params":{" title":"测试 - 非卖品和#34;" when_made":" 20世纪20年代"" who_made":" someone_else""量":& #34; 1"" is_supply":"假""价格":" 3000"" CATEGORY_ID&# 34;:" 323","说明":"测试 - 非卖品"}}
2016-08-28 12:31:12.475商品[32465:16639890] urlString:https://openapi.etsy.com/v2/listings/
2016-08-28 12:31:12.476商品[32465:16639890]要求:网址:https://openapi.etsy.com/v2/listings/
allHTTPHeaderFields:{
Authorization = "OAuth realm=\"\", oauth_consumer_key=\"b2ttpixxxxxxxxnciaubi8\", oauth_token=\"xxxxxxxxxxxx\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"NHSLUPAZyrtOrEI%2BAQCV9w74%2BIc%3D\", oauth_timestamp=\"1472409072\", oauth_nonce=\"BF3E6982-695E-4EF4-AD70-BDF8A401A65B\", oauth_version=\"1.0\"";
method = createListing;
}
_signatureBaseString:POST& https%3A%2F%2Fopenapi.etsy.com%2Fv2%2Flistings%2F& oauth_consumer_key%3Db2ttpia1jk3j2ijhnciaubi8%26oauth_nonce%3DBF3E6982-695E-4EF4-AD70-BDF8A401A65B%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1472409072 %26oauth_token%3D840f745e22136b6351500b567ee6c9%26oauth_version%3D1.0
2016-08-28 12:31:12.476商品[32465:16639890] configuration.HTTPAdditionalHeaders:(null)
2016-08-28 12:31:12.477商品[32465:16639890] etsyItem:
2016-08-28 12:31:13.069商品[32465:16640021] statusCode:403
2016-08-28 12:31:13.069商品[32465:16640021] hTTPURLResponse.allHeaderFields:{
"Cache-Control" = private;
Connection = close;
"Content-Length" = 766;
"Content-Type" = "text/plain;charset=UTF-8";
Date = "Sun, 28 Aug 2016 18:31:13 GMT";
Server = Apache;
"X-Cnection" = close;
"X-Error-Detail" = "oauth_problem=signature_invalid&debug_sbs=POST&https%3A%2F%2Fopenapi.etsy.com%2Fv2%2Flistings%2F&oauth_consumer_key%3Db2ttpia1jk3j2ijhnciaubi8%26oauth_nonce%3DBF3E6982-695E-4EF4-AD70-BDF8A401A65B%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1472409072%26oauth_token%3D840f745e22136b6351500b567ee6c9%26oauth_version%3D1.0%26%257B%2522params%2522%253A%257B%2522title%2522%253A%2522testing_-_not_for_sale%2522%252C%2522when_made%2522%253A%25221920s%2522%252C%2522who_made%2522%253A%2522someone_else%2522%252C%2522quantity%2522%253A%25221%2522%252C%2522is_supply%2522%253A%2522false%2522%252C%2522price%2522%253A%25223000%2522%252C%2522category_id%2522%253A%2522323%2522%252C%2522description%2522%253A%2522testing_-_not_for_sale%2522%257D%257D%3D";
"X-Etsy-Request-Uuid" = 084ELjPQBbhJzUjLaOa3XxHVfwSh;
}
答案 0 :(得分:-1)
您是否尝试将shipping_template_id添加到参数中的配置?我在上面看不到它
我有类似的问题,但错误消息告诉我shipping_template_id丢失了。
创建一个新的清单。注意:当需要shipping_template_id时 创建一个列表。注意:www.etsy.com上创建的所有列表必须是 实际待售物品。请参阅我们的实时测试指南 列表。
此外,我不确定您的请求网址是否是etsy 寻找。这是我用作基本URL的示例 https://openapi.etsy.com/v2/listings
在我的发布网址设置之后,我将添加以下参数以满足最低要求:
如果这有帮助,请告诉我,我有一些例子,但它们都是基于Java的。确保您使用发布请求,如果错误消息没有更改,那么我们需要查看您的身份验证代码,以确保在发出请求之前获取正确的令牌。