Closed stravas closed 9 years ago
ok i'm not this deep in ruby to see the mistake in the code. Here is the response:
<?xml version="1.0"?>
<ErrorResponse xmlns="http://mws.amazonaws.com/doc/2009-01-01/">
<Error>
<Type>Sender</Type>
<Code>InvalidRequest</Code>
<Message>parameter MWSAuthToken failed a validation check: value cannot be empty</Message>
<Detail/>
</Error>
<RequestID>ce914bb0-b4ce-416e-9414-e914752d8e6c</RequestID>
</ErrorResponse>
I'm assuming the credentials belong to a seller who's using your app? You now need to provide an MWSAuthToken
for them with the request.
The older Peddler version should fail as well. I have no idea why if it indeed is not.
is this what you mean?
If you are creating a client for another seller, pass the latter's MWSAuthToken to the client.
client.auth_token = "corge"
Yes. Is this the culprit?
what do I have to write in there instead of "corge"?
I thought I should get the auth_token from seller with client.get_auth_token but this only give me another bad request(400).
The message look like this
<?xml version=\"1.0\"?>
<ErrorResponse xmlns=\"https://mws.amazonservices.com/Sellers/2011-07-01\">
<Error>
<Type>Sender</Type>
<Code>InvalidParameterValue</Code>
<Message>Cannot request MWSAuthToken for own account</Message>
</Error>
<RequestId>109606f4-9f73-4c92-8afb-b1aac4b6b759</RequestId>
</ErrorResponse>
and how should the inkove look like after that? maybe like this?
client.auth_token.submit_feed(latin_1_string, '_POST_FLAT_FILE_LISTINGS_DATA_').parse
I've got it !!!
auth_thoken was the culprit. Just before you use the client you have to do this:
client.auth_token = "something"
client.submit_feed(latin_1_string, '_POST_FLAT_FILE_LISTINGS_DATA_').parse
Thanks a lot
PS: I appreciate you work hakanensari. This code saved me very much time in the fight with Amazon MWS.
:+1:
Hello there,
I've got the issue that i get a bad request error during submit_feed . The curious thing is that the same process work in version 0.9.2. Now i'm using version 0.16.0
I've used this to make a new client:
Then I create my latin1 string to set it in the first parameter(feed_content) of method "submit feed" and set as second paramter the feed_type:
The trace look like this:
This worked fine in peddler version 0.9.2 except that i used marketplace_id in client instead of primary_marketplace_id. This was the only thing i've changed after update to 0.16.0. But now i only get the bad request exception. I've also tried on different marketplaces but always with the same result.
Maybe i miss something.
Thanks for helping.