0

I am writing a Mac app for managing Etsy listings. I am using objective-c and the OauthConsumer library.

I have successfully gotten the auth token and retrieved listings and categories.

Now I want to create a listing. I create a dictionary with the minimum required fields for testing.

Here is the debug output. I just modified the oauth_token.

Can you see the issue? Thanks

2016-08-28 12:31:09.042 Goods[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 Goods[32465:16639890] jsonString: {"params":{"title":"testing - not for sale","when_made":"1920s","who_made":"someone_else","quantity":"1","is_supply":"false","price":"3000","category_id":"323","description":"testing - not for sale"}}

2016-08-28 12:31:12.475 Goods[32465:16639890] urlString: https://openapi.etsy.com/v2/listings/

2016-08-28 12:31:12.476 Goods[32465:16639890] request: url: 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 Goods[32465:16639890] configuration.HTTPAdditionalHeaders: (null)

2016-08-28 12:31:12.477 Goods[32465:16639890] etsyItem:

2016-08-28 12:31:13.069 Goods[32465:16640021] statusCode: 403

2016-08-28 12:31:13.069 Goods[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;

}

Rick Schlueter
  • 141
  • 1
  • 10

1 Answers1

-1

Have you tried adding the shipping_template_id to your configuration in the params? I don't see it in the above

I had a similar issue but the error message told me the shipping_template_id was missing.

Creates a new Listing. NOTE: A shipping_template_id is required when creating a listing. NOTE: All listings created on www.etsy.com must be actual items for sale. Please see our guidelines for testing with live listings.

Also I'm not sure if your request url is the one etsy is looking for. Here is an example of what I used as a base url https://openapi.etsy.com/v2/listings

After I have my post url setup I then add the following params for the bare min requirements:

  • shipping_template_id
  • List item
  • title
  • description
  • price
  • who_made
  • is_supply
  • state IMPORTANT this is not required but will create the item in active state. For testing I always set the state to draft so it will not charge the shop activation fee.

Let me know if this helps, I have examples but they are based in Java. Make sure you using a post request and if the error message does not change then we need to look at your auth code to make sure its getting the proper token before making the post request.

Adam Dale
  • 11
  • 2