# 99acres → FormHub (CRM webhook)

**Client:** Bliss Prime  
**Listing:** Mahidhara Supreme  
**FormHub project:** Supreme

---

## Which option to use?

| Situation | Use |
|-----------|-----|
| **99acres → Lead Manager → Integrations / CRM webhook** (only a URL box) | **Option B** |
| 99acres / account manager asks for URL + header like Mint360 | **Option A** |

Both options work in FormHub. Use **one** of them.

Copy URL / token from: **FormHub → Clients → Bliss Prime → 99acres leads**

---

## Option A — URL + header `x-access-token`

*(Same style as Mint360)*

| Item | Value |
|------|--------|
| **URL** | `https://formhub.dsignxt.com/webhooks/portals/99acres` |
| **Header name** | `x-access-token` |
| **Header value** | *(FormHub access token — copy from client page Option A)* |
| **Method** | `POST` |
| **Body** | `application/x-www-form-urlencoded` or `application/json` |

**Where to give `x-access-token`:** on the **99acres / AM API config** (as a request header), **not** in the Lead Manager webhook URL box.

---

## Option B — Full webhook URL (no header)

*(For 99acres Lead Manager → Integrations / CRM webhook)*

| Item | Value |
|------|--------|
| **URL** | `https://formhub.dsignxt.com/webhooks/portals/99acres/{token}` |
| **Header** | None |
| **Method** | `POST` |
| **Body** | Same fields as below |

1. Copy **Option B** full URL from FormHub (token is already inside the URL).  
2. Paste that URL in **99acres → Lead Manager → Integrations / CRM webhook**.  
3. Save.

---

## Body fields (same for Option A and Option B)

| FormHub field | Send as (body key) | Required | Example |
|---------------|--------------------|----------|---------|
| **Name** | `visitor_name` or `name` | Yes | Ashish |
| **Phone** | `visitor_phone` or `mobile` or `phone` | Yes | 9656560000 |
| **Email** | `visitor_email` or `email` | Recommended | ashish@example.com |
| **Project** | `project_key` | Yes* | `20846-39068-21448-f844b-0cff585e28bf` |
| **External lead ID** | `external_id` / `leadId` / `enquiryId` | No | |
| **Submitted at** | `submitted_at` | No | 2026-11-16 10:30:00 |
| **City** | `city` or `current_city` | No | Chennai |
| **Notes** | `remarks` / `notes` / `message` | No | |
| **Budget** | `minimum_budget` / `maximum_budget` / `budget` | No | |

\*If `project_key` is missing, FormHub uses default project **Supreme**.

### Project key → FormHub **Supreme**

```
20846-39068-21448-f844b-0cff585e28bf
```

---

## Examples

### Option A (header)

```bash
curl -X POST "https://formhub.dsignxt.com/webhooks/portals/99acres" \
  -H "x-access-token: YOUR_TOKEN_FROM_FORMHUB" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "name=Ashish" \
  -d "mobile=9656560000" \
  -d "email=ashish@example.com" \
  -d "project_key=20846-39068-21448-f844b-0cff585e28bf"
```

### Option B (token in URL)

```bash
curl -X POST "https://formhub.dsignxt.com/webhooks/portals/99acres/YOUR_TOKEN_FROM_FORMHUB" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "name=Ashish" \
  -d "mobile=9656560000" \
  -d "email=ashish@example.com" \
  -d "project_key=20846-39068-21448-f844b-0cff585e28bf"
```

---

## Success response (both options)

```json
{
  "status": "success",
  "data": null
}
```

Invalid token:

```json
{
  "status": "error",
  "message": "Not a valid token."
}
```

---

## After setup

1. Configure **Option A or Option B** (not both needed).  
2. Submit **one test enquiry** on Mahidhara Supreme.  
3. Confirm lead in FormHub: source **99acres**, project **Supreme**.

---

## Note

This is **FormHub**, not Mint360.  
Do **not** use the Mint360 URL or Mint360 JWT — use FormHub URL / token from the client page.

---

## If CRM shows HTTP 500 (server / hosting)

A **500** with text about `storage/logs/laravel.log` **Permission denied** is **not** a 99acres URL or token problem. The webhook reached FormHub; the **server cannot write log files**.

**Hosting team** (on the FormHub server) should run:

```bash
cd /var/www/html/projects/formhub
sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
```

(Use the same Linux user Apache/PHP-FPM runs as, if not `www-data`.)

Then send **one test lead** again. Expect **HTTP 200** and `{ "status": "success", "data": null }`.
