Guida passo passo per condividere documenti con i contatti WhatsApp usando Wassenger
Condividere documenti importanti come PDF, file DOCX o fogli di calcolo XLSX con i tuoi contatti WhatsApp può migliorare notevolmente la collaborazione e l'efficienza. Tuttavia gestire manualmente queste attività può richiedere molto tempo, soprattutto per le aziende che si occupano di più contatti e clienti.
Entra in gioco Wassenger, un potente CRM progettato specificamente per la messaggistica WhatsApp. Con Wassenger, le aziende possono condividere documenti senza sforzo, automatizzare i messaggi e rimanere connesse con i loro team e clienti in modo più organizzato. Questa guida ti mostrerà come sfruttare Wassenger per inviare documenti senza problemi ai contatti WhatsApp, risparmiando tempo e aumentando la produttività.
🤩 🤖 Wassenger è una piattaforma completa di comunicazione e una soluzione API per WhatsApp. Esplora oltre 100+ casi d'uso API e automatizza qualsiasi cosa su WhatsApp iscrivendoti per una prova gratuita e inizia in pochi minuti!
Requisiti
- Avere un numero WhatsApp già collegato alla piattaforma e online.
- Numero di telefono del destinatario del messaggio con prefisso internazionale in formato E164. Esempio:
+12345678909. Puoi convalidare il numero di telefono qui.
Preparare la richiesta
URL di destinazione dell'API usando il metodo POST
https://api.wassenger.com/v1/messages
Intestazioni HTTPS richieste > Ottieni la tua API key qui
Content-Type: application/json
Token: $API_TOKEN
Usa il body in formato JSON
{ "phone": "+12345678909", "media": { "url": "https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611\_sample\_explain.pdf", "expiration": "30d" } }
Congratulazioni! Ora puoi inviare messaggi automatici usando l'API ai gruppi su WhatsApp.
🤩 🤖 Wassenger è una soluzione API completa per WhatsApp. Iscriviti per una prova gratuita di 7 giorni e inizia in pochi minuti!
Sei uno sviluppatore?
Scopri come utilizzare il codice nel tuo browser senza installare alcun software.
Inoltre, puoi trovare diversi linguaggi da testare su Replit.com:
# Gli esempi richiedono il pacchetto requests per Python. # Installalo eseguendo: pip install requests
import requests url = "https://api.wassenger.com/v1/messages" payload = { "phone": "+12345667890", "media": { "url": "https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611\_sample\_explain.pdf", "expiration": "30d" } } headers = { "Content-Type": "application/json", "Token": "API TOKEN GOES HERE" } response = requests.post(url, json=payload, headers=headers) print(response.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.wassenger.com/v1/messages',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode([
'phone' => '+1234567890',
'media' => [
'url' =>
'https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf',
'expiration' => '30d',
],
]),
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Token: API TOKEN GOES HERE',
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo 'cURL Error #:' . $err;
} else {
echo $response;
}
// This code example requires to have installed pecl_http package, a simple and elegant HTTP client for PHP. // Install it by running: pecl install pecl_http // More information: https://mdref.m6w6.name/http
append(json\_encode(\[ 'phone' => '+1234567890', 'media' => \[ 'url' => 'https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611\_sample\_explain.pdf', 'expiration' => '30d' \] \])); $request\->setRequestUrl('https://api.wassenger.com/v1/messages'); $request\->setRequestMethod('POST'); $request\->setBody($body); $request\->setHeaders(\[ 'Content-Type' => 'application/json', 'Token' => 'API TOKEN GOES HERE' \]); $client\->enqueue($request)->send(); $response = $client\->getResponse(); echo $response\->getBody(); - [C#](https://replit.com/new) (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", "{\\"phone\\":\\"+12345678909\\",\\"media\\":{\\"url\\":\\"https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611\_sample\_explain.pdf\\",\\"expiration\\":\\"30d\\"}}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); - [C#](https://replit.com/new) (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("{\\"phone\\":\\"+12345678909\\",\\"media\\":{\\"url\\":\\"https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611\_sample\_explain.pdf\\",\\"expiration\\":\\"30d\\"}}") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } } }; using (var response = await client.SendAsync(request)) { response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body); } - [Java](https://replit.com/new) // This code requires you to have installed Unirest package. // Documentation: https://kong.github.io/unirest-java/#requests // Installation: http://kong.github.io/unirest-java/ HttpResponse





