How to construct "Deployment Rules' for the REST API request to add and update the Public APP Store

How to construct "Deployment Rules' for the REST API request to add and update the Public APP Store

book

Article ID: CTX585002

calendar_today

Updated On:

Description

This document is to record an easier method to construct the field 'Deployment Rules' in the REST API request to add and update the APP in the Public APP Store.

Instructions

What does the request look like

 "Rules" field in request body represents the "deployment rule", REST API Request body sample for
{ "name": "Microsoft Word", "description": "app description", "categories": [ "Default" ], "roles": [ "AllUsers" ], "schedule": { "enableDeployment": true, "deploySchedule": "NOW", "deployScheduleCondition": "EVERYTIME", "deployDate": "03/14/2024", "deployTime": "17:44", "deployInBackground": false }, "iphone": { "storeUrl": "https://itunes.apple.com/us/app/microsoft-word/id586447913?mt=8", "removeWithMdm": true, "preventBackup": true, "changeManagementState": true, "displayName": "Microsoft Office Word", "description": "Microsoft Office Word app from app store", "rules": "{\"AND\":[{\"eq\":{\"property\":{\"type\":\"DEVICE_PROPERTY\",\"name\":\"sharedStatus\"},\"type\":\"STRING\",\"value\":\"NO_SHARED\"}}]}", "faqs": [     { "question": "Question?", "answer": "Answer", "displayOrder": "1" } ], "storeSettings": { "rate": false, "review": false } }, "android": { "storeUrl": "https://play.google.com/store/apps/details?id=com.microsoft.office.word", "displayName": "Microsoft Office Word", "rules":"{\"AND\":[{\"eq\":{\"property\":{\"type\":\"SOFTWARE\",\"name\":\"name\"},\"type\":\"STRING\",\"value\":\"12345\"}},{\"eq\":{\"property\":{\"type\":\"DEVICE_PROPERTY\",\"name\":\"CORPORATE_OWNED\"},\"type\":\"NUMBER\",\"value\":\"0\"}}]}" }} 

 

{ "name": "Microsoft Word - Prod", "description": "app description updated", "categories": [ "Default" ], "roles": [ "AllUsers" ], "schedule": { "enableDeployment": true, "deploySchedule": "NOW", "deployScheduleCondition": "EVERYTIME", "deployDate": "", "deployTime": "", "deployInBackground": false }, "iphone": { "rules":"{\"AND\":[{\"eq\":{\"property\":{\"type\":\"SOFTWARE\",\"name\":\"name\"},\"type\":\"STRING\",\"value\":\"12345\"}},{\"eq\":{\"property\":{\"type\":\"DEVICE_PROPERTY\",\"name\":\"CORPORATE_OWNED\"},\"type\":\"NUMBER\",\"value\":\"0\"}}]}", "faqs": [], "storeSettings": { "rate": true, "review": true }, "checkForUpdate": true }}




To get the rule from the UI debug tool and fill it to the REST request.

The grammar of "Rules" is a bit complicated.  Following steps are a copy-paste method and could be used to make the work easier

  1.   Create a public store app on Console UI and set "deployment rule" you expect. For example:

image.png
 

  1. Launch develop tool on your web browser, select "Network" tab. Edit the created APP and check the response of request "https://fqdn:4443/controlpoint/rest/application/appstore/XXX", then the "rules" could be found in response body.   

     
    image.png

 

  1. Copy "rules" value and fill it in the REST API request.