Seja bem vindo(a) a documentaçao do Whatstotal

Fico feliz que você esteja aqui.

Na documentação do Whatstotal, você aprenderá a conectar e configurar todas as ferramentas disponíveis em nossa API.

Leia atentamente todas as informações contidas na documentação.

Send Template

Enviar uma mensagem template com a WhatsTotal

				
					<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.wtstotal.com/message/sendTemplate/{instance}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n  \"number\": \"<string>\",\n  \"templateMessage\": {\n    \"name\": \"<string>\",\n    \"language\": \"pt_BR\",\n    \"components\": [\n      {\n        \"type\": \"header\",\n        \"sub_type\": \"quick_reply\",\n        \"index\": \"<string>\",\n        \"parameters\": [\n          {\n            \"type\": \"payload\",\n            \"text\": \"<string>\"\n          }\n        ]\n      }\n    ]\n  }\n}",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "apikey: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
				
			

Send Plain Text

Enviar mensagem de texto simples

				
					<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.wtstotal.com/message/sendText/{instance}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n  \"number\": \"<string>\",\n  \"options\": {\n    \"delay\": 123,\n    \"presence\": \"composing\",\n    \"linkPreview\": true,\n    \"quoted\": {\n      \"key\": {\n        \"remoteJid\": \"<string>\",\n        \"fromMe\": true,\n        \"id\": \"<string>\",\n        \"participant\": \"<string>\"\n      },\n      \"message\": {\n        \"conversation\": \"<string>\"\n      }\n    },\n    \"mentions\": {\n      \"everyOne\": true,\n      \"mentioned\": [\n        \"<string>\"\n      ]\n    }\n  },\n  \"textMessage\": {\n    \"text\": \"<string>\"\n  }\n}",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "apikey: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
				
			
				
					{
  "key": {
    "remoteJid": "553198296801@s.whatsapp.net",
    "fromMe": true,
    "id": "BAE594145F4C59B4"
  },
  "message": {
    "extendedTextMessage": {
      "text": "Olá!"
    }
  },
  "messageTimestamp": "1717689097",
  "status": "PENDING"
}
				
			

Send Status

Postar status no WhatsApp (stories)

				
					<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.wtstotal.com/message/sendStatus/{instance}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n  \"statusMessage\": {\n    \"type\": \"text\",\n    \"content\": \"<string>\",\n    \"caption\": \"<string>\",\n    \"backgroundColor\": \"<string>\",\n    \"font\": 123,\n    \"allContacts\": true,\n    \"statusJidList\": [\n      \"<string>\"\n    ]\n  }\n}",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "apikey: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
				
			
				
					{
  "key": {
    "remoteJid": "status@broadcast",
    "fromMe": true,
    "id": "BAE5FAB9E65A3DA8"
  },
  "message": {
    "extendedTextMessage": {
      "text": "example",
      "backgroundArgb": 4294910617,
      "font": "FB_SCRIPT"
    }
  },
  "messageTimestamp": "1717691767",
  "status": "PENDING",
  "participant": "553198296801:17@s.whatsapp.net"
}
				
			

Send Media

Enviar mensagem de mídia

				
					<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.wtstotal.com/message/sendMedia/{instance}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n  \"number\": \"<string>\",\n  \"options\": {\n    \"delay\": 123,\n    \"presence\": \"composing\"\n  },\n  \"mediaMessage\": {\n    \"mediaType\": \"image\",\n    \"fileName\": \"evolution-api.pdf\",\n    \"caption\": \"<string>\",\n    \"media\": \"<string>\"\n  }\n}",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "apikey: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
				
			
				
					{
  "key": {
    "remoteJid": "553198296801@s.whatsapp.net",
    "fromMe": true,
    "id": "BAE5F5A632EAE722"
  },
  "message": {
    "imageMessage": {
      "url": "https://mmg.whatsapp.net/o1/v/t62.7118-2...",
      "mimetype": "image/png",
      "caption": "Caption text",
      "fileSha256": "VbCGkGBv5SZStLD5PHdkBWpQav/lNsXcY...",
      "fileLength": "1305757",
      "height": 1080,
      "width": 1920,
      "mediaKey": "aFQK9Ocw5tE7Nf0iBA42Xcb4Dee6G1k/pLL...",
      "fileEncSha256": "bGVtYeR3458RwC0p1tsGDNuj+vOu/...",
      "directPath": "/o1/v/t62.7118-24/f1/m232/up-oil...",
      "mediaKeyTimestamp": "1717775573",
      "jpegThumbnail": "/9j/2wBDABALDA4MChAODQ4SERATG...",
      "contextInfo": {}
    }
  },
  "messageTimestamp": "1717775575",
  "status": "PENDING"
}
				
			

Send WhatsApp Audio

Enviar áudio no WhatsApp

				
					<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.wtstotal.com/message/sendWhatsAppAudio/{instance}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n  \"number\": \"<string>\",\n  \"options\": {\n    \"delay\": 123,\n    \"presence\": \"recording\",\n    \"encoding\": true\n  },\n  \"audioMessage\": {\n    \"audio\": \"<string>\"\n  }\n}",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "apikey: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
				
			
				
					{
  "key": {
    "remoteJid": "553198296801@s.whatsapp.net",
    "fromMe": true,
    "id": "BAE5EFED2AB0BB9F"
  },
  "message": {
    "audioMessage": {
      "url": "https://mmg.whatsapp.net/v/t62.7114-24/21428511_985284763127087_5662928...",
      "mimetype": "audio/mp4",
      "fileSha256": "DJPBnRns6QADzZNH2j0R88mUtFQ4aiOm9aZf6dio2G0=",
      "fileLength": "670662",
      "seconds": 42,
      "ptt": true,
      "mediaKey": "+A3X1Tuyzeh87cCVZpfuKpL3Y4RYdYr3sCDurjSlBTY=",
      "fileEncSha256": "s4tKvHOXIZAw5668/Xcy4zoFba4vW8klmNYC78yOPZs=",
      "directPath": "/v/t62.7114-24/21428511_985284763127087_5662928477636351284_n.enc...",
      "mediaKeyTimestamp": "1717776942"
    }
  },
  "messageTimestamp": "1717776942",
  "status": "PENDING"
}
				
			

Send Sticker

Enviar figurinha

				
					<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.wtstotal.com/message/sendSticker/{instance}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n  \"number\": \"<string>\",\n  \"options\": {\n    \"delay\": 123,\n    \"presence\": \"composing\"\n  },\n  \"stickerMessage\": {\n    \"image\": \"<string>\"\n  }\n}",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "apikey: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
				
			

Send Location

Enviar localização

				
					<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.wtstotal.com/message/sendLocation/{instance}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n  \"number\": \"<string>\",\n  \"options\": {\n    \"delay\": 123,\n    \"presence\": \"composing\"\n  },\n  \"locationMessage\": {\n    \"name\": \"<string>\",\n    \"address\": \"<string>\",\n    \"latitude\": 123,\n    \"longitude\": 123\n  }\n}",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "apikey: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
				
			
				
					{
  "key": {
    "remoteJid": "553198296801@s.whatsapp.net",
    "fromMe": true,
    "id": "BAE51B6FF4470AF9"
  },
  "message": {
    "locationMessage": {
      "degreesLatitude": -19.93359,
      "degreesLongitude": -43.93851,
      "name": "Palácio da Liberdade",
      "address": "Praça da Liberdade, Belo Horizonte, MG 30140-050",
      "contextInfo": {}
    }
  },
  "messageTimestamp": "1717779606",
  "status": "PENDING"
}
				
			

Send Contact

Enviar contato

				
					<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.wtstotal.com/message/sendContact/{instance}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n  \"number\": \"<string>\",\n  \"options\": {\n    \"delay\": 123,\n    \"presence\": \"composing\"\n  },\n  \"contactMessage\": [\n    {\n      \"fullName\": \"<string>\",\n      \"wuid\": \"<string>\",\n      \"phoneNumber\": \"<string>\",\n      \"organization\": \"<string>\",\n      \"email\": \"<string>\",\n      \"url\": \"<string>\"\n    }\n  ]\n}",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "apikey: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
				
			
				
					{
  "key": {
    "remoteJid": "553198296801@s.whatsapp.net",
    "fromMe": true,
    "id": "BAE58DA6CBC941BC"
  },
  "message": {
    "contactMessage": {
      "displayName": "Guilherme Gomes",
      "vcard": "BEGIN:VCARD\nVERSION:3.0\nN:Guilherme Gomes\nFN:Guilherme Gomes\nORG:AtendAI;\nEMAIL:...",
      "contextInfo": {}
    }
  },
  "messageTimestamp": "1717780437",
  "status": "PENDING"
}
				
			

Send Reaction

Enviar reação

				
					<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.wtstotal.com/message/sendReaction/{instance}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n  \"reactionMessage\": {\n    \"key\": {\n      \"remoteJid\": \"<string>\",\n      \"fromMe\": true,\n      \"id\": \"<string>\"\n    },\n    \"reaction\": \"🚀\"\n  }\n}",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "apikey: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
				
			
				
					{
  "key": {
    "remoteJid": "553198296801@s.whatsapp.net",
    "fromMe": true,
    "id": "BAE569F0E38F858D"
  },
  "message": {
    "reactionMessage": {
      "key": {
        "remoteJid": "553198296801@s.whatsapp.net",
        "fromMe": true,
        "id": "BAE58DA6CBC941BC"
      },
      "text": "🚀",
      "senderTimestampMs": "1717781105034"
    }
  },
  "messageTimestamp": "1717781105",
  "status": "PENDING"
}
				
			

Send Poll

Enviar enquete

				
					<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.wtstotal.com/message/sendPoll/{instance}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n  \"number\": \"<string>\",\n  \"options\": {\n    \"delay\": 123,\n    \"presence\": \"composing\"\n  },\n  \"pollMessage\": {\n    \"name\": \"<string>\",\n    \"selectableCount\": 2,\n    \"values\": [\n      \"<string>\"\n    ]\n  }\n}",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "apikey: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
				
			
				
					{
  "key": {
    "remoteJid": "553198296801@s.whatsapp.net",
    "fromMe": true,
    "id": "BAE53EC8D8E1FD8A"
  },
  "message": {
    "messageContextInfo": {
      "messageSecret": "lX/+cLHHNfnTTKZi+88mrhoyi6KNuUzWjgfaB0bTfOY="
    },
    "pollCreationMessage": {
      "name": "Poll Name",
      "options": [
        {
          "optionName": "Option 1"
        },
        {
          "optionName": "Option 2"
        },
        {
          "optionName": "Option 3"
        }
      ],
      "selectableOptionsCount": 1
    }
  },
  "messageTimestamp": "1717781848",
  "status": "PENDING"
}
				
			

Send List

Enviar lista

				
					<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.wtstotal.com/message/sendList/{instance}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n  \"number\": \"<string>\",\n  \"options\": {\n    \"delay\": 123,\n    \"presence\": \"composing\"\n  },\n  \"listMessage\": {\n    \"title\": \"<string>\",\n    \"description\": \"<string>\",\n    \"buttonText\": \"<string>\",\n    \"footerText\": \"<string>\",\n    \"sections\": [\n      {\n        \"title\": \"<string>\",\n        \"rows\": [\n          {\n            \"title\": \"<string>\",\n            \"description\": \"<string>\",\n            \"rowId\": \"<string>\"\n          }\n        ]\n      }\n    ]\n  }\n}",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "apikey: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
				
			
				
					{
  "key": {
    "remoteJid": "553198296801@s.whatsapp.net",
    "fromMe": true,
    "id": "BAE5096096C5E261"
  },
  "message": {
    "listMessage": {
      "title": "List Title",
      "description": "List description",
      "buttonText": "Click Me",
      "listType": "PRODUCT_LIST",
      "sections": [
        {
          "title": "Section title",
          "rows": [
            {
              "title": "Row 1",
              "description": "Row 1 description",
              "rowId": "1"
            },
            {
              "title": "Row 2",
              "description": "Row 2 description",
              "rowId": "2"
            }
          ]
        },
        {
          "title": "Section 2",
          "rows": [
            {
              "title": "Row 1",
              "description": "Row 1 description",
              "rowId": "1"
            },
            {
              "title": "Row 2",
              "description": "Row 2 description",
              "rowId": "2"
            }
          ]
        }
      ],
      "contextInfo": {}
    }
  },
  "messageTimestamp": "1717782429",
  "status": "PENDING"
}