-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
28 lines (24 loc) · 880 Bytes
/
Program.cs
File metadata and controls
28 lines (24 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
namespace Green_API_library
{
class Program
{
static async Task Main(string[] args)
{
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
//Data
string idInstance = "*****"; //Write your instance ID
string apiTokenInstance = "*****"; //Write your instance token
string waNumber = "*****"; //Write whatsapp number
//Send a test message
//1) Create an HTTP client object
//2) Create a WSP_API object
HttpClient HTTPclient = new HttpClient();
WSP_API TestRequest = new WSP_API(idInstance, apiTokenInstance);
await TestRequest.SendWspMessage(HTTPclient, waNumber, "Test Message");
}
}
}