I'm trying to add an image along with a new listing to my Etsy account through a web application that I'm developing. Currently, I am using:
RestRequest request = new RestRequest("listings", Method.POST);
request.AddFile("image", ReadToEnd(o.mainPhoto), "test.bmp", "image/bmp");
request.AddParameter("image", "test.bmp");
request.AddParameter("title", "This is a test");
request.AddParameter("description", "Test Description");
request.AddParameter("status", "draft");
request.AddParameter("quantity", "1");
request.AddParameter("price", "5");
request.AddParameter("is_supply", "false");
request.AddParameter("category_id", "68887420");
request.AddParameter("when_made", "2013");
request.AddParameter("who_made", "i_did");
request.AddParameter("shipping_template_id", 5463224);
var etsyResponse = restClient.Execute<EtsyListing>(request);
The listing is created correctly except there is no image.
I noticed that the etsyResponse has content containing information regarding the image uploaded (i.e. size, name, etc..) including a "tmp_name" created for the image. Should I be associating the listing with the "tmp_name" from the etsyResponse instead of the uploaded name of the file?
Any help is appreciated.