# Push Notification

Manage your push notification.

## List an app push notification

> Retrieve a collection of app push notification.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.3"},"tags":[{"name":"Push Notification","description":"Manage your push notification.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/mobile_push":{"get":{"tags":["Push Notification"],"operationId":"listPushes","summary":"List an app push notification","description":"Retrieve a collection of app push notification.\n","parameters":[{"name":"filter","in":"query","required":false,"schema":{"type":"string"},"description":"Use the `filter` query parameter to retrieve just a subset of a collection.\n"},{"name":"search","in":"query","required":false,"schema":{"type":"string"},"description":"Use the `search` query parameter to restrict the results of a request to match a search criterion.\n"},{"name":"orderby","in":"query","required":false,"schema":{"type":"string"},"description":"Use the `orderby` query parameter to specify the sort order of the items returned from server.  \nThe default order is ascending order.\n"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","format":"int32","minimum":0,"default":0},"description":"Use the `skip` query parameter to set the number of items to skip at the start of a collection.\n"},{"name":"top","in":"query","required":false,"schema":{"type":"integer","format":"int32","minimum":1,"maximum":100,"default":100},"description":"Use the `top` query parameter to specify the page size of the result set.\n"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","format":"int64","minimum":0,"description":"Total number of resource.\n"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of push profile.\n"},"app_name":{"type":"string","minLength":1,"maxLength":64,"description":"Application name.\n"},"enabled":{"type":"boolean","default":true,"description":"Enabled this notification or not.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Add App for enabling push notification

> Mobile push messages wake up PortSIP Solutions Soft Phone or other Client Apps\
> on mobile device so that a call or Instant Message can be accepted, \
> reducing battery usage and improving reliability\
> Android devices receive push notifications from Firebase Cloud Messaging Server;\
> iOS devices receive push notifications from APNs.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.3"},"tags":[{"name":"Push Notification","description":"Manage your push notification.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/mobile_push":{"post":{"tags":["Push Notification"],"operationId":"createPush","summary":"Add App for enabling push notification","description":"Mobile push messages wake up PortSIP Solutions Soft Phone or other Client Apps\non mobile device so that a call or Instant Message can be accepted, \nreducing battery usage and improving reliability\nAndroid devices receive push notifications from Firebase Cloud Messaging Server;\niOS devices receive push notifications from APNs.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"app_name":{"type":"string","minLength":1,"maxLength":64,"description":"Application name.\n"},"enabled":{"type":"boolean","default":true,"description":"Enabled this notification or not.\n"},"mode":{"type":"string","enum":["PRODUCTION","DEVELOPMENT"],"default":"PRODUCTION","description":"Connect to Apple/Google development push server or production push server:\n- `PRODUCTION`: Connect to Apple/Google production push server.\n- `DEVELOPMENT`: Connect to Apple/Google development push server.\n"},"android_service_account":{"type":"string","description":"The Firebase Cloud Messaging service account JSON file.\n"},"ios_certificate":{"type":"string","description":"Content of this APNs SSL certificate key file.\n"},"ios_private_key":{"type":"string","description":"Content of this APNs SSL private key file.\n"}}}}}},"responses":{"201":{"description":"Created push","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of push profile.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Retrieve an app push notification.

> Retrieve details of app push notification by it's unique ID.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.3"},"tags":[{"name":"Push Notification","description":"Manage your push notification.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/mobile_push/{id}":{"get":{"tags":["Push Notification"],"operationId":"showPush","summary":"Retrieve an app push notification.","description":"Retrieve details of app push notification by it's unique ID.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of push profile.\n"},"description":"The unique ID of the app push notification."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of push profile.\n"},"app_name":{"type":"string","minLength":1,"maxLength":64,"description":"Application name.\n"},"enabled":{"type":"boolean","default":true,"description":"Enabled this notification or not.\n"},"mode":{"type":"string","enum":["PRODUCTION","DEVELOPMENT"],"default":"PRODUCTION","description":"Connect to Apple/Google development push server or production push server:\n- `PRODUCTION`: Connect to Apple/Google production push server.\n- `DEVELOPMENT`: Connect to Apple/Google development push server.\n"},"android_service_account":{"type":"string","description":"The Firebase Cloud Messaging service account JSON file.\n"},"ios_certificate":{"type":"string","description":"Content of this APNs SSL certificate key file.\n"},"ios_private_key":{"type":"string","description":"Content of this APNs SSL private key file.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## POST /mobile\_push/{id}

> Update an app push notification

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.3"},"tags":[{"name":"Push Notification","description":"Manage your push notification.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/mobile_push/{id}":{"post":{"tags":["Push Notification"],"operationId":"updatePush","summary":"Update an app push notification","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of push profile.\n"},"description":"The unique ID of the app push notification."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"app_name":{"type":"string","minLength":1,"maxLength":64,"description":"Application name.\n"},"enabled":{"type":"boolean","default":true,"description":"Enabled this notification or not.\n"},"mode":{"type":"string","enum":["PRODUCTION","DEVELOPMENT"],"default":"PRODUCTION","description":"Connect to Apple/Google development push server or production push server:\n- `PRODUCTION`: Connect to Apple/Google production push server.\n- `DEVELOPMENT`: Connect to Apple/Google development push server.\n"},"android_service_account":{"type":"string","description":"The Firebase Cloud Messaging service account JSON file.\n"},"ios_certificate":{"type":"string","description":"Content of this APNs SSL certificate key file.\n"},"ios_private_key":{"type":"string","description":"Content of this APNs SSL private key file.\n"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## POST /mobile\_push/{id}/destroy

> Delete an app push notification.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.3"},"tags":[{"name":"Push Notification","description":"Manage your push notification.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/mobile_push/{id}/destroy":{"post":{"tags":["Push Notification"],"operationId":"deletePush","summary":"Delete an app push notification.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of push profile.\n"},"description":"The unique ID of the app push notification."}],"responses":{"204":{"description":"No Content"},"4XX":{"description":"Error"}}}}}}
```


---

# Agent Instructions: 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://support.portsip.com/development-portsip/rest-apis/version-22.3/push-notification.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.
