You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 17, 2018. It is now read-only.
public function indexAction()
{
$payload = new ChatPostMessagePayload();
$payload->setChannel('#saopaulo-dev-qa'); // Channel names must begin with a hash-sign '#'
$attachment = new Attachment();
$attachment->setText('Test Text');
$attachment->setColor('good');
$attachment->setTitle('Teste Title');
$attachmentField = new AttachmentField();
$attachmentField->setTitle('Test Title Field');
$attachmentField->setValue('Test Value Field');
$attachment->addField($attachmentField);
$payload->addAttachment($attachment);
$response = $this->get('cl_slack.api_client')->send($payload,'xoxb-194306641143-i99KHJANwLCZTS84qpFR4G7z');
if ($response->isOk()) {
// do what you want...
} else {
echo sprintf('Something seemed to have gone wrong: %s', $response->getErrorExplanation());
}
}
and the response is that: Something seemed to have gone wrong: Unknown error (invalid_array_arg)
I not found in the documentation how to use an attachment, maybe I use badly. Anybody help me, please?