-
Notifications
You must be signed in to change notification settings - Fork 228
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
Empty objects from readme example code #186
Comments
I'd recommend using the official MWS docs (http://docs.developer.amazonservices.com/en_US/products/index.html) as your source of truth for how it all works. Pretty much every call you'll find there will have a corresponding class in this library, usually with an identical name, and you can find the parameters needed and response format in the MWS docs. |
Yes, the official MWS API documentation is the best way to learn about everything the API is capable of. The documentation in this library explains how to write use the classes in code and that's about it. It would be redundant for this library to explain the API itself or the underlying Amazon business processes when Amazon already has that information available. As for the sample code, did you set up your configuration file first? If so, did you check the log messages generated by the request? That should give you all of the information you need. |
@joe-pritchard Thanks for responding! Yeah we are using it now, trying to find their counterparts in this library and test their usage as you suggested which seems like the logical path. We thought maybe there would be a documentation with more examples or something as other packages do, bu it does makes sense the way you put it. @Peardian Indeed it is, we have tried some calls and we are getting an error like this in the example snippet:
Tried to change the credentials to no avail, and the MWS scratch pad works perfectly fine with it. Is there maybe a dependency that got updated or something? Thanks for everything!! |
Strange, I have never encountered that error before. The library only relies on PHP's cURL extension, and the sample code still works fine for me in PHP 7.2.19, so I am not sure what the problem could be. What version of PHP are you using? It sounds like the error is related to the request parameters. You can see what parameters are set to by using the |
@Peardian I did try this, it does give an interesting amount of data out which i could compare and make sure it was correct. I ran some more tests using the basic example, i started getting this "empty" response.
Im assuming those are the orders, but somehow the bodies are not being correctly fetched. I am using also this package: https://github.com/keithbrink/amazon-mws-laravel which gives a 400 error, with a totally empty object, however it claims to be a simple fork with laravel integration. By reading the libraries involved in this process it does seem to be verbatim to these, however the error persists. The amount of anomalies makes me suspect something changed in their API responses, however it seems unlikely since i cant find any changes documented. This, or we are not grasping something super essential about the package. EDIT: We also suspect that maybe, we are missing some php extension that we cannot find listed anywhere? As reference, we use the laravel homestead vagrant image. EDIT2: I noticed that the "AmazonOrder" classes that are collected and ultimately output in the getList() method are filled with the correct information, but are not outputting anything, hence the empty objects by just copy pasting the code and running it. If someone gets stuck in this very same problem (or confused integration) you simply have to use the "getData" method on each other to obtain an array that you can work with.
|
I don't know what method you are using for getting output from the objects, nor do I have any experience with the Laravel fork, but it sounds like the code is working otherwise. |
Indeed it works, the fact that the example code would output empty objects was quite confusing at first tho.
The response from everyone was amazing and i hope others with the same problem can find this thread useful.
… On Jul 23, 2019, at 9:57 AM, Thomas Hernandez ***@***.***> wrote:
I don't know what method you are using for getting output from the objects, nor do I have any experience with the Laravel fork, but it sounds like the code is working otherwise.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@Delindel I am also using this package: https://github.com/keithbrink/amazon-mws-laravel which gives a 400 error, with a totally empty object, I need to get amazon order list created in last 30 days.
Can you please help how did you solve it? Is it working after changing credentials to no avail? How can I do that? |
Hey!
I did verify that all my credentials were being passed along in the AmazonOrderList object.
Try the following:
- Check the log output of the package. I use Laravel so it went to their logs, yours might be at php-error.log
- Dump the instanced AmazonOrderList and check that your credentials are correct for the requested action.
The package returns an empty object when it finds an error in the request, so the log seems the best shot from here.
Cheers!
… On Aug 10, 2019, at 12:58 AM, Dhaval Patel ***@***.***> wrote:
@Delindel I am also using this package: https://github.com/keithbrink/amazon-mws-laravel which gives a 400 error, with a totally empty object, I need to get amazon order list created in last 30 days.
$orderList = new AmazonOrderList("store1");
$orderList->setLimits('Created','- 30 days');
$orderList->setFulfillmentChannelFilter("MFN");
$orderList->setOrderStatusFilter(array("Unshipped", "PartiallyShipped", "Canceled", "Unfulfillable"));
$orderList->setUseToken();
$orderList->fetchOrders();
return $orderList->getList();
Can you please help how did you solve it? Is it working after changing credentials to no avail? How can I do that?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hey! @Delindel, Thanks for responding I'm also using Laravel and I checked the Laravel log it's this one
I'm confused because my credentials working fine for
Does that method requires additional credentials? |
Nope, which package are you using? I had that problem with the one that says “forked from forked from forked from”.
Use the sonnenglas/amazon-mws-laravel package, i already finished and deployed a solution using it since my second last post in this thread.
Let me know if that helps ya!
… On Aug 10, 2019, at 5:08 AM, Dhaval Patel ***@***.***> wrote:
Hey! @Delindel, Thanks for responding I'm also using Laravel and I checked the Laravel log it's this one
[2019-08-10 05:52:36] local.INFO: Making request to Amazon: ListOrders
[2019-08-10 05:52:38] local.ERROR: Bad Response! 400 Bad Request: MalformedInput - Start of list found where not expected
I'm confused because my credentials working fine for AmazonProductInfo but it doesn't work for AmazonOrderList.
I've got these credentials
'store1' => [
'merchantId' => env('mwsMerchantId'),
'marketplaceId' => env('mwsMarketplaceId'),
'keyId' => env('mwsKeyId'),
'secretKey' => env('mwsSecretKey'),
'mwsAuthToken' => env('mwsAuthToken'),
'amazonServiceUrl' => env('mwsAmazonServiceUrl'),
'muteLog' => env('mwsMuteLog', false),
],
Does that method requires additional credentials?
Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi @Delindel This package https://github.com/sonnenglas/amazon-mws-laravel works great with the same method |
Great to know!! Glad you got it working.
… On Aug 11, 2019, at 11:57 PM, Dhaval Patel ***@***.***> wrote:
Hi @Delindel This package https://github.com/sonnenglas/amazon-mws-laravel works great with the same method
Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Found this issue while researching a fix...y'all should have opened an issue! Anyways, this is fixed in my fork now (version 7.1.0), turns out you can't have the root marketplaceId AND the marketplaceId.Id.1 parameter set. |
Hey! This looks like an amazing package, however we are having a really hard time guessing around all the classes around and testing their usage.
The basic example at the readme does not work for us either, only returns a blank empty object.
Any advice?
Thanks!
The text was updated successfully, but these errors were encountered: