Skip to content
This repository was archived by the owner on Dec 17, 2018. It is now read-only.
This repository was archived by the owner on Dec 17, 2018. It is now read-only.

Unknown error (invalid_array_arg) #25

Description

@viperdigo

I'm trying use attachment, however, I can't.

I'm using this:

 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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions