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" />
                    
Directory.Packages.props
<PackageReference Include="Ark.Wapp" />
                    
Project file
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
                    
#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
                    
Install as a Cake Addin
#tool nuget:?package=Ark.Wapp&version=0.0.8
                    
Install as a Cake Tool

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:
[![Generic badge](https://img.shields.io/nuget/v/ark.wapp?color=green&label=nuget&style=for-the-badge)](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 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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.8 664 7/23/2025
0.0.7 596 7/22/2025
0.0.6 607 7/22/2025
0.0.5 282 7/20/2025
0.0.4 184 7/18/2025
0.0.3 171 7/18/2025

base developer api for wahtsapp