> For the complete documentation index, see [llms.txt](https://help.pickyassist.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.pickyassist.com/api-documentation-v2/sample-codes/asp.net-using-c.md).

# ASP.NET Using C\#

**ASP.NET Sample Code Using C#**

{% hint style="warning" %}
Submitted by One of our Customer based in Singapore , we dont offer any support on this code&#x20;
{% endhint %}

```aspnet
using System.Collections.Generic;
using System.Web;
using System.Web.Http;

namespace WebApplication1.Controllers
{
    public class ValuesController :
    {
        // GET api/values
        public IHttpActionResult Get()
        {

            /* Mobile number with country code from the message came, 
             * if the sender mobile number is saved in the phone contacts then instead of number the contact name will come here as number. 
             * For Whatsapp Group the number will be Group Name @Sender Name / Number  */

            var mobileNumber = HttpContext.Current.Request["number"] ?? "0";
            /*Text message received in the application - only first 1000 characters will be pushed to the server. */
            var message = HttpContext.Current.Request["message-in"] ?? "";
            /*On which messaging app the message has received 1=Whatsapp Personal | 2 = Whatsapp Business */
            var application = HttpContext.Current.Request["application"] ?? "1";
            /*What kind of message is received , text=1, photo=2, video=3, audio=4, location=5, document=6, contact=7 */
            var type = HttpContext.Current.Request["type"] ?? "0";
            /*Unique id assigned by the picky assist application */
            var uniqueid = HttpContext.Current.Request["unique-id"] ?? "0";

            if (!string.IsNullOrEmpty(mobileNumber))
            {
                /*Reply should be in JSON format. The response parameters are : 
                1. 'message-out' - Message you need to give it as reply.
                2. 'delay' - If you would like to give response by setting a delay then please pass the delay value 
                in “delay” variable , delay need to be set in seconds and maximum allowed delay is 3600 seconds 
                i.e delay=10 means message will send after 10 seconds

                /*Giving Reply should be in JSON */
                var data = new Dictionary<string, object> {{"message-out", "Hello Picky"}, {"delay", 0}};
                return Ok(data);

            }
            return BadRequest("mobile number not provided");
        }


    }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.pickyassist.com/api-documentation-v2/sample-codes/asp.net-using-c.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
