All URIs are relative to /api, except if the operation defines another base path.
| Method | HTTP request | Description |
|---|---|---|
| changeWebhookUrl() | PUT /instances/{instance_key}/webhook | Change Webhook url. |
| createInstance() | POST /instances/create | Creates a new instance key. |
| deleteInstance() | DELETE /instances/{instance_key}/delete | Delete Instance. |
| getContacts() | GET /instances/{instance_key}/contacts | Get contacts. |
| getInstance() | GET /instances/{instance_key}/ | Get Instance. |
| getQrCode() | GET /instances/{instance_key}/qrcode | Get QrCode. |
| listInstances() | GET /instances/list | Get all instances. |
| logoutInstance() | DELETE /instances/{instance_key}/logout | Logout Instance. |
changeWebhookUrl($instance_key, $data): \WhatsAPI\models\APIResponseChange Webhook url.
Changes the webhook url of an instance.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new WhatsAPI\Api\InstanceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$instance_key = 'instance_key_example'; // string | Instance key
$data = new \WhatsAPI\models\WebhookPayload(); // \WhatsAPI\models\WebhookPayload | Message data
try {
$result = $apiInstance->changeWebhookUrl($instance_key, $data);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InstanceApi->changeWebhookUrl: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| instance_key | string | Instance key | |
| data | \WhatsAPI\models\WebhookPayload | Message data |
- Content-Type:
application/json - Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createInstance($data): \WhatsAPI\models\APIResponseCreates a new instance key.
This endpoint is used to create a new WhatsApp Web instance.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new WhatsAPI\Api\InstanceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$data = new \WhatsAPI\models\CreateInstancePayload(); // \WhatsAPI\models\CreateInstancePayload | Instance data
try {
$result = $apiInstance->createInstance($data);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InstanceApi->createInstance: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| data | \WhatsAPI\models\CreateInstancePayload | Instance data |
- Content-Type:
application/json - Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteInstance($instance_key): \WhatsAPI\models\APIResponseDelete Instance.
Deletes the instance with the provided key.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new WhatsAPI\Api\InstanceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$instance_key = 'instance_key_example'; // string | Instance key
try {
$result = $apiInstance->deleteInstance($instance_key);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InstanceApi->deleteInstance: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| instance_key | string | Instance key |
- Content-Type: Not defined
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getContacts($instance_key): \WhatsAPI\models\APIResponseGet contacts.
Fetches the list of contacts in the instance.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new WhatsAPI\Api\InstanceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$instance_key = 'instance_key_example'; // string | Instance key
try {
$result = $apiInstance->getContacts($instance_key);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InstanceApi->getContacts: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| instance_key | string | Instance key |
- Content-Type: Not defined
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getInstance($instance_key): \WhatsAPI\models\APIResponseGet Instance.
Returns the instance data of single instance with connection status.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new WhatsAPI\Api\InstanceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$instance_key = 'instance_key_example'; // string | Instance key
try {
$result = $apiInstance->getInstance($instance_key);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InstanceApi->getInstance: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| instance_key | string | Instance key |
- Content-Type: Not defined
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getQrCode($instance_key): \WhatsAPI\models\APIResponseGet QrCode.
Returns the qrcode in the base64 format.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new WhatsAPI\Api\InstanceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$instance_key = 'instance_key_example'; // string | Instance key
try {
$result = $apiInstance->getQrCode($instance_key);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InstanceApi->getQrCode: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| instance_key | string | Instance key |
- Content-Type: Not defined
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listInstances(): \WhatsAPI\models\APIResponseGet all instances.
Fetches the list of all Instances with login status.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new WhatsAPI\Api\InstanceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
try {
$result = $apiInstance->listInstances();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InstanceApi->listInstances: ', $e->getMessage(), PHP_EOL;
}This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to README]
logoutInstance($instance_key): \WhatsAPI\models\APIResponseLogout Instance.
Logouts of the instance with the provided key.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new WhatsAPI\Api\InstanceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$instance_key = 'instance_key_example'; // string | Instance key
try {
$result = $apiInstance->logoutInstance($instance_key);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InstanceApi->logoutInstance: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| instance_key | string | Instance key |
- Content-Type: Not defined
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to README]