amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
618 stars 741 forks source link

"Invalid Input" is not a reasonable error message under any circumstance #372

Closed johnkw closed 6 months ago

johnkw commented 3 years ago

I'm not sure where this belongs, but what does "InvalidInput" "Invalid Input" mean? If I do any POST to /fba/inbound/v0/plans with a body, then the response is:

{ "errors": [ { "code": "InvalidInput", "message": "Invalid Input", "details": "" } ] }

(If there's no HTTP body then the response is different: { "errors": [ { "code": "InvalidInput", "message": " Reason: Country field is missing, Name field is missing, AddressLine1 field is missing.", "details": "" } ] } )

Currently the https://github.com/amzn/selling-partner-api-docs/blob/main/references/fulfillment-inbound-api/fulfillmentInboundV0.md#createinboundshipmentplan documentation doesn't really address 400 errors. It just says "Request has missing or invalid parameters and cannot be parsed." But, "invalid" in what way?

The API needs to be MUCH more specific regarding what it thinks is "Invalid Input" in that error message. Perhaps the documentation could get examples as well though.

On a related note, any additional tips on actually getting /fba/inbound/v0/plans to work would be helpful.

johnkw commented 3 years ago

After stumbling around randomly trying things I happened on a fix to get past "InvalidInput". I was using "content-type: application/x-amz-json-1.0" because that's what Amazon's official examples for signing requests used. Apparently SP-API doesn't like that, but it does like "application/json".

I can't find that documented anywhere, but more importantly the API needs to fix that error message to say something like "Invalid Content-Type header - must be application/json"

johnkw commented 3 years ago

( It seems likely this was the issue in bug amzn/selling-partner-api-models#802 )

johnkw commented 3 years ago

See also bug amzn/selling-partner-api-models#1152.

aibirriaga commented 3 years ago

After stumbling around randomly trying things I happened on a fix to get past "InvalidInput". I was using "content-type: application/x-amz-json-1.0" because that's what Amazon's official examples for signing requests used. Apparently SP-API doesn't like that, but it does like "application/json".

I can't find that documented anywhere, but more importantly the API needs to fix that error message to say something like "Invalid Content-Type header - must be application/json"

Thank you, this was really helpful

l20DfX35JnKBfRn commented 2 years ago

Thank you!

github-actions[bot] commented 1 year ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.

johnkw commented 1 year ago

Please turn this stupid bot off and resolve the github tickets as the actual issues are fixed. @adrian-amz @amazon-auto @chapmanjw @amvreddy-amazon @jenilew @parvathm

NA-Dev commented 1 year ago

This is still an issue and should not be auto-closed. This API is not user friendly and support is lacking.

AlanParr commented 1 year ago

Just burned a day on this when it could've been easily sorted with a decent error message. Thanks @johnkw for posting your solution, no telling how long I would've been banging my head against the wall before I tried that.

cazangabriel commented 1 year ago

how do we up-vote this ??

amazon team, it has been more than 2 years since this has been a problem, how are we supposed to use the API without having access to the actual validation errors on your side ?

any action towards fixing this would be highly appreciated! thanks!

johnkw commented 1 year ago

I was told by the API sales team on a marketing survey, that Amazon was migrating off of using github for issue tracking. The impression I got was that Amazon didn't care about API usability, but the sales person said that was not the reason for the change (but there was no given reason for the change).

github-actions[bot] commented 1 year ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.

johnkw commented 1 year ago

Please turn this horrible bot off and only close the github tickets as the actual issues are fixed. @adrian-amz @amazon-auto @chapmanjw @amvreddy-amazon @jenilew @parvathm

pa1983 commented 1 year ago

Still a problem - {'code': 'InvalidInput', 'message': 'Invalid Input', 'details': ''} is a total of sod all help. Currently migrating my old MWS apps over and keep getting stuck in different places with this same 'error'.

thyagobr commented 11 months ago

I got some text on "details" section. Still cryptic, though. {"code":"InvalidInput","message":"Invalid input","details":"Provided request is invalid. Please check the request."}

Nizhnikovsky commented 9 months ago

Got the same error on sandbox when try to /feeds/2021-06-30/documents with 'text/xml; charset=utf-8' or 'application/json; charset=utf-8' contentType. Cretaed only with 'text/tab-separated-values; charset=UTF-8' contentType. But then had and 403 error when try to upload document.

shreeharsh-a commented 6 months ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.

johnkw commented 6 months ago

This is still the latest release. See https://github.com/amzn/selling-partner-api-models/issues/556#issuecomment-2127634337

Please do not close issues until they're actually fixed. It's extremely counterproductive and confusing. It becomes harder to find the discussion on these critical issues that are still open.

shreeharsh-a commented 6 months ago

Please reach out to developer support so that we can better help you with issues related to SP API.

Note: SP API related issues / troubleshooting support is managed by a different team. We can help if the issue is related to the content published on this repo.

johnkw commented 6 months ago

It would be helpful to leave the bug open until it's fixed, so people know where to look for information on this bug.

menporulporiayalan commented 2 weeks ago

I have received the same error while calling the finances API. I searched all around the internet and I found this in the Amazon sp API documentation. I guess this will be helpful for some.

The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'. Minimum : 1 Maximum : 100