# Client Menu API

## Push Notification
### Push notification to target user ids with single payload
`POST` `https://h1.ekoapp.com/api/v1client-menus/:client-menu-id/push-notify/payload`

Send push notification to the target user ids with the same message payload

**Path Parameters**

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| client-menu-id\* | String | the unique id of client menu |

**Headers**

| Name            | Type   | Description                                               |
| --------------- | ------ | --------------------------------------------------------- |
| Authorization\* | String | `client-credential` access token with `client-menu` scope |

**Request Body**

| Name                  | Type      | Description                                                                                                                                                        |
| --------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| to\*                  | String\[] | target user id. Up to **1,000** are allowed in a single request                                                                                                    |
| payload\*             | Object    | push notification payload. maximum 4KB per payload                                                                                                                 |
| payload.title\*       | String    | push notification title                                                                                                                                            |
| payload.message\*     | String    | <p>push notification message.<br /><br />Support template message with following properties <code>firstname</code>, <code>lastname</code>, and <code>email</code>.</p> |
| payload.redirectUri\* | String    | redirect uri to get into sub-page of client menu                                                                                                                   |

Status 200: OK

**Request Example**

```json
{
    "to": [ "<TARGET_USER_ID>", ... ],
    "payload": {
        "redirectUri": "<REDIRECT_URI>",
        "title": "Title is here",
        "message": "What's up ${firstname} ${lastname}. How are you today?",
    }
}
```

**Response Exmaple**

```json
{
    "referenceId": "<string>"
}
```

### Push notification to target user ids with their own payload
`POST` `https://h1.ekoapp.com/api/v1/client-menus/:client-menu-id/push-notify/multiple-payload`

Send push notification to the target user ids with the difference message payload

**Path Parameters**

NameTypeDescription

client-menu-id\*

String

the unique id of client menu

**Headers**

NameTypeDescription

Authorization\*

String

`client-credential` access token with `client-menu` scope

**Request Body**

NameTypeDescription

\*.to\*

String

target user id. Up to **100** are allowed in a single request

\*.payload\*

Object

push notification payload. maximum 4KB per payload

\*.payload.title\*

String

push notification title

\*.payload.message\*

String

push notification message.

Support template message with following properties `firstname`, `lastname`, and `email`.

\*.payload.redirectUri\*

String

redirect uri to get into sub-page of client menu

200: OKRequest ExampleResponse ExmapleCopy

```
[
    {
        "to": "<TARGET_USER_ID>",
        "payload": {
            "redirectUri": "<REDIRECT_URI>",
            "title": "Title is here",
            "message": "What's up ${firstname} ${lastname}. How are you today?",
        }
    }
]
```

### Push notification to target user which under directory id
`POST` `https://h1.ekoapp.com/api/v1/client-menus/:client-menu-id/push-notify/directories`

**Path Parameters**

NameTypeDescription

client-menu-id\*

String

the client menu unique id

**Headers**

NameTypeDescription

Authorization\*

String

`client-credential` access token with `client-menu` scope

**Request Body**

NameTypeDescription

payload\*

object

push notification payload. maximum size 4KB

payload.title\*

String

push notification title

payload.message\*

String

push notification message

payload.redirectUri\*

String

redirect uri to get into sub-page of client menu

directoryIds\*

String\[]

target directory ids to send push notification. Up to **5** are allowed in a single requests

excludes

String\[]

A list of **User IDs** which don't want to send push notify to them in case of they are in the target recipients. Up to **1000** are allowed in a single request.

200: OKRequest ExampleResponse ExampleCopy

```
{
    "payload": {
        "redirectUri": "<REDIRECT_URI>",
        "title": "title here",
        "message": "What's up! How are you today."
    },
    "excludes": [
        "<USER_ID>",
        "<ANOTHER_USER_ID>"
    ],
    "directoryIds": [
        "<TARGET_DIRECTORY_ID>"
    ]
}
```

#### Push Notification Log
### Get push notification error log
`GET` `https://h1.ekoapp.com/api/v1/client-menus/push-notifications/:reference-id/users/:user-id`

**Path Parameters**

NameTypeDescription

reference-id\*

string

push notification reference id

user-id\*

string

target user id

**Headers**

NameTypeDescription

Authorization\*

String

`client-credential` access token with `client-menu` scope

200: OK Found the error log of particular user404: Not Found Not found any error log of particular userCopy

```
{
    "referenceId": "<REFERENCE_ID>",
    "userId": "<USER_ID>",
    "errorMessage": "Error message"
}
```

#### Clear Unread
### Clear unread indicator
`POST` `https://h1.ekoapp.com/api/v1/client-menus/:client-menu-id/clear-unread`

**Path Parameters**

NameTypeDescription

client-menu-id\*

String

the client menu unique id

**Headers**

NameTypeDescription

Authorization\*

String

`client-credential` access token with `client-menu` scope

**Request Body**

NameTypeDescription

userId\*

String

target user id

200: OKRequest ExampleResponse ExampleCopy

```
{
    "userId": "<TARGET_USER_ID>"
}
```
