lineofflight / peddler

Amazon Selling Partner API (SP-API) in Ruby
https://lineofflight.github.io/peddler/
MIT License
307 stars 130 forks source link

Flat Files being interpreted as XML files #57

Closed CodySwannGT closed 8 years ago

CodySwannGT commented 8 years ago

I'm using the following to upload a tab delimited text file

def upload
  file = open('http://simplrmarketr.com/products/amazon.txt')

  contents = file.read

  client = MWS.feeds
  result = client.submit_feed(contents, "_POST_PRODUCT_DATA_", {})

  puts result.parse
end

However, when I check the results, I get the following error:

<ResultDescription>XML Parsing Fatal Error at Line 1, Column 1: Content is not allowed in prolog. Content is not allowed in prolog.</ResultDescription>

Very interested in making this work any pointers would be greatly appreciated.

CodySwannGT commented 8 years ago

Ah - got it.

Use "_POST_FLAT_FILE_LISTINGSDATA" instead of "_POST_PRODUCTDATA"