All URIs are relative to /api
| 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. |
APIResponse ChangeWebhookUrl (string instanceKey, WebhookPayload data)
Change Webhook url.
Changes the webhook url of an instance.
using System.Collections.Generic;
using System.Diagnostics;
using WhatsAPI.whatsapi;
using WhatsAPI.Client;
using WhatsAPI.models;
namespace Example
{
public class ChangeWebhookUrlExample
{
public static void Main()
{
Configuration.Default.BasePath = "/api";
// Configure API key authorization: ApiKeyAuth
Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");
var apiInstance = new InstanceApi(Configuration.Default);
var instanceKey = "instanceKey_example"; // string | Instance key
var data = new WebhookPayload(); // WebhookPayload | Message data
try
{
// Change Webhook url.
APIResponse result = apiInstance.ChangeWebhookUrl(instanceKey, data);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling InstanceApi.ChangeWebhookUrl: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| instanceKey | string | Instance key | |
| data | WebhookPayload | Message data |
- Content-Type: application/json
- Accept: /
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 404 | Instance not found | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
APIResponse CreateInstance (CreateInstancePayload data)
Creates a new instance key.
This endpoint is used to create a new WhatsApp Web instance.
using System.Collections.Generic;
using System.Diagnostics;
using WhatsAPI.whatsapi;
using WhatsAPI.Client;
using WhatsAPI.models;
namespace Example
{
public class CreateInstanceExample
{
public static void Main()
{
Configuration.Default.BasePath = "/api";
// Configure API key authorization: ApiKeyAuth
Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");
var apiInstance = new InstanceApi(Configuration.Default);
var data = new CreateInstancePayload(); // CreateInstancePayload | Instance data
try
{
// Creates a new instance key.
APIResponse result = apiInstance.CreateInstance(data);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling InstanceApi.CreateInstance: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| data | CreateInstancePayload | Instance data |
- Content-Type: application/json
- Accept: /
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 404 | Instance not found | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
APIResponse DeleteInstance (string instanceKey)
Delete Instance.
Deletes the instance with the provided key.
using System.Collections.Generic;
using System.Diagnostics;
using WhatsAPI.whatsapi;
using WhatsAPI.Client;
using WhatsAPI.models;
namespace Example
{
public class DeleteInstanceExample
{
public static void Main()
{
Configuration.Default.BasePath = "/api";
// Configure API key authorization: ApiKeyAuth
Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");
var apiInstance = new InstanceApi(Configuration.Default);
var instanceKey = "instanceKey_example"; // string | Instance key
try
{
// Delete Instance.
APIResponse result = apiInstance.DeleteInstance(instanceKey);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling InstanceApi.DeleteInstance: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| instanceKey | string | Instance key |
- Content-Type: Not defined
- Accept: /
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 404 | Instance not found | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
APIResponse GetContacts (string instanceKey)
Get contacts.
Fetches the list of contacts in the instance.
using System.Collections.Generic;
using System.Diagnostics;
using WhatsAPI.whatsapi;
using WhatsAPI.Client;
using WhatsAPI.models;
namespace Example
{
public class GetContactsExample
{
public static void Main()
{
Configuration.Default.BasePath = "/api";
// Configure API key authorization: ApiKeyAuth
Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");
var apiInstance = new InstanceApi(Configuration.Default);
var instanceKey = "instanceKey_example"; // string | Instance key
try
{
// Get contacts.
APIResponse result = apiInstance.GetContacts(instanceKey);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling InstanceApi.GetContacts: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| instanceKey | string | Instance key |
- Content-Type: Not defined
- Accept: /
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 404 | Instance not found | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
APIResponse GetInstance (string instanceKey)
Get Instance.
Returns the instance data of single instance with connection status.
using System.Collections.Generic;
using System.Diagnostics;
using WhatsAPI.whatsapi;
using WhatsAPI.Client;
using WhatsAPI.models;
namespace Example
{
public class GetInstanceExample
{
public static void Main()
{
Configuration.Default.BasePath = "/api";
// Configure API key authorization: ApiKeyAuth
Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");
var apiInstance = new InstanceApi(Configuration.Default);
var instanceKey = "instanceKey_example"; // string | Instance key
try
{
// Get Instance.
APIResponse result = apiInstance.GetInstance(instanceKey);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling InstanceApi.GetInstance: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| instanceKey | string | Instance key |
- Content-Type: Not defined
- Accept: /
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 404 | Instance not found | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
APIResponse GetQrCode (string instanceKey)
Get QrCode.
Returns the qrcode in the base64 format.
using System.Collections.Generic;
using System.Diagnostics;
using WhatsAPI.whatsapi;
using WhatsAPI.Client;
using WhatsAPI.models;
namespace Example
{
public class GetQrCodeExample
{
public static void Main()
{
Configuration.Default.BasePath = "/api";
// Configure API key authorization: ApiKeyAuth
Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");
var apiInstance = new InstanceApi(Configuration.Default);
var instanceKey = "instanceKey_example"; // string | Instance key
try
{
// Get QrCode.
APIResponse result = apiInstance.GetQrCode(instanceKey);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling InstanceApi.GetQrCode: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| instanceKey | string | Instance key |
- Content-Type: Not defined
- Accept: /
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 404 | Instance not found | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
APIResponse ListInstances ()
Get all instances.
Fetches the list of all Instances with login status.
using System.Collections.Generic;
using System.Diagnostics;
using WhatsAPI.whatsapi;
using WhatsAPI.Client;
using WhatsAPI.models;
namespace Example
{
public class ListInstancesExample
{
public static void Main()
{
Configuration.Default.BasePath = "/api";
// Configure API key authorization: ApiKeyAuth
Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");
var apiInstance = new InstanceApi(Configuration.Default);
try
{
// Get all instances.
APIResponse result = apiInstance.ListInstances();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling InstanceApi.ListInstances: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: /
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 404 | Instance not found | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
APIResponse LogoutInstance (string instanceKey)
Logout Instance.
Logouts of the instance with the provided key.
using System.Collections.Generic;
using System.Diagnostics;
using WhatsAPI.whatsapi;
using WhatsAPI.Client;
using WhatsAPI.models;
namespace Example
{
public class LogoutInstanceExample
{
public static void Main()
{
Configuration.Default.BasePath = "/api";
// Configure API key authorization: ApiKeyAuth
Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");
var apiInstance = new InstanceApi(Configuration.Default);
var instanceKey = "instanceKey_example"; // string | Instance key
try
{
// Logout Instance.
APIResponse result = apiInstance.LogoutInstance(instanceKey);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling InstanceApi.LogoutInstance: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| instanceKey | string | Instance key |
- Content-Type: Not defined
- Accept: /
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 404 | Instance not found | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]