Como utilizar o Gateway para envios

Aprenda como configurar os disparos através do gateway

Hualyson Carvalho avatar
Escrito por Hualyson Carvalho
Atualizado há mais de uma semana

1 - Enviando texto

  • Jquery

    var settings = { 
    url:"https://zapisp.com.br/api/whatsapp/generic/v1/text",
    method: "POST", // ou GET
    data:
    {
    apiToken: "l33tsupah4x0ra9f55fe15e6a2b6cbkycx",
    telefone: "NUMERO_DO_TELEFONE",
    mensagem: "mensagem"
    }
    }
    $.ajax(settings).done(function (response){
    console.log(response);
    });

  • PHP

    $mensagem = 'Meu primeiro teste com a API do zapisp!'; 
    $telefone = 'NUMERO_DO_TELEFONE';
    $apiToken = 'l33tsupah4x0ra9f55fe15e6a2b6cbkycx';

    $api = "https://zapisp.com.br/api/whatsapp/generic/v1/text";

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $api);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, [
    'apiToken' => $apiToken,
    'telefone' => $telefone,
    'mensagem' => $mensagem
    ]);

    $response = curl_exec($ch);

    curl_close($ch);

    print_r($response);

2 - Enviando PDF

  • PHP

    $telefone = 'NUMERO_DO_TELEFONE'; 
    $title = 'Exemplo';
    $pdf = 'https://expoforest.com.br/wp-content/uploads/2017/05/exemplo.pdf';
    $apiToken = 'l33tsupah4x0ra9f55fe15e6a2b6cbkycx';

    $api = "https://zapisp.com.br/api/whatsapp/generic/v1/pdf";

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $api);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, [
    'apiToken' => $apiToken,
    'telefone' => $telefone,
    'title' => $title,
    'pdf' => $pdf
    ]);

    $response = curl_exec($ch);

    curl_close($ch);

    print_r($response);

  • Jquery

    var settings = { 
    url: "https://zapisp.com.br/api/whatsapp/generic/v1/pdf",
    method: "POST", // ou GET
    data:
    {
    apiToken: "l33tsupah4x0ra9f55fe15e6a2b6cbkycx",
    telefone: NUMERO_DO_TELEFONE",
    pdf: "https://expoforest.com.br/wp-content/uploads/2017/05/exemplo.pdf",
    title: "Exemplo"
    }
    }
    $.ajax(settings).done(function (response) {
    console.log(response);
    });

3 - Envio de imagem

  • PHP

    $telefone = 'NUMERO_DO_TELEFONE'; 
    $msg = 'Essa é uma imagem';
    $img = 'https://zapisp.com.br/public/api.png';
    $apiToken = 'l33tsupah4x0ra9f55fe15e6a2b6cbkycx';

    $api = "https://zapisp.com.br/api/whatsapp/generic/v1/img";

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $api);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, [
    'apiToken' => $apiToken,
    'telefone' => $telefone,
    'msg' => $msg,
    'img' => $img
    ]);

    $response = curl_exec($ch);

    curl_close($ch);

    print_r($response);

  • Jquery

    var settings = { 
    url: "https://zapisp.com.br/api/whatsapp/generic/v1/img",
    method: "POST", // ou GET
    data:
    {
    apiToken: "l33tsupah4x0ra9f55fe15e6a2b6cbkycx",
    telefone: "NUMERO_DO_TELEFONE",
    img: "https://zapisp.com.br/public/api.png",
    msg: "Essa é uma imagem"
    }
    }

    $.ajax(settings).done(function (response) {
    console.log(response);
    });

Nunca divulgue ou compartilhe esta informação com terceiros. Isto possibilitará que mensagens sejam enviadas em nome da sua empresa!

Respondeu à sua pergunta?