Ark.Wapp
0.0.8
dotnet add package Ark.Wapp --version 0.0.8
NuGet\Install-Package Ark.Wapp -Version 0.0.8
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ark.Wapp" Version="0.0.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ark.Wapp" Version="0.0.8" />
<PackageReference Include="Ark.Wapp" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ark.Wapp --version 0.0.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Ark.Wapp, 0.0.8"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ark.Wapp@0.0.8
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ark.Wapp&version=0.0.8
#tool nuget:?package=Ark.Wapp&version=0.0.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Here's a comprehensive and developer-friendly README.md file for your C# WhatsApp Library named Ark.Wapp. This README is structured to help new developers quickly understand, use, and extend the library effectively.
# Ark.Wapp ๐ฑ
**A lightweight and extensible C# library to parse and manage WhatsApp Business API messages.**
## โจ Features
- โ
Simple parsing of WhatsApp Webhook messages
- โ
Support for all message types: text, image, audio, video, document, location, sticker, interactive, buttons
- โ
Extract response and status details easily
- โ
Utility methods for token and URL configuration
- โ
Template message generator for outbound communication
---
## ๐ Getting Started
### 1. Installation
nuget install:
[](https://www.nuget.org/packages/Ark.Wapp)
NuGet\Install-Package Ark.Wapp
```bash
dotnet add package Newtonsoft.Json
```
---
## ๐ฆ Namespaces
```csharp
using Ark.Wapp;
```
---
## ๐ ๏ธ Core Components
### `ArkWappManager.ExtractResponse(string msg)`
Parses incoming webhook payload and extracts the **contact ID**, **message ID**, **status**, and **error details**.
```csharp
var response = ArkWappManager.ExtractResponse(jsonString);
Console.WriteLine(response.mob_id); // WhatsApp ID
Console.WriteLine(response.status); // Status or Error Type
```
---
### `ArkWappManager.ExtractContent(string msg)`
Asynchronously parses the payload and extracts **sender ID**, **receiver ID**, **message type**, **timestamp**, **profile name**, and the actual message content.
```csharp
WMessage content = await ArkWappManager.ExtractContent(jsonString);
Console.WriteLine(content.msg_type); // text, image, audio, etc.
Console.WriteLine(content.msg_info?.body ?? content.msg_info?.caption);
```
Supports:
* `text`
* `image`, `video`, `audio`, `document`
* `location`
* `interactive`, `button`, `sticker`
* `failed` with error extraction
---
### `WImp` Static Helpers
#### โ
WhatsApp Token and URL
```csharp
string token = WABA_TOKEN;
string endpoint = WImp.wapp_url;
```
#### ๐ Reverse Geocode URLs
```csharp
string googleUrl = WImp.google_map_geocode_reverse_url("10.123", "78.456");
string geonamesUrl = WImp.geonames_geocode_reverse_url("10.123", "78.456");
```
#### ๐ค Template Message Generator
```csharp
var message = WImp.wapp_template_message(new WTempateParam {
mob_id = "919XXXXXXXXX",
template_id = "sample_template",
lang = "en_US",
body_params = new List<object> {
new { type = "text", text = "John" }
}
});
```
Returns the ready-to-send WhatsApp message payload.
---
## ๐ Models
* `WResponse`: Contains `mob_id`, `wam_id`, `status`, `http_response_code`, `details`, and `wa_timestamp`
* `WMessage`: Core message structure
* `WMsgInfo`: Carries metadata like caption, file IDs, mime\_type, etc.
* `WError`: WhatsApp delivery failure info
* `WPriceInfo`: Billing details if available
* `WTempateParam`: Template payload definition
---
## ๐งช Sample Usage
```csharp
string webhookJson = File.ReadAllText("webhook_payload.json");
var content = await ArkWappManager.ExtractContent(webhookJson);
if (content.msg_type == "text")
{
Console.WriteLine("Text message: " + content.msg_info.body);
}
```
---
## ๐ Configuration
Ensure the following keys are available in your config system (`ArkConfig.ReadValue` looks these up):
* `wapp_perm_token`
* `google_map_api_key`
* `google_map_api_url`
* `geonames_geocode_url`
* `wapp_waba_mobile_no`
* `wapp_url`
---
## โ๏ธ Requirements
* .NET Standard 2.0+ / .NET Core / .NET 5+
* Newtonsoft.Json
---
## ๐ License
MIT License. See `LICENSE` file.
---
## ๐ค Contribution
Pull requests and suggestions are welcome! If you find any issues, feel free to raise them.
---
## ๐ Acknowledgments
* WhatsApp Business API documentation
* Newtonsoft.Json for JSON parsing
* Developers using Ark for conversational automation!
```
---
Would you like me to generate this as a downloadable `.md` file or tailor it to a specific platform (e.g., NuGet, GitHub)?
```
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- ark.net.util (>= 1.0.4.11)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
base developer api for wahtsapp