jhowbhz/package-apigratis

Uma forma simples de consumir servi├žos gratuitos oferecidos pelo site https://apigratis.com.br/

v0.2.6 2022-02-03 00:56 UTC

README

APIGratis Banner

latest stable version license mit GitHub issues GitHub all releases GitHub forks GitHub stars Minimum PHP Version

Description

With this package it is possible to consume the free API's from the website APIGratis , in a simple way.

Get Free Token

Get your token in servers free
https://apigratis.com.br/documentacoes

Our online channels

Telegram Group WhatsApp Group YouTube

Status developing

Up Services available Description Free Beta Stable
WhatsAppService Free in WhatsApp API. OK OK
CorreiosService API CEP or Tracker packages, correios Brazil. 💰 Loading Loading
SinespService API Plate get infos vehicle. 💰 Loading Loading
FipeService FIPE value the velhicle plate. Loading Loading
TranslateService Translate texts in multiples languages. 💰 Loading Loading

Install package with composer

composer require jhowbhz/package-apigratis

WhatsAppService - Examples usage

Start new session
require_once('vendor/autoload.php');
use ApiGratis\ApiBrasil;

$start = ApiBrasil::WhatsAppService("start", [
    "serverhost" => "https://whatsapp2.contrateumdev.com.br",
    "apitoken" => "YOUR_API_TOKEN",
    "session" => "YOUR_SESSION_NAME",
    "sessionkey" => "YOUR_SESSION_KEY",
    "wh_status" => "", //optional
    "wh_message" => "", //optional
    "wh_connect" => "", //optional
    "wh_qrcode" => "", //optional
]);

echo $start;
Get new QRCODE
require_once('vendor/autoload.php');
use ApiGratis\ApiBrasil;

$qrcode = ApiBrasil::WhatsAppService("qrcode", [
    "serverhost" => "https://whatsapp2.contrateumdev.com.br",
    "method" => "GET",
])

header("content-type: image/png");

echo $qrcode;
💰 Get all chats ⭐new
require_once('vendor/autoload.php');
use ApiGratis\ApiBrasil;

$allchats = ApiBrasil::WhatsAppService("getAllChats", [
  "serverhost" => "https://whatsapp2.contrateumdev.com.br",
  "session" => "YOUR_SESSION_NAME",
  "sessionkey" => "YOUR_SESSION_KEY",
]);

echo $allchats;
💰 Get all chats for number ⭐new
require_once('vendor/autoload.php');
use ApiGratis\ApiBrasil;

$getmessagesnumber = ApiBrasil::WhatsAppService("getMessagesChat", [
  "serverhost" => "https://whatsapp2.contrateumdev.com.br",
  "session" => "YOUR_SESSION_NAME",
  "sessionkey" => "YOUR_SESSION_KEY",
  "number" => "+55995360492",
]);

echo $getmessagesnumber;
💰 Get infos host device ⭐new
require_once('vendor/autoload.php');
use ApiGratis\ApiBrasil;

$gethostdevice = ApiBrasil::WhatsAppService("getHostDevice", [
  "serverhost" => "https://whatsapp2.contrateumdev.com.br",
  "session" => "YOUR_SESSION_NAME",
  "sessionkey" => "YOUR_SESSION_KEY",
]);

echo $gethostdevice;
Send text to number
require_once('vendor/autoload.php');
use ApiGratis\ApiBrasil;

$sendText = ApiBrasil::WhatsAppService("sendText", [
    "serverhost" => "https://whatsapp-v2.apibrasil.com.br",
    "session" => "teste",
    "sessionkey" => "YOUR_SESSION_KEY",
    "number" => "553195360492",
    "text" => "IS MY FIRST TEXT SEND FROM https://apigratis.com.br"
]);

echo $sendText;
Send images and files remote path ⭐new
require_once('vendor/autoload.php');
use ApiGratis\ApiBrasil;

$sendfile = ApiBrasil::WhatsAppService("sendFile", [
  "serverhost" => "https://whatsapp2.contrateumdev.com.br",
  "session" => "YOUR_SESSION_NAME",
  "sessionkey" => "YOUR_SESSION_KEY",
  "number" => "+55995360492",
  "fileName" => "FILE_NAME"
  "path" => "https://www.euax.com.br/wp-content/uploads/2019/10/Teste.png"
  "caption" => "FILE_CAPTION"
]);

echo $sendfile;
Send images and files base64 ⭐new
require_once('vendor/autoload.php');
use ApiGratis\ApiBrasil;

$sendfile64 = ApiBrasil::WhatsAppService("sendFile64", [
  "serverhost" => "https://whatsapp2.contrateumdev.com.br",
  "session" => "YOUR_SESSION_NAME",
  "sessionkey" => "YOUR_SESSION_KEY",
  "number" => "+55995360492",
  "fileName" => "FILE_NAME"
  "path" => "data:application/pdf;base64,....."
  "caption" => "FILE_CAPTION"
]);

echo $sendfile64;
Send audio ⭐new
require_once('vendor/autoload.php');
use ApiGratis\ApiBrasil;

$sendaudio = ApiBrasil::WhatsAppService("sendAudio", [
  "serverhost" => "https://whatsapp2.contrateumdev.com.br",
  "session" => "YOUR_SESSION_NAME",
  "sessionkey" => "YOUR_SESSION_KEY",
  "number" => "+55995360492",
  "path" => "https://tuningmania.com.br/autosom/mp3/Sine%20sweep%20%2020%20kHz%20~%2020%20Hz.mp3"
]);

echo $sendaudio;
💰 Send buttons ⭐new
require_once('vendor/autoload.php');
use ApiGratis\ApiBrasil;

$buttons = ApiBrasil::WhatsAppService("sendbutton", [
  "serverhost" => "https://whatsapp2.contrateumdev.com.br",
  "session" => "YOUR_SESSION_NAME",
  "sessionkey" => "YOUR_SESSION_KEY",
  "text" => "Teste de Envio de Mensagem com botoes",
  "title" => "Botões",
  "footer" => "Aqui vai o texto do rodapé da mensagem",
  "buttons" => [
        [
            "buttonId":"btn_sim", //get value in webhook
            "body" => ["displayText":"SIM" ]
        ],
        [
            "buttonId":"btn_nao", //get value in webhook
            "body" => ["displayText":"NÃO" ]
        ],
    ]
]);

echo $buttons;
Get all groups ⭐new
require_once('vendor/autoload.php');
use ApiGratis\ApiBrasil;

$groups = ApiBrasil::WhatsAppService("getAllGroups", [
  "serverhost" => "https://whatsapp2.contrateumdev.com.br",
  "session" => "YOUR_SESSION_NAME",
  "sessionkey" => "YOUR_SESSION_KEY",
]);

echo $groups;

Look and download this package in version JavaScript

https://www.npmjs.com/package/apigratis

Partner project Myzap v2

https://github.com/edupoli/MyZap2.0
https://github.com/billbarsch/myzap

Service free powered by

APIBrasil