---
# System prepended metadata

title: thirdParty
tags: [api]

---

# thirdParty

###### tags: `api`
Web url to 3rd party webview template
---
```
[3RD_PARTY_BASE_URL]?Project=PR-CO&Email=user@email.com&...
```
'{Project}': project.project_code,
'{Unit}': home.address_no,
'{ProjectID}': project.project_id,
'{HomeID}': home.home_id,
'{ContactID}': contactId,
'{Language}': language,
'{Email}': email

Get List of Home by Project Code
---

```
GET /api/third_party/homes/:project_code
```

### Headers - `Header`

| Name    | Type      | Description                          |
|---------|-----------|--------------------------------------|
| authorization | `string` | Bearer {token} |

### Parameters - `Parameter`

| Name     | Type       | Description                           |
|----------|------------|---------------------------------------|
| :project_code | `string` | Project code |

### Success response

#### Success response - `Success 200`

| Name     | Type       | Description                           |
|----------|------------|---------------------------------------|
| result | `array` | List of home |

### Success response example

#### Success response example - `Success-Response`

```json
{
    "result": [
      {
        "home_id": "99999",
        "project_code": "PR-CO",
        "project": {
            "project_type": "L",
            "project_name": "ชื่อโครงการ (TH)",
            "project_translation": [
                {
                    "locale": "en-TH",
                    "name": "Project Name (EN)"
                }
            ],
            "project_cover": "https://cover.image.url"
        },
        "plot_code": "999",
        "address_no": "99/99",
        "address_road": "ชัยพฤกษ์",
        "pre_tumbon": "ตำบล",
        "tumbon_name": "บางตะไนย์",
        "pre_amphur": "อำเภอ",
        "amphur_name": "ปากเกร็ด",
        "province_name": "นนทบุรี",
        "zip_code": "99999",
        "created_at": "2018-12-20T13:17:14.435+07:00",
        "updated_at": "2022-08-18T03:30:03.557+07:00",
        "deleted_at": null
    },
        .
        .
        .
    ]
  }
  
```
---
Send Push Notification
---

```
POST  /api/third_party/notifications/send
```
### Headers - `Header`

| Name    | Type      | Description                          |
|---------|-----------|--------------------------------------|
| authorization | `string` | Bearer `{token}` |

#### Parameters - `Parameter`

| Name     | Type       | Description                           |
|----------|------------|---------------------------------------|
| message.title | `String` |Notification title |
| message.body | `String` | Notification message  |
| feature.name | `String` | Notification category, always set to "ANNOUNCEMENT" |
| feature.action | `String` | Notification action, always set to "WEBVIEW" |
| feature.data.webview_url | `String` | URL of webview  |
| home_ids | `Array` | Target home ID(s)

#### Request Example

```json
{
  "message": {
    "title": "ทดสอบ smart gate",
    "body": "ทดสอบโดย smart gate"
  },
  "feature": {
    "name": "ANNOUNCEMENT",
    "action": "WEBVIEW",
    "data": {
      "webview_url": "https://destination.web.url",
    }
  },
  "home_ids": [
    "99999"
  ]
}
```

### Success response

#### Success response - `Success 200`

| Name     | Type       | Description                           |
|----------|------------|---------------------------------------|
| message | `String` | "success" |

```json
{
  "message": "success"
}
  
```