# Add a new App Notification payload configuration to an existing profile To create Ios App Notification policy ## Endpoint **POST** `/api/v1/mdm/profiles/{profile_id}/payloads/iosappnotificationpolicy` ## Request ### Request URL ``` https://{serverurl}/api/v1/mdm/profiles/{profile_id}/payloads/iosappnotificationpolicy ``` `{serverurl}`: https://www.manageengine.com/mobile-device-management/help/api/cloud/oauth-authentication-endpoint-domain.html ### Scope ``` MDMOnDemand.MDMDeviceMgmt.CREATE ``` ### Header ``` Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52 ``` ### Request Parameters #### Path Parameters - **profile_id** (string) — **Mandatory** Unique identifier of the profile. Obtain from the [Create Profile](https://www.manageengine.com/mobile-device-management/help/api/cloud/profiles-create-profile.html) or [Get Profiles](https://www.manageengine.com/mobile-device-management/help/api/cloud/profiles-get-profile.html) response #### Query Parameters - **t** (long) — Optional - **ignoreHeader** (boolean) — Optional - **qlt** (long) — Optional - **previousTab** (string) — Optional - **service** (string) — Optional - **search** (string) — Optional Free-text search string applied to the default searchable fields of the resource - **all** (boolean) — Optional - **dc_customerid** (long) — Optional - **mdm_instance** (string) — Optional - **signupsrc** (string) — Optional - **zaaid** (string) — Optional - **command** (string) — Optional - **orderby** (string) — Optional - **sortorder** (string) — Optional - **select_all** (boolean) — Optional When true, applies the operation to every record matching the current filter rather than to specific IDs. Default: false - **zoho-internal** (boolean) — Optional - **dc_instance** (string) — Optional - **SUBREQUEST** (string) — Optional - **source** (string) — Optional - **nocache** (long) — Optional param to avoid being served from cache - **wms_csrparam** (string) — Optional CSRF Token ### Request Body **Content-Type:** `application/json` **Type:** JSON object #### app_notification_settings (JSON array) — Mandatory List of per-app notification settings Each item in the array: - **notifications_enabled** (boolean) — Optional Whether notifications are enabled for this app. Default: true - **badges_enabled** (boolean) — Optional Whether badge count is shown. Default: true - **alert_type** (integer) — Optional Alert style. Allowed values: - `0` = None - `1` = Banners (temporary) - `2` = Alerts (require action) - **preview_type** (integer) — Optional Notification preview type. Allowed values: - `0` = Always - `1` = When Unlocked - `2` = Never - **grouping_type** (integer) — Optional Notification grouping. Allowed values: - `0` = Automatic - `1` = By App - `2` = Off - **show_in_notification_center** (boolean) — Optional Show in Notification Center. Default: true - **show_in_lock_screen** (boolean) — Optional Show on Lock Screen. Default: true - **show_in_car_play** (boolean) — Optional Show in CarPlay. Default: true - **sounds_enabled** (boolean) — Optional Whether notification sounds are enabled. Default: true - **critical_alert_enabled** (boolean) — Optional Whether critical alerts are enabled. Default: false - **apps** (array) — Optional List of app IDs (long) for this notification setting. Use the app_group_id from the [Apps API](https://www.manageengine.com/mobile-device-management/help/api/cloud/app-management-get-an-app.html) response --- ## Sample Request ### Curl ```bash curl --request POST \ --url https://appdomain/api/v1/mdm/profiles/{profile_id}/payloads/iosappnotificationpolicy \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'content-type: application/json' \ --data '{"app_notification_settings":[{}]}' ``` ### Java ```java import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.io.IOException; import java.net.http.HttpTimeoutException; public class Main { public static void main(String[] args) { HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://appdomain/api/v1/mdm/profiles/{profile_id}/payloads/iosappnotificationpolicy")) .header("content-type", "application/json") .header("Authorization", "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52") .method("POST", HttpRequest.BodyPublishers.ofString("{\"app_notification_settings\":[{}]}")) .build(); HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } } ``` ### Python ```python import http.client conn = http.client.HTTPSConnection("appdomain") payload = "{\"app_notification_settings\":[{}]}" headers = { 'content-type': "application/json", 'Authorization': "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52" } conn.request("POST", "/api/v1/mdm/profiles/{profile_id}/payloads/iosappnotificationpolicy", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ### Deluge ```javascript headersMap = Map(); headersMap.put("Content-Type", "application/json"); headersMap.put("Accept", "application/json"); data = Map(); data_app_notification_settings = List(); data_app_notification_settings_item1 = Map(); data_app_notification_settings.add(data_app_notification_settings_item1); data.put("app_notification_settings", data_app_notification_settings); response = invokeUrl [ url: "https://appDomain/api/v1/mdm/profiles/{profile_id}/payloads/iosappnotificationpolicy" type: POST headers: headersMap body: data connection: connection_name ] info response; ``` ### PowerShell ```powershell $headers=@{} $headers.Add("content-type", "application/json") $headers.Add("Authorization", "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52") $response = Invoke-WebRequest -Uri 'https://appdomain/api/v1/mdm/profiles/{profile_id}/payloads/iosappnotificationpolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{"app_notification_settings":[{}]}' ``` --- ## Sample Request Body ```json { "app_notification_settings": [ { "badges_enabled": true, "notifications_enabled": true, "alert_type": 1, "apps": [ 9007199254741072 ] } ] } ``` --- ## Response ### HTTP 200 **Response Body:** `application/json` **Type:** JSON object - **payload_id** (long) Unique identifier for the created payload item - **app_notification_settings** (JSON array) List of per-app notification settings Each item in the array: - **notifications_enabled** (boolean) Whether notifications are enabled for this app. Default: true - **badges_enabled** (boolean) Whether badge count is shown. Default: true - **alert_type** (integer) Alert style. Allowed values: - `0` = None - `1` = Banners (temporary) - `2` = Alerts (require action) - **preview_type** (integer) Notification preview type. Allowed values: - `0` = Always - `1` = When Unlocked - `2` = Never - **grouping_type** (integer) Notification grouping. Allowed values: - `0` = Automatic - `1` = By App - `2` = Off - **show_in_notification_center** (boolean) Show in Notification Center. Default: true - **show_in_lock_screen** (boolean) Show on Lock Screen. Default: true - **show_in_car_play** (boolean) Show in CarPlay. Default: true - **sounds_enabled** (boolean) Whether notification sounds are enabled. Default: true - **critical_alert_enabled** (boolean) Whether critical alerts are enabled. Default: false - **apps** (array) List of app IDs (long) for this notification setting. Use the app_group_id from the [Apps API](https://www.manageengine.com/mobile-device-management/help/api/cloud/app-management-get-an-app.html) response ### Sample Response (HTTP 200) ```json { "payload_id": 9007199254741000, "app_notification_settings": [ { "badges_enabled": true, "notifications_enabled": true, "alert_type": 1, "apps": [ 9007199254741072 ] } ] } ``` ## Possible Response Codes - **200** — HTTP code ## Rate Limit - **Duration:** 1 minute - **Threshold:** 30 - **Lock period:** 5 minutes - Duration — Time window for the threshold. - Threshold — Number of API calls allowed within the specified duration. - Lock Period — Wait time before consecutive API requests.