wppconnect-team / wppconnect-server

Wppconnect Server is a ready-to-use API, just download, install, and start using, simple as that.
https://wppconnect.io/swagger/wppconnect-server/
Apache License 2.0
687 stars 402 forks source link

[ASK] Example to send buttons #245

Closed elgibor-solution closed 3 years ago

elgibor-solution commented 3 years ago

Hi,

Can help give me example to send buttons?

I found that the wppconnect-server endpoint have "/ api /: session / send-buttons" but when i try to send the button, no message received at the destination number

below are my code

Wppconnect::make($this->url);
                    $response = Wppconnect::to('/api/' . $setting->session . '/send-buttons')->withBody([
                        'phone' => $request->phone,
                        'title' => $request->title,
                        'buttons' => [
                            ["buttonId" => '1', "buttonText" => ["displayText" => 'Text of Button 1'], "type" => 1],
                            ["buttonId" => '2', "buttonText" => ["displayText" => 'Text of Button 2'], "type" => 1],
                            ["buttonId" => '3', "buttonText" => ["displayText" => 'Text of Button 3'], "type" => 1]
                        ]
                    ])->withHeaders([
                        'Authorization' => 'Bearer ' . $setting->token
                    ])->asJson()->post();
bgastaldi commented 3 years ago

Hi, Yes, but see: https://im.ge/i/oDxTHD and https://wppconnect-team.github.io/wppconnect/classes/Whatsapp.html#sendListMessage