davidtsadler / ebay-sdk-php

An eBay SDK for PHP. Use the eBay API in your PHP projects.
Apache License 2.0
350 stars 343 forks source link

UploadReturnFileRestRequest - statusCode 400 #133

Closed artemmelnik closed 7 years ago

artemmelnik commented 7 years ago

Hello David, when I try to send a file using the uploadReturnFile method

Unknown Error: Argument 2 passed to DTS\eBaySDK\Parser\JsonParser::assignProperties() must be of the type array, null given, called in /srv/webspace/artem-me/carid/httpdocs/composer/vendor/dts/ebay-sdk-php/src/Parser/JsonParser.php on line 13 and defined in /srv/webspace/artem-me/carid/httpdocs/composer/vendor/dts/ebay-sdk-php/src/Parser/JsonParser.php on line 16 Warning: Invalid argument supplied for foreach() in /srv/webspace/artem-me/carid/httpdocs/composer/vendor/dts/ebay-sdk-php/src/Parser/JsonParser.php on line 18

Code sample

$request = new UploadReturnFileRestRequest(); $request->returnId = $returnId; $request->fileName = '1.jpg'; $request->filePurpose = FilePurposeEnum::C_LABEL_RELATED; $request->data[] = DataManager::getFileToBase64('http://my_url_domain/upload/test.jpg'); return $this->getService()->uploadReturnFile($request);

Please help, please

artemmelnik commented 7 years ago

134

davidtsadler commented 7 years ago

Hopefully the 13.0.3 release has resolved this issue. Thank you again for the PR.