Skip to content

seeing the response of any upsertList() callΒ #176

@johamm

Description

@johamm

I'm using upsertList() in a number of areas (ProductModel, Category, AttributeOptions etc) and when I run it, I'm not getting a response. How would I know what item has been created/updated successfully and which have failed? Reading the API documentation suggests you should...

For example: https://api.akeneo.com/php-client/resources.html#upsert-a-list-of-product-models

foreach ($responseLines as $line) {
        echo $line['line'];
        echo $line['identifier'];
        echo $line['status_code'];
        if (isset($line['message'])) {
            echo $line['message'];
        }
    }

When I try this, there's nothing showing. When I print_r($responseLines) there's only the following:

Akeneo\Pim\ApiClient\Stream\UpsertResourceListResponse Object
(
    [bodyStream:protected] => GuzzleHttp\Psr7\Stream Object
        (
            [stream:GuzzleHttp\Psr7\Stream:private] => Resource id #131
            [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://temp
            [customMetadata:GuzzleHttp\Psr7\Stream:private] => Array
                (
                )
        )

    [streamReader:protected] => Akeneo\Pim\ApiClient\Stream\LineStreamReader Object
        (
        )

    [lineNumber:protected] => 1
    [line:protected] => 
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions