Code Samples

See some code samples to integrate your API.

Postman file

Postman is a tool that aims to test RESTful services (Web APIs) by sending HTTP requests and analyzing their feedback. Download Postman Apparrow-up-right

circle-check
API for production
circle-info

Development You should use the following URL: https://api.positus.global/v2/sandbox/whatsapp/numbers/{{chave}}/messagesarrow-up-right

Create your sandbox account through the link https://studio.posit.us/arrow-up-right and generate a token following the instructions on the screen. Navigate to the "webhook" menu and copy the POST URL in it, this one uses "Key". In the development environment you will not be able to send HSM messages, but all other resources are available for sending and receiving.

API for development SandBox

Code Samples

C# - RestSharp

var client = new RestClient("https://api.positus.global/v2/sandbox/whatsapp/numbers/{{chave}}/messages");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer xxxx");
request.AddParameter("application/json,text/plain", "{\r\n  \"to\": \"+5511999999999\",\r\n  \"type\": \"text\",\r\n  \"text\": {\r\n      \"body\": \"your-message-content\"\r\n  }\r\n}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Last updated