API - API DO ZAP (whatsmeow PR...
Enviar Carrossel
1 min
\<?php $curl = curl init(); curl setopt array($curl, array( curlopt url => 'https //{backend url}/api/messages/whatsmeow/sendcarousel', curlopt returntransfer => true, curlopt encoding => '', curlopt maxredirs => 10, curlopt timeout => 0, curlopt followlocation => true, curlopt http version => curl http version 1 1, curlopt customrequest => 'post', curlopt postfields =>'{ "number" "555192914354", "caption" "teste", "footer" "testando", "openticket" "0", "queueid" 0, "cards" \[ { "title" "produto 1", "body" "descrição do produto", "footer" "r$ 99,90", "imageurl" "https //picsum photos/400/400", "buttons" \[ {"id" "comprar 1", "text" "comprar"}, {"id" "info 1", "text" "mais info"} ] }, { "title" "produto 2", "body" "outro produto incrível", "footer" "r$ 149,90", "imageurl" "https //picsum photos/401/401", "buttons" \[ {"id" "comprar 2", "text" "comprar"} ] } ] }', curlopt httpheader => array( 'content type application/json', 'authorization bearer seutokenaqui' //token cadastrado na conexão ), )); $response = curl exec($curl); curl close($curl); echo $response;
