I canali WhatsApp sono essenziali per le aziende che vogliono connettersi con i loro team, clienti o community. Tuttavia, gestirli manualmente può richiedere molto tempo. E se potessi automatizzare la creazione e l'invio di messaggi ai canali WhatsApp? Con Wassenger e C#, è facile 🤖
🤩 🤖 Wassenger è una soluzione API completa per WhatsApp. Iscriviti per una prova gratuita di 7 giorni e inizia in pochi minuti!
In questa guida, ti mostreremo come:
✅ Creare un canale WhatsApp
✅ Inviare messaggi a un canale WhatsApp
✅ Automatizzare l'invio di messaggi per aggiornamenti e annunci
Perché automatizzare l'invio di messaggi ai canali WhatsApp? 🤔
Gestire e inviare messaggi manualmente ai canali WhatsApp può essere scomodo. Automatizzare il processo ti permette di:
✅ Risparmiare tempo — Non dovrai più inviare messaggi individuali a più canali.
✅ Aumentare l'engagement — Mantieni i tuoi team o clienti aggiornati in tempo reale.
✅ Migliorare la coerenza — Assicurati che i messaggi vengano inviati al momento giusto senza perdere aggiornamenti.
✅ Scalare la comunicazione — Raggiungi più persone senza sforzo con messaggi automatizzati.
📢 Vuoi iniziare? Iscriviti a Wassenger ora! 🚀
Requisiti
- Avere un numero WhatsApp già collegato alla piattaforma e online.
- ID del canale (WID) che può essere trovato in due modi:
- Nel pannello di gestione del tuo numero WhatsApp, vai su “channels”. Da lì vedrai i canali a cui il tuo numero ha accesso.
- Usando l'API, richiedi i canali disponibili nel tuo dispositivo con questo endpoint.
Preparare la richiesta
URL API di destinazione (metodo POST) per creare un canale
http://api.wassenger.com/v1/devices/{deviceId}/channels
URL API di destinazione (metodo POST) per inviare messaggi a un canale
https://api.wassenger.com/v1/messages
Header HTTPS richiesti > Ottieni la tua API key qui
Content-Type: application/json
Token: $API_TOKEN
🤩 🤖 Wassenger è una piattaforma di comunicazione completa e una soluzione API per WhatsApp. Esplora più di 100+ casi d'uso API e automatizza qualsiasi cosa su WhatsApp iscrivendoti per una prova gratuita e iniziando in pochi minuti!
Sei uno sviluppatore?
Scopri come usare il codice nel tuo browser senza installare software.
Inoltre, puoi trovare diversi linguaggi da testare su Replit.com:
1. Come creare un canale WhatsApp usando C#
Creare un canale WhatsApp tramite l'API di Wassenger è semplice. Ecco come farlo in C#:
C# (RestClient)
// This code requires you to have installed RestSharp package. // Documentation: https://restsharp.dev // Installation: https://www.nuget.org/packages/RestSharp
var client = new RestClient("https://api.wassenger.com/v1/devices/device\_id/channels"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Token", "API TOKEN GOES HERE"); request.AddParameter("application/json", "{\"name\":\"Channel name\",\"description\":\"This is a channel sample description, up to 2048 characters allowed\",\"image\":{\"url\":\"https://picsum.photos/600\\"}}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
C# (HttpClient)
// This code uses the built-in HttpClient package in the .NET framework. // Documentation: https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=net-6.0
using System.Net.Http.Headers; var client = new HttpClient(); var request = new HttpRequestMessage { Method = HttpMethod.Post, RequestUri = new Uri("https://api.wassenger.com/v1/devices/device\_id/channels"), Headers = { { "Token", "API TOKEN GOES HERE" }, }, Content = new StringContent("{\"name\":\"Channel name\",\"description\":\"This is a channel sample description, up to 2048 characters allowed\",\"image\":{\"url\":\"https://picsum.photos/600\\"}}") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } } }; using (var response = await client.SendAsync(request)) { response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body); }
✅ Questo crea un nuovo canale WhatsApp chiamato “Customer Support Channel” e aggiunge due partecipanti.
🤩 🤖 Wassenger è una piattaforma di comunicazione completa e una soluzione API per WhatsApp. Esplora più di 100+ casi d'uso API e automatizza qualsiasi cosa su WhatsApp iscrivendoti per una prova gratuita e iniziando in pochi minuti!
2. Come inviare messaggi a un canale WhatsApp usando C#
Una volta creato il canale, puoi inviargli messaggi usando l'ID univoco del canale:
Send Text Message with C# (RestClient)
// This code requires you to have installed RestSharp package.
// Documentation: https://restsharp.dev
// Installation: https://www.nuget.org/packages/RestSharp
var client = new RestClient("https://api.wassenger.com/v1/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Token", "API TOKEN GOES HERE");
request.AddParameter("application/json", "{\"channel\":\"{{channel}}\", \"message\":\"This is a sample message sent to a channel\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Send Text Message with C# (HttpClient)
// This code uses the built-in HttpClient package in the.NET framework.
// Documentation: https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=net-6.0
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.wassenger.com/v1/messages"),
Headers =
{
{ "Token", "API TOKEN GOES HERE" },
},
Content = new StringContent("{\"channel\":\"{{channel}}\", \"message\":\"This is a sample message sent to a channel\"}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using(var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
Puoi anche aggiungere media ai tuoi messaggi:
Send Media Message with C# (RestClient)
// This code requires you to have installed RestSharp package.
// Documentation: https://restsharp.dev
// Installation: https://www.nuget.org/packages/RestSharp
var client = new RestClient("https://api.wassenger.com/v1/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Token", "API TOKEN GOES HERE");
request.AddParameter("application/json", "{\"channel\":\"channel_id@newsletter\", \"message\":\"This is a caption for an image message\", \"media\":{\"url\":\"https://picsum.photos/seed/picsum/600/400\", \"viewOnce\":false}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Send Media Message with C# (HttpClient)
// This code uses the built-in HttpClient package in the.NET framework.
// Documentation: https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=net-6.0
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.wassenger.com/v1/messages"),
Headers =
{
{ "Token", "API TOKEN GOES HERE" },
},
Content = new StringContent("{\"channel\":\"channel_id@newsletter\", \"message\":\"This is a caption for an image message\", \"media\":{\"url\":\"https://picsum.photos/seed/picsum/600/400\", \"viewOnce\":false}}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using(var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
✅ Questo invia automaticamente un messaggio al canale WhatsApp specificato.
È stato utile? Trova più esempi nel nostro API Live Tester 🤖
3. Come programmare messaggi in un canale WhatsApp usando C#
La programmazione dei messaggi ti permette di inviare aggiornamenti al momento perfetto:
Schedule Message with C# (RestClient)
// This code requires you to have installed RestSharp package.
// Documentation: https://restsharp.dev
// Installation: https://www.nuget.org/packages/RestSharp
var client = new RestClient("https://api.wassenger.com/v1/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Token", "API TOKEN GOES HERE");
request.AddParameter("application/json", "{\"channel\":\"channel_id@newsletter\", \"message\":\"This is a scheduled message to be sent tomorrow to a channel.Date format is based on ISO 8601 format with default UTC time zone\", \"deliverAt\":\"2025-03-06T09:27:39.374Z\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Schedule Message with C# (HttpClient)
// This code uses the built-in HttpClient package in the.NET framework.
// Documentation: https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=net-6.0
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.wassenger.com/v1/messages"),
Headers =
{
{ "Token", "API TOKEN GOES HERE" },
},
Content = new StringContent("{\"channel\":\"channel_id@newsletter\", \"message\":\"This is a scheduled message to be sent tomorrow to a channel.Date format is based on ISO 8601 format with default UTC time zone\", \"deliverAt\":\"2025-03-06T09:27:39.374Z\"}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using(var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
✅ Questo programma l'invio di un messaggio in un secondo momento in modo automatico.
È stato utile? Trova più esempi nel nostro API Live Tester 🤖
Prova ora il nostro API-Live tester!
Domande frequenti (FAQ) 🤔
1. Posso usare l'API di Wassenger per rimuovere utenti da un canale WhatsApp?
Questa guida si concentra sui messaggi, ma l'API di Wassenger offre opzioni per la gestione dei canali, incluso aggiungere o rimuovere utenti.
📢 Hai bisogno di più aiuto? Visita il Wassenger Help Center per documentazione dettagliata e supporto!
2. Posso inviare immagini, video o documenti ai canali WhatsApp usando l'API di Wassenger?
Assolutamente! L'API di Wassenger ti permette di inviare contenuti multimediali come immagini, video, PDF e altro ai tuoi canali WhatsApp.
3. Come posso verificare se il mio messaggio è stato consegnato correttamente a un canale WhatsApp?
Puoi usare l'API di Wassenger per recuperare gli aggiornamenti sullo stato dei messaggi, assicurandoti che i tuoi messaggi vengano consegnati e letti.
4. Posso menzionare utenti specifici in un messaggio per un canale WhatsApp?
Sì! Puoi menzionare partecipanti specifici includendo i loro numeri di telefono nel payload del messaggio.
📌 Pronto ad automatizzare i tuoi messaggi WhatsApp? Inizia la tua prova gratuita oggi! 🚀
Con Wassenger e C#, puoi creare, inviare e programmare messaggi per i canali WhatsApp senza sforzo, rendendo la comunicazione più fluida ed efficiente.







