Skip to content

Create conditions

Request

API to create conditions.

Security
AdministrationAccess or ClientAccess
Path
instanceIdstring, (uuid)required

The UUID of the Dynamic Monetization instance.

Bodyapplication/json
conditionsArray of objects(ConditionReadOnlyId)

List of conditions

A sample list of conditions.

curl -i -X POST \
  'https://siteID.flexnetoperations.com/dynamicmonetization/api/v1.1/instances/{instanceId}/conditions' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "conditions": [
      {
        "name": "compositeCondition",
        "operator": "AND",
        "conditions": [
          {
            "operator": "IN",
            "property": "status",
            "values": [
              "active",
              "pending"
            ]
          },
          {
            "operator": "NOT",
            "condition": {
              "operator": "IN",
              "property": "category",
              "values": [
                "restricted"
              ]
            }
          }
        ]
      },
      {
        "name": "simpleCondition",
        "operator": "IN",
        "property": "category",
        "values": [
          "gold",
          "silver"
        ]
      }
    ]
  }'

Responses

OK. The request succeeded in its entirety. The response body contains a list of the conditions that were created, existing conditions are not returned.

Bodyapplication/json
Array [
One of:
]
Response

A sample list of conditions.

[ { "id": "123e4567-e89b-12d3-a456-426614174004", "name": "compositeCondition", "operator": "AND", "conditions": [ … ] }, { "id": "123e4567-e89b-12d3-a456-426614174000", "name": "simpleCondition", "operator": "IN", "property": "category", "values": [ … ] } ]