Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST_PRODUCT_DATA ERROR 'invalid input' #13

Open
AteqEjaz opened this issue Oct 6, 2021 · 1 comment
Open

POST_PRODUCT_DATA ERROR 'invalid input' #13

AteqEjaz opened this issue Oct 6, 2021 · 1 comment

Comments

@AteqEjaz
Copy link

AteqEjaz commented Oct 6, 2021

Hi @ericcj ,

i'm always getting following error while trying to upload product data, your example in the READ ME fails at the following line

Authorization code works correctly (All the steps you mentioned in the readme related to auth are working)

feeds = AmzSpApi::FeedsApiModel::FeedsApi.new(AmzSpApi::SpApiClient.new)

response = feeds.create_feed_document({"contentType" => 'text/xml; charset=utf-8'})

feed_document_id = response&.payload&.dig(:feedDocumentId)

my_feed = [my_product_feed_sample] (https://textdoc.co/MfdpRmb9BKL5TuzA)

encrypted = AmzSpApi.encrypt_feed(my_feed, response.payload)

All Above commands are working fine, Except the one below

response = feeds.create_feed({"feedType" => 'POST_PRODUCT_DATA', "marketplaceIds" => ["A1AM78C64UMOY8"], "inputFeedDocumentId" => feed_document_id})

ERROR:

Connection #1 to host sellingpartnerapi-na.amazon.com left intact
ETHON: performed EASY effective_url=https://sellingpartnerapi-na.amazon.com/feeds/2020-09-04/feeds 
response_code=400 return_code=ok total_time=0.318291
HTTP response body ~BEGIN~
{
  "errors": [
    {
    "code": "InvalidInput",
  "message": "Invalid Input",
  "details": ""
}
 ]
}
~END~

Also, Can u please point the correct product XML schema (working sample plz if you have)

Thanks so much :)

@mendywoly
Copy link
Contributor

mendywoly commented Dec 31, 2021

@AteqEjaz Did you ever resolve this?

You need to upload the feed content to the url. It says that step in the comment in the readme.
This step from the readme

# PUT to url with lowercase "content-type" header, it's already pre-signed

Can be something like this

Faraday.put(url, encrypted , {"Content-Type" =>  "text/xml; charset=UTF-8"});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants