
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
A comprehensive WhatsApp API wrapper library for .NET applications, designed to simplify WhatsApp messaging integration.
DevJojo.WApi provides a clean, easy-to-use interface for interacting with WhatsApp Business API, enabling developers to send messages, handle webhooks, and manage WhatsApp communications programmatically.
Install the package via NuGet Package Manager:
dotnet add package DevJojo.WApi
Or via Package Manager Console:
Install-Package DevJojo.WApi
using Wapi.Services;
using Microsoft.Extensions.DependencyInjection;
// Configure services
services.AddWhatsAppServices(configuration);
using Wapi.Services;
var wapiService = serviceProvider.GetService<IWapiService>();
// Send a text message
await wapiService.SendMessageAsync("Hello, World!", "1234567890");
// Send a media message
await wapiService.SendMediaMessageAsync(
mediaUrl: "https://example.com/image.jpg",
recipient: "1234567890",
caption: "Check out this image!"
);
using Wapi.Models;
// In your webhook controller
[HttpPost("webhook")]
public async Task<IActionResult> HandleWebhook([FromBody] WebhookPayload payload)
{
// Process incoming messages
foreach (var entry in payload.Entry)
{
foreach (var change in entry.Changes)
{
if (change.Value.Messages?.Any() == true)
{
foreach (var message in change.Value.Messages)
{
// Handle the message
await ProcessMessageAsync(message);
}
}
}
}
return Ok();
}
{
"WhatsApp": {
"ApiBaseUrl": "https://graph.facebook.com/v17.0",
"PhoneNumberId": "your-phone-number-id",
"AccessToken": "your-access-token",
"WebhookVerifyToken": "your-webhook-verify-token"
}
}
using Wapi.Extensions;
public void ConfigureServices(IServiceCollection services)
{
services.AddWhatsAppApi(configuration);
// Configure HTTP client
services.AddHttpClient<IWapiService, WapiService>();
}
var templateMessage = new TemplateMessage
{
Name = "hello_world",
Language = new Language { Code = "en_US" },
Components = new List<Component>
{
new Component
{
Type = "body",
Parameters = new List<Parameter>
{
new Parameter { Type = "text", Text = "John Doe" }
}
}
}
};
await wapiService.SendTemplateMessageAsync(templateMessage, "1234567890");
var interactiveMessage = new InteractiveMessage
{
Type = "button",
Body = new Body { Text = "Please choose an option:" },
Action = new Action
{
Buttons = new List<Button>
{
new Button { Id = "option1", Title = "Option 1" },
new Button { Id = "option2", Title = "Option 2" }
}
}
};
await wapiService.SendInteractiveMessageAsync(interactiveMessage, "1234567890");
// Upload media first
var mediaResponse = await wapiService.UploadMediaAsync(
mediaBytes: fileBytes,
mediaType: "image/jpeg",
fileName: "image.jpg"
);
// Send media message using media ID
await wapiService.SendMediaMessageByIdAsync(
mediaId: mediaResponse.Id,
recipient: "1234567890",
mediaType: "image"
);
try
{
await wapiService.SendMessageAsync("Hello", "1234567890");
}
catch (WhatsAppApiException ex)
{
// Handle WhatsApp API specific errors
Console.WriteLine($"WhatsApp Error: {ex.ErrorCode} - {ex.Message}");
}
catch (HttpRequestException ex)
{
// Handle network errors
Console.WriteLine($"Network Error: {ex.Message}");
}
using Wapi.Utilities;
public class WebhookController : ControllerBase
{
private readonly IWebhookValidator _validator;
[HttpPost("webhook")]
public async Task<IActionResult> HandleWebhook(
[FromBody] string payload,
[FromHeader("X-Hub-Signature-256")] string signature)
{
if (!_validator.ValidateSignature(payload, signature))
{
return Unauthorized();
}
// Process webhook...
return Ok();
}
}
BouncyCastle.Cryptography
(2.5.1) - For encryption utilitiesNewtonsoft.Json
(13.0.3) - For JSON serializationMicrosoft.Extensions.Http
(8.0.0) - For HTTP client factoryMicrosoft.Extensions.Configuration
(8.0.0) - For configuration bindingWe welcome contributions! Please feel free to submit issues, feature requests, or pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
DevJojo.WApi - Making WhatsApp integration simple and powerful for .NET developers.
FAQs
WhatsApp API wrapper library for WhatsappSuite platform
We found that devjojo.wapi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.