Use the links on this page to view a more detailed reference about the resource, including full sample requests and responses.
This scenario assumes that you have already reviewed the Apply a Policy to an App (with Options) scenario. The basic steps for applying a policy are the same. The difference is that in the Apply a Policy scenario, we manually configured the policy's options. In this scenario, we'll retrieve the options from a preset configuration.
Step 1 - Retrieve the policy's preset configurations
Send the following request:
The response includes data about a specific policy, including any preset configurations.
In this example we can see that this policy includes two presets,
Survey2, which are nested within the configurations array.
Step 2 - Use the preset when applying the policy
Copy the Preset
There are 2 ways to use a preset configuration when applying the policy to an app.
You can copy the embedded
configuration attribute only:
Or you can copy the entire higher-level preset
Notice that the higher-level preset configuration object also includes other attributes. The API only processes the
enabled_by_default attributes; all others are ignored.
Using the entire preset configuration object allows you to pass all of these parameters at once when applying the policy, which saves you from entering each parameter separately.
Apply the Policy
The process for applying the policy is exactly the same as it is in Apply a Policy to an App (with Options), but when you prepare the configurations object in step 2, you'll include a copy of the preset rather than manually editing the options.
Here is an example POST /applications/app_id/policies/ request that uses a copy of the entire higher-level preset
Click the previous link for an example response in the API reference.