Closed alokinac closed 1 year ago
Hello,
I am not able to reproduce the error you are talking about.
Here is the code I have tried successfully for 2 files uploaded on an existing thread:
$client = new ShopApiClient($url, $apiKeyShop);
$request = new ThreadReplyRequest('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', [
'body' => 'Lorem ipsum dolor sit amet',
'to' => [
['type' => 'OPERATOR'],
],
]);
$file1 = new FileWrapper(new \SplFileObject(__DIR__ . '/test1.txt'));
$file1->setFileName('test1.txt');
$request->addFile($file1);
$file2 = new FileWrapper(new \SplFileObject(__DIR__ . '/test2.txt'));
$file2->setFileName('test2.txt');
$request->addFile($file2);
$result = $client->replyToThread($request);
Can you verify please?
Thank you.
Hello @jreinke thanks for the feedback. Indeed it looks like this issue was caused by a PHP proxy that was routing CLI requests to Mirakl, and not to the client itself. The problem was caused by the fact that several files that are forming the multipart request all need to have the same name ("files") and the proxy was overwriting that.
We did get it to work, thanks for your quick answer !
Hello,
When adding multiple attachments to a thread reply, only one attachment is actually sent.
eg.
The test2.txt seems to just overwrite the test1.txt instead of being added to a list of attachments.
Is this actually the expected behavior ?
Thanks