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

No Data Returned #745

Closed
danielbarenkamp opened this issue Jun 26, 2024 · 2 comments
Closed

No Data Returned #745

danielbarenkamp opened this issue Jun 26, 2024 · 2 comments

Comments

@danielbarenkamp
Copy link

Problem description:

Thank you very much for this library at all. Now I have upgraded from version 5 to 7 and adjusted my script. But I get no Data. All I get is a long Saloon\Http\Response Object, but amazon data is missing at all. There are also no errors in the code or response.

Tested with postman locally and all works with the access data.

I see in the request is a "accessToken" and "refreshToken". I can only set one, maybe this is the error?

Error:

No Amazon Data returned

Your error here. PLEASE make sure to redact secrets from your error log!

No Amazon Data returned

Code

<?php

use SellingPartnerApi\SellingPartnerApi;
use SellingPartnerApi\Enums\Endpoint;

use Saloon\Http\Response;
use Saloon\Http\PendingRequest;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;

require_once(__DIR__ . '/vendor/autoload.php');

$connector = SellingPartnerApi::seller(
    clientId :  'XX',
    clientSecret :  'XX',
    refreshToken :  'Atzr|IXX',
    endpoint :  Endpoint::EU,
);


$catalogItemsApi = $connector->catalogItemsV20220401();

$asin = 'B0725Z8ZDY';
$marketplace_ids = array('A1PA6795UKMFR9');
$included_data = array('summaries');
$locale = 'en_US';

try {
    $result = $catalogItemsApi->getCatalogItem($asin, $marketplace_ids, $included_data, $locale);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogItemsV20220401Api->getCatalogItem: ', $e->getMessage(), PHP_EOL;
}

Response object


Saloon\Http\Response Object
(
    [psrRequest:protected] => GuzzleHttp\Psr7\Request Object
        (
            [method:GuzzleHttp\Psr7\Request:private] => GET
            [requestTarget:GuzzleHttp\Psr7\Request:private] => 
            [uri:GuzzleHttp\Psr7\Request:private] => GuzzleHttp\Psr7\Uri Object
                (
                    [scheme:GuzzleHttp\Psr7\Uri:private] => https
                    [userInfo:GuzzleHttp\Psr7\Uri:private] => 
                    [host:GuzzleHttp\Psr7\Uri:private] => sellingpartnerapi-eu.amazon.com
                    [port:GuzzleHttp\Psr7\Uri:private] => 
                    [path:GuzzleHttp\Psr7\Uri:private] => /catalog/2022-04-01/items/B0725Z8ZDY
                    [query:GuzzleHttp\Psr7\Uri:private] => marketplaceIds=A1PA6795UKMFR9&includedData=summaries&locale=en_US
                    [fragment:GuzzleHttp\Psr7\Uri:private] => 
                    [composedComponents:GuzzleHttp\Psr7\Uri:private] => https://sellingpartnerapi-eu.amazon.com/catalog/2022-04-01/items/B0725Z8ZDY?marketplaceIds=A1PA6795UKMFR9&includedData=summaries&locale=en_US
                )

            [headers:GuzzleHttp\Psr7\Request:private] => Array
                (
                    [Host] => Array
                        (
                            [0] => sellingpartnerapi-eu.amazon.com
                        )

                    [Content-Type] => Array
                        (
                            [0] => application/json
                        )

                    [Accept] => Array
                        (
                            [0] => application/json
                        )

                    [X-AMZ-Date] => Array
                        (
                            [0] => 20240626T062108Z
                        )

                    [User-Agent] => Array
                        (
                            [0] => jlevers/selling-partner-api/v7.0.3/php
                        )

                    [X-AMZ-Access-Token] => Array
                        (
                            [0] => XXX
                        )

                )

            [headerNames:GuzzleHttp\Psr7\Request:private] => Array
                (
                    [host] => Host
                    [content-type] => Content-Type
                    [accept] => Accept
                    [x-amz-date] => X-AMZ-Date
                    [user-agent] => User-Agent
                    [x-amz-access-token] => X-AMZ-Access-Token
                )

            [protocol:GuzzleHttp\Psr7\Request:private] => 1.1
            [stream:GuzzleHttp\Psr7\Request:private] => GuzzleHttp\Psr7\Stream Object
                (
                    [stream:GuzzleHttp\Psr7\Stream:private] => Resource id #33
                    [size:GuzzleHttp\Psr7\Stream:private] => 0
                    [seekable:GuzzleHttp\Psr7\Stream:private] => 1
                    [readable:GuzzleHttp\Psr7\Stream:private] => 1
                    [writable:GuzzleHttp\Psr7\Stream:private] => 1
                    [uri:GuzzleHttp\Psr7\Stream:private] => php:https://temp
                    [customMetadata:GuzzleHttp\Psr7\Stream:private] => Array
                        (
                        )

                )

        )

    [psrResponse:protected] => GuzzleHttp\Psr7\Response Object
        (
            [reasonPhrase:GuzzleHttp\Psr7\Response:private] => OK
            [statusCode:GuzzleHttp\Psr7\Response:private] => 200
            [headers:GuzzleHttp\Psr7\Response:private] => Array
                (
                    [Server] => Array
                        (
                            [0] => Server
                        )

                    [Date] => Array
                        (
                            [0] => Wed, 26 Jun 2024 06:21:09 GMT
                        )

                    [Content-Type] => Array
                        (
                            [0] => application/json
                        )

                    [Content-Length] => Array
                        (
                            [0] => 719
                        )

                    [Connection] => Array
                        (
                            [0] => keep-alive
                        )

                    [x-amz-rid] => Array
                        (
                            [0] => V6QYCZ11NNF8Z92PCRRX
                        )

                    [x-amzn-RateLimit-Limit] => Array
                        (
                            [0] => 2.0
                        )

                    [x-amzn-RequestId] => Array
                        (
                            [0] => 5b3f9f23-17c2-4715-a7fc-32aa04bfd405
                        )

                    [x-amz-apigw-id] => Array
                        (
                            [0] => OPF5b3f9f2317c2
                        )

                    [X-Amzn-Trace-Id] => Array
                        (
                            [0] => Root=1-667bb355-5b3f9f2317c24715
                        )

                    [Vary] => Array
                        (
                            [0] => Content-Type,Accept-Encoding,User-Agent
                        )

                    [Strict-Transport-Security] => Array
                        (
                            [0] => max-age=47474747; includeSubDomains; preload
                        )

                )

            [headerNames:GuzzleHttp\Psr7\Response:private] => Array
                (
                    [server] => Server
                    [date] => Date
                    [content-type] => Content-Type
                    [content-length] => Content-Length
                    [connection] => Connection
                    [x-amz-rid] => x-amz-rid
                    [x-amzn-ratelimit-limit] => x-amzn-RateLimit-Limit
                    [x-amzn-requestid] => x-amzn-RequestId
                    [x-amz-apigw-id] => x-amz-apigw-id
                    [x-amzn-trace-id] => X-Amzn-Trace-Id
                    [vary] => Vary
                    [strict-transport-security] => Strict-Transport-Security
                )

            [protocol:GuzzleHttp\Psr7\Response:private] => 1.1
            [stream:GuzzleHttp\Psr7\Response:private] => GuzzleHttp\Psr7\Stream Object
                (
                    [stream:GuzzleHttp\Psr7\Stream:private] => Resource id #35
                    [size:GuzzleHttp\Psr7\Stream:private] => 
                    [seekable:GuzzleHttp\Psr7\Stream:private] => 1
                    [readable:GuzzleHttp\Psr7\Stream:private] => 1
                    [writable:GuzzleHttp\Psr7\Stream:private] => 1
                    [uri:GuzzleHttp\Psr7\Stream:private] => php:https://temp
                    [customMetadata:GuzzleHttp\Psr7\Stream:private] => Array
                        (
                        )

                )

        )

    [pendingRequest:protected] => Saloon\Http\PendingRequest Object
        (
            [connector:protected] => SellingPartnerApi\Seller\SellerConnector Object
                (
                    [authenticator:protected] => 
                    [headers:protected] => Saloon\Repositories\ArrayStore Object
                        (
                            [data:protected] => Array
                                (
                                    [Content-Type] => application/json
                                    [Accept] => application/json
                                    [X-AMZ-Date] => 20240626T062108Z
                                    [User-Agent] => jlevers/selling-partner-api/v7.0.3/php
                                    [Host] => sellingpartnerapi-eu.amazon.com
                                )

                        )

                    [query:protected] => Saloon\Repositories\ArrayStore Object
                        (
                            [data:protected] => Array
                                (
                                )

                        )

                    [config:protected] => Saloon\Repositories\ArrayStore Object
                        (
                            [data:protected] => Array
                                (
                                )

                        )

                    [middlewarePipeline:protected] => Saloon\Helpers\MiddlewarePipeline Object
                        (
                            [requestPipeline:protected] => Saloon\Helpers\Pipeline Object
                                (
                                    [pipes:protected] => Array
                                        (
                                        )

                                )

                            [responsePipeline:protected] => Saloon\Helpers\Pipeline Object
                                (
                                    [pipes:protected] => Array
                                        (
                                        )

                                )

                        )

                    [delay:protected] => Saloon\Repositories\IntegerStore Object
                        (
                            [data:protected] => 
                        )

                    [response:protected] => 
                    [mockClient:protected] => 
                    [defaultSender:protected] => 
                    [sender:protected] => Saloon\Http\Senders\GuzzleSender Object
                        (
                            [client:protected] => GuzzleHttp\Client Object
                                (
                                    [config:GuzzleHttp\Client:private] => Array
                                        (
                                            [crypto_method] => 33
                                            [connect_timeout] => 10
                                            [timeout] => 30
                                            [http_errors] => 1
                                            [handler] => GuzzleHttp\HandlerStack Object
                                                (
                                                    [handler:GuzzleHttp\HandlerStack:private] => Closure Object
                                                        (
                                                            [static] => Array
                                                                (
                                                                    [default] => GuzzleHttp\Handler\CurlMultiHandler Object
                                                                        (
                                                                            [factory:GuzzleHttp\Handler\CurlMultiHandler:private] => GuzzleHttp\Handler\CurlFactory Object
                                                                                (
                                                                                    [handles:GuzzleHttp\Handler\CurlFactory:private] => Array
                                                                                        (
                                                                                        )

                                                                                    [maxHandles:GuzzleHttp\Handler\CurlFactory:private] => 50
                                                                                )

                                                                            [selectTimeout:GuzzleHttp\Handler\CurlMultiHandler:private] => 1
                                                                            [active:GuzzleHttp\Handler\CurlMultiHandler:private] => 0
                                                                            [handles:GuzzleHttp\Handler\CurlMultiHandler:private] => Array
                                                                                (
                                                                                )

                                                                            [delays:GuzzleHttp\Handler\CurlMultiHandler:private] => Array
                                                                                (
                                                                                )

                                                                            [options:GuzzleHttp\Handler\CurlMultiHandler:private] => Array
                                                                                (
                                                                                )

                                                                        )

                                                                    [sync] => GuzzleHttp\Handler\CurlHandler Object
                                                                        (
                                                                            [factory:GuzzleHttp\Handler\CurlHandler:private] => GuzzleHttp\Handler\CurlFactory Object
                                                                                (
                                                                                    [handles:GuzzleHttp\Handler\CurlFactory:private] => Array
                                                                                        (
                                                                                            [0] => CurlHandle Object
                                                                                                (
                                                                                                )

                                                                                        )

                                                                                    [maxHandles:GuzzleHttp\Handler\CurlFactory:private] => 3
                                                                                )

                                                                        )

                                                                )

                                                            [parameter] => Array
                                                                (
                                                                    [$request] => <required>
                                                                    [$options] => <required>
                                                                )

                                                        )

                                                    [stack:GuzzleHttp\HandlerStack:private] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [0] => Closure Object
                                                                        (
                                                                            [static] => Array
                                                                                (
                                                                                    [bodySummarizer] => 
                                                                                )

                                                                            [parameter] => Array
                                                                                (
                                                                                    [$handler] => <required>
                                                                                )

                                                                        )

                                                                    [1] => http_errors
                                                                )

                                                            [1] => Array
                                                                (
                                                                    [0] => Closure Object
                                                                        (
                                                                            [parameter] => Array
                                                                                (
                                                                                    [$handler] => <required>
                                                                                )

                                                                        )

                                                                    [1] => allow_redirects
                                                                )

                                                            [2] => Array
                                                                (
                                                                    [0] => Closure Object
                                                                        (
                                                                            [parameter] => Array
                                                                                (
                                                                                    [$handler] => <required>
                                                                                )

                                                                        )

                                                                    [1] => cookies
                                                                )

                                                            [3] => Array
                                                                (
                                                                    [0] => Closure Object
                                                                        (
                                                                            [parameter] => Array
                                                                                (
                                                                                    [$handler] => <required>
                                                                                )

                                                                        )

                                                                    [1] => prepare_body
                                                                )

                                                        )

                                                    [cached:GuzzleHttp\HandlerStack:private] => Closure Object
                                                        (
                                                            [static] => Array
                                                                (
                                                                    [handler] => GuzzleHttp\RedirectMiddleware Object
                                                                        (
                                                                            [nextHandler:GuzzleHttp\RedirectMiddleware:private] => Closure Object
                                                                                (
                                                                                    [static] => Array
                                                                                        (
                                                                                            [handler] => GuzzleHttp\PrepareBodyMiddleware Object
                                                                                                (
                                                                                                    [nextHandler:GuzzleHttp\PrepareBodyMiddleware:private] => Closure Object
                                                                                                        (
                                                                                                            [static] => Array
                                                                                                                (
                                                                                                                    [default] => GuzzleHttp\Handler\CurlMultiHandler Object
                                                                                                                        (
                                                                                                                            [factory:GuzzleHttp\Handler\CurlMultiHandler:private] => GuzzleHttp\Handler\CurlFactory Object
                                                                                                                                (
                                                                                                                                    [handles:GuzzleHttp\Handler\CurlFactory:private] => Array
                                                                                                                                        (
                                                                                                                                        )

                                                                                                                                    [maxHandles:GuzzleHttp\Handler\CurlFactory:private] => 50
                                                                                                                                )

                                                                                                                            [selectTimeout:GuzzleHttp\Handler\CurlMultiHandler:private] => 1
                                                                                                                            [active:GuzzleHttp\Handler\CurlMultiHandler:private] => 0
                                                                                                                            [handles:GuzzleHttp\Handler\CurlMultiHandler:private] => Array
                                                                                                                                (
                                                                                                                                )

                                                                                                                            [delays:GuzzleHttp\Handler\CurlMultiHandler:private] => Array
                                                                                                                                (
                                                                                                                                )

                                                                                                                            [options:GuzzleHttp\Handler\CurlMultiHandler:private] => Array
                                                                                                                                (
                                                                                                                                )

                                                                                                                        )

                                                                                                                    [sync] => GuzzleHttp\Handler\CurlHandler Object
                                                                                                                        (
                                                                                                                            [factory:GuzzleHttp\Handler\CurlHandler:private] => GuzzleHttp\Handler\CurlFactory Object
                                                                                                                                (
                                                                                                                                    [handles:GuzzleHttp\Handler\CurlFactory:private] => Array
                                                                                                                                        (
                                                                                                                                            [0] => CurlHandle Object
                                                                                                                                                (
                                                                                                                                                )

                                                                                                                                        )

                                                                                                                                    [maxHandles:GuzzleHttp\Handler\CurlFactory:private] => 3
                                                                                                                                )

                                                                                                                        )

                                                                                                                )

                                                                                                            [parameter] => Array
                                                                                                                (
                                                                                                                    [$request] => <required>
                                                                                                                    [$options] => <required>
                                                                                                                )

                                                                                                        )

                                                                                                )

                                                                                        )

                                                                                    [parameter] => Array
                                                                                        (
                                                                                            [$request] => <required>
                                                                                            [$options] => <required>
                                                                                        )

                                                                                )

                                                                        )

                                                                    [bodySummarizer] => 
                                                                )

                                                            [parameter] => Array
                                                                (
                                                                    [$request] => <required>
                                                                    [$options] => <required>
                                                                )

                                                        )

                                                )

                                            [allow_redirects] => Array
                                                (
                                                    [max] => 5
                                                    [protocols] => Array
                                                        (
                                                            [0] => http
                                                            [1] => https
                                                        )

                                                    [strict] => 
                                                    [referer] => 
                                                    [track_redirects] => 
                                                )

                                            [decode_content] => 1
                                            [verify] => 1
                                            [cookies] => 
                                            [idn_conversion] => 
                                            [headers] => Array
                                                (
                                                    [User-Agent] => GuzzleHttp/7
                                                )

                                        )

                                )

                            [handlerStack:protected] => GuzzleHttp\HandlerStack Object
                                (
                                    [handler:GuzzleHttp\HandlerStack:private] => Closure Object
                                        (
                                            [static] => Array
                                                (
                                                    [default] => GuzzleHttp\Handler\CurlMultiHandler Object
                                                        (
                                                            [factory:GuzzleHttp\Handler\CurlMultiHandler:private] => GuzzleHttp\Handler\CurlFactory Object
                                                                (
                                                                    [handles:GuzzleHttp\Handler\CurlFactory:private] => Array
                                                                        (
                                                                        )

                                                                    [maxHandles:GuzzleHttp\Handler\CurlFactory:private] => 50
                                                                )

                                                            [selectTimeout:GuzzleHttp\Handler\CurlMultiHandler:private] => 1
                                                            [active:GuzzleHttp\Handler\CurlMultiHandler:private] => 0
                                                            [handles:GuzzleHttp\Handler\CurlMultiHandler:private] => Array
                                                                (
                                                                )

                                                            [delays:GuzzleHttp\Handler\CurlMultiHandler:private] => Array
                                                                (
                                                                )

                                                            [options:GuzzleHttp\Handler\CurlMultiHandler:private] => Array
                                                                (
                                                                )

                                                        )

                                                    [sync] => GuzzleHttp\Handler\CurlHandler Object
                                                        (
                                                            [factory:GuzzleHttp\Handler\CurlHandler:private] => GuzzleHttp\Handler\CurlFactory Object
                                                                (
                                                                    [handles:GuzzleHttp\Handler\CurlFactory:private] => Array
                                                                        (
                                                                            [0] => CurlHandle Object
                                                                                (
                                                                                )

                                                                        )

                                                                    [maxHandles:GuzzleHttp\Handler\CurlFactory:private] => 3
                                                                )

                                                        )

                                                )

                                            [parameter] => Array
                                                (
                                                    [$request] => <required>
                                                    [$options] => <required>
                                                )

                                        )

                                    [stack:GuzzleHttp\HandlerStack:private] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [0] => Closure Object
                                                        (
                                                            [static] => Array
                                                                (
                                                                    [bodySummarizer] => 
                                                                )

                                                            [parameter] => Array
                                                                (
                                                                    [$handler] => <required>
                                                                )

                                                        )

                                                    [1] => http_errors
                                                )

                                            [1] => Array
                                                (
                                                    [0] => Closure Object
                                                        (
                                                            [parameter] => Array
                                                                (
                                                                    [$handler] => <required>
                                                                )

                                                        )

                                                    [1] => allow_redirects
                                                )

                                            [2] => Array
                                                (
                                                    [0] => Closure Object
                                                        (
                                                            [parameter] => Array
                                                                (
                                                                    [$handler] => <required>
                                                                )

                                                        )

                                                    [1] => cookies
                                                )

                                            [3] => Array
                                                (
                                                    [0] => Closure Object
                                                        (
                                                            [parameter] => Array
                                                                (
                                                                    [$handler] => <required>
                                                                )

                                                        )

                                                    [1] => prepare_body
                                                )

                                        )

                                    [cached:GuzzleHttp\HandlerStack:private] => Closure Object
                                        (
                                            [static] => Array
                                                (
                                                    [handler] => GuzzleHttp\RedirectMiddleware Object
                                                        (
                                                            [nextHandler:GuzzleHttp\RedirectMiddleware:private] => Closure Object
                                                                (
                                                                    [static] => Array
                                                                        (
                                                                            [handler] => GuzzleHttp\PrepareBodyMiddleware Object
                                                                                (
                                                                                    [nextHandler:GuzzleHttp\PrepareBodyMiddleware:private] => Closure Object
                                                                                        (
                                                                                            [static] => Array
                                                                                                (
                                                                                                    [default] => GuzzleHttp\Handler\CurlMultiHandler Object
                                                                                                        (
                                                                                                            [factory:GuzzleHttp\Handler\CurlMultiHandler:private] => GuzzleHttp\Handler\CurlFactory Object
                                                                                                                (
                                                                                                                    [handles:GuzzleHttp\Handler\CurlFactory:private] => Array
                                                                                                                        (
                                                                                                                        )

                                                                                                                    [maxHandles:GuzzleHttp\Handler\CurlFactory:private] => 50
                                                                                                                )

                                                                                                            [selectTimeout:GuzzleHttp\Handler\CurlMultiHandler:private] => 1
                                                                                                            [active:GuzzleHttp\Handler\CurlMultiHandler:private] => 0
                                                                                                            [handles:GuzzleHttp\Handler\CurlMultiHandler:private] => Array
                                                                                                                (
                                                                                                                )

                                                                                                            [delays:GuzzleHttp\Handler\CurlMultiHandler:private] => Array
                                                                                                                (
                                                                                                                )

                                                                                                            [options:GuzzleHttp\Handler\CurlMultiHandler:private] => Array
                                                                                                                (
                                                                                                                )

                                                                                                        )

                                                                                                    [sync] => GuzzleHttp\Handler\CurlHandler Object
                                                                                                        (
                                                                                                            [factory:GuzzleHttp\Handler\CurlHandler:private] => GuzzleHttp\Handler\CurlFactory Object
                                                                                                                (
                                                                                                                    [handles:GuzzleHttp\Handler\CurlFactory:private] => Array
                                                                                                                        (
                                                                                                                            [0] => CurlHandle Object
                                                                                                                                (
                                                                                                                                )

                                                                                                                        )

                                                                                                                    [maxHandles:GuzzleHttp\Handler\CurlFactory:private] => 3
                                                                                                                )

                                                                                                        )

                                                                                                )

                                                                                            [parameter] => Array
                                                                                                (
                                                                                                    [$request] => <required>
                                                                                                    [$options] => <required>
                                                                                                )

                                                                                        )

                                                                                )

                                                                        )

                                                                    [parameter] => Array
                                                                        (
                                                                            [$request] => <required>
                                                                            [$options] => <required>
                                                                        )

                                                                )

                                                        )

                                                    [bodySummarizer] => 
                                                )

                                            [parameter] => Array
                                                (
                                                    [$request] => <required>
                                                    [$options] => <required>
                                                )

                                        )

                                )

                        )

                    [tries] => 
                    [retryInterval] => 
                    [useExponentialBackoff] => 
                    [throwOnMaxTries] => 
                    [tokensApi:protected] => SellingPartnerApi\Seller\TokensV20210301\Api Object
                        (
                            [connector:protected] => SellingPartnerApi\Seller\SellerConnector Object
 *RECURSION*
                        )

                    [userAgent:protected] => jlevers/selling-partner-api/v7.0.3/php
                    [clientId] => XXX
                    [clientSecret] => XXX
                    [refreshToken] => XXX
                    [endpoint] => SellingPartnerApi\Enums\Endpoint Enum:string
                        (
                            [name] => EU
                            [value] => https://sellingpartnerapi-eu.amazon.com
                        )

                    [dataElements] => Array
                        (
                        )

                    [delegatee] => 
                    [authenticationClient] => 
                    [cache] => SellingPartnerApi\Authentication\InMemoryTokenCache Object
                        (
                        )

                    [oauthConfig:protected] => Saloon\Helpers\OAuth2\OAuthConfig Object
                        (
                            [clientId:protected] => XXX
                            [clientSecret:protected] => XXX
                            [redirectUri:protected] => 
                            [authorizeEndpoint:protected] => authorize
                            [tokenEndpoint:protected] => https://api.amazon.com/auth/o2/token
                            [userEndpoint:protected] => user
                            [requestModifier:protected] => 
                            [defaultScopes:protected] => Array
                                (
                                )

                        )

                )

            [request:protected] => SellingPartnerApi\Seller\CatalogItemsV20220401\Requests\GetCatalogItem Object
                (
                    [method:protected] => Saloon\Enums\Method Enum:string
                        (
                            [name] => GET
                            [value] => GET
                        )

                    [authenticator:protected] => 
                    [headers:protected] => Saloon\Repositories\ArrayStore Object
                        (
                            [data:protected] => Array
                                (
                                )

                        )

                    [query:protected] => Saloon\Repositories\ArrayStore Object
                        (
                            [data:protected] => Array
                                (
                                    [marketplaceIds] => Array
                                        (
                                            [0] => A1PA6795UKMFR9
                                        )

                                    [includedData] => Array
                                        (
                                            [0] => summaries
                                        )

                                    [locale] => en_US
                                )

                        )

                    [config:protected] => Saloon\Repositories\ArrayStore Object
                        (
                            [data:protected] => Array
                                (
                                )

                        )

                    [middlewarePipeline:protected] => Saloon\Helpers\MiddlewarePipeline Object
                        (
                            [requestPipeline:protected] => Saloon\Helpers\Pipeline Object
                                (
                                    [pipes:protected] => Array
                                        (
                                        )

                                )

                            [responsePipeline:protected] => Saloon\Helpers\Pipeline Object
                                (
                                    [pipes:protected] => Array
                                        (
                                        )

                                )

                        )

                    [delay:protected] => Saloon\Repositories\IntegerStore Object
                        (
                            [data:protected] => 
                        )

                    [response:protected] => 
                    [mockClient:protected] => 
                    [tries] => 
                    [retryInterval] => 
                    [useExponentialBackoff] => 
                    [throwOnMaxTries] => 
                    [asin:protected] => B0725Z8ZDY
                    [marketplaceIds:protected] => Array
                        (
                            [0] => A1PA6795UKMFR9
                        )

                    [includedData:protected] => Array
                        (
                            [0] => summaries
                        )

                    [locale:protected] => en_US
                )

            [method:protected] => Saloon\Enums\Method Enum:string
                (
                    [name] => GET
                    [value] => GET
                )

            [url:protected] => https://sellingpartnerapi-eu.amazon.com/catalog/2022-04-01/items/B0725Z8ZDY
            [body:protected] => 
            [fakeResponse:protected] => 
            [asynchronous:protected] => 
            [authenticator:protected] => SellingPartnerApi\Authentication\AccessTokenAuthenticator Object
                (
                    [accessToken] => XXX
                    [refreshToken] => XXX
                    [expiresAt] => DateTimeImmutable Object
                        (
                            [date] => 2024-06-26 09:21:09.209764
                            [timezone_type] => 3
                            [timezone] => Europe/Berlin
                        )

                )

            [headers:protected] => Saloon\Repositories\ArrayStore Object
                (
                    [data:protected] => Array
                        (
                            [Content-Type] => application/json
                            [Accept] => application/json
                            [X-AMZ-Date] => 20240626T062108Z
                            [User-Agent] => jlevers/selling-partner-api/v7.0.3/php
                            [Host] => sellingpartnerapi-eu.amazon.com
                            [X-AMZ-Access-Token] => XXX
                        )

                )

            [query:protected] => Saloon\Repositories\ArrayStore Object
                (
                    [data:protected] => Array
                        (
                            [marketplaceIds] => Array
                                (
                                    [0] => A1PA6795UKMFR9
                                )

                            [includedData] => Array
                                (
                                    [0] => summaries
                                )

                            [locale] => en_US
                        )

                )

            [config:protected] => Saloon\Repositories\ArrayStore Object
                (
                    [data:protected] => Array
                        (
                        )

                )

            [middlewarePipeline:protected] => Saloon\Helpers\MiddlewarePipeline Object
                (
                    [requestPipeline:protected] => Saloon\Helpers\Pipeline Object
                        (
                            [pipes:protected] => Array
                                (
                                    [0] => Saloon\Data\Pipe Object
                                        (
                                            [callable] => Closure Object
                                                (
                                                    [static] => Array
                                                        (
                                                            [callable] => Saloon\Http\Middleware\DetermineMockResponse Object
                                                                (
                                                                )

                                                        )

                                                    [parameter] => Array
                                                        (
                                                            [$pendingRequest] => <required>
                                                        )

                                                )

                                            [name] => determineMockResponse
                                            [order] => 
                                        )

                                    [1] => Saloon\Data\Pipe Object
                                        (
                                            [callable] => Closure Object
                                                (
                                                    [static] => Array
                                                        (
                                                            [callable] => Saloon\Http\Middleware\ValidateProperties Object
                                                                (
                                                                )

                                                        )

                                                    [parameter] => Array
                                                        (
                                                            [$pendingRequest] => <required>
                                                        )

                                                )

                                            [name] => validateProperties
                                            [order] => 
                                        )

                                    [2] => Saloon\Data\Pipe Object
                                        (
                                            [callable] => Closure Object
                                                (
                                                    [static] => Array
                                                        (
                                                            [callable] => Saloon\Http\Middleware\DelayMiddleware Object
                                                                (
                                                                )

                                                        )

                                                    [parameter] => Array
                                                        (
                                                            [$pendingRequest] => <required>
                                                        )

                                                )

                                            [name] => delayMiddleware
                                            [order] => 
                                        )

                                )

                        )

                    [responsePipeline:protected] => Saloon\Helpers\Pipeline Object
                        (
                            [pipes:protected] => Array
                                (
                                    [0] => Saloon\Data\Pipe Object
                                        (
                                            [callable] => Closure Object
                                                (
                                                    [static] => Array
                                                        (
                                                            [callable] => Closure Object
                                                                (
                                                                    [parameter] => Array
                                                                        (
                                                                            [$response] => <required>
                                                                        )

                                                                )

                                                        )

                                                    [parameter] => Array
                                                        (
                                                            [$response] => <required>
                                                        )

                                                )

                                            [name] => alwaysThrowOnErrors
                                            [order] => Saloon\Enums\PipeOrder Enum:string
                                                (
                                                    [name] => LAST
                                                    [value] => last
                                                )

                                        )

                                )

                        )

                )

            [delay:protected] => Saloon\Repositories\IntegerStore Object
                (
                    [data:protected] => 
                )

            [factoryCollection:protected] => Saloon\Data\FactoryCollection Object
                (
                    [requestFactory] => GuzzleHttp\Psr7\HttpFactory Object
                        (
                        )

                    [uriFactory] => GuzzleHttp\Psr7\HttpFactory Object
                        (
                        )

                    [streamFactory] => GuzzleHttp\Psr7\HttpFactory Object
                        (
                        )

                    [responseFactory] => GuzzleHttp\Psr7\HttpFactory Object
                        (
                        )

                    [multipartBodyFactory] => Saloon\Http\Senders\Factories\GuzzleMultipartBodyFactory Object
                        (
                        )

                )

            [mockClient:protected] => 
        )

    [senderException:protected] => 
    [mocked:protected] => 
    [cached:protected] => 
    [fakeResponse:protected] => 
)

@danielbarenkamp
Copy link
Author

Ah, after I looked up the saloon php docs I found out that you need to call body on the result.

$result->body()

Maybe you can update the documentation?

@jlevers
Copy link
Owner

jlevers commented Jun 26, 2024

Hi!

The Setup section of the README has this in it, which you might find useful:

Once you have a response, you can either access the raw JSON response via $response->json(), or you can automatically parse the response into a DTO by calling $response->dto(). Once the response is turned into a DTO, you can access the data via the DTO's properties.

I'll make it more prominent, though, thanks for pointing this out!

@jlevers jlevers closed this as completed Jun 26, 2024
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