API - SISTEMA | BAILEYS | OFIC...
Botões e mais botões
3min
botões legados (web) \<?php $curl = curl init(); curl setopt array($curl, array( curlopt url => 'https //{backend url}/api/messages/sendbtn', 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" "5511989091838", "customdata" { "body" "aqui vem o body", "footer" "rodapé", "imageurl" "https //www google com/images/branding/googlelogo/1x/googlelogo color 272x92dp png", "title" "título", "caption" "caption", "buttons" "\[{\\\\"buttonid\\\\" \\\\"id1\\\\",\\\\"type\\\\" 2,\\\\"buttontext\\\\" {\\\\"displaytext\\\\" \\\\"botao 1\\\\"},\\\\"nativeflowinfo\\\\" {\\\\"name\\\\" \\\\"quick reply\\\\",\\\\"paramsjson\\\\" \\\\"{\\\\\\\\\\\\"display text\\\\\\\\\\\\" \\\\\\\\\\\\"botao 1\\\\\\\\\\\\",\\\\\\\\\\\\"id\\\\\\\\\\\\" \\\\\\\\\\\\"id1\\\\\\\\\\\\",\\\\\\\\\\\\"disabled\\\\\\\\\\\\"\ false}\\\\"}},{\\\\"buttonid\\\\" \\\\"id2\\\\",\\\\"buttontext\\\\" {\\\\"displaytext\\\\" \\\\"botao 2\\\\"},\\\\"type\\\\" 1},{\\\\"buttonid\\\\" \\\\"id3\\\\",\\\\"buttontext\\\\" {\\\\"displaytext\\\\" \\\\"botao 3\\\\"},\\\\"type\\\\" 1}]" } }', curlopt httpheader => array( 'content type application/json', 'authorization bearer seutokenaqui' //token cadastrado na conexão ), )); $response = curl exec($curl); curl close($curl); echo $response; botões quick reply (todos os dispositivos) \<?php $curl = curl init(); curl setopt array($curl, array( curlopt url => 'https //{backend url}/api/messages/sendbtn2', 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" "5511989091838", "customdata" { "body" "aqui vem o body", "name" "quick reply", "params" "{\\\\"display text\\\\" \\\\"legal\\\\",\\\\"id\\\\" \\\\"6deb1c2f 7863 45eb 8b11 17a8f8131288\\\\",\\\\"disabled\\\\"\ false}", "nameb" "quick reply", "paramsb" "{\\\\"display text\\\\" \\\\"não gostei\\\\",\\\\"id\\\\" \\\\"6deb1c2f 7863 45eb 8b11 17a8f8131288\\\\",\\\\"disabled\\\\"\ false}" } }', curlopt httpheader => array( 'content type application/json', 'authorization bearer seutokenaqui' ), )); $response = curl exec($curl); curl close($curl); echo $response;