{"templateId":"../../../@theme/Templates/StepByStep.tsx","sharedDataIds":{"sidebar":"sidebar-products/dynamicmonetization/sidebars.yaml","oas-products/dynamicmonetization/apis/openapi-spec.yaml":"oas-products/dynamicmonetization/apis/openapi-spec.yaml"},"props":{"metadata":{"markdoc":{"tagList":["split","admonition","img","openapi-code-sample"]},"type":"markdown"},"seo":{"title":"Controlling Access with Conditions and Actions","description":"API documentation for Revenera products","siteUrl":"https://developer.revenera.com","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":["openapi"],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"controlling-access-with-conditions-and-actions","__idx":0},"children":["Controlling Access with Conditions and Actions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This tutorial presents a fictional scenario that guides you through configuring a rate table and setting up conditions and actions that determine whether a user is permitted to access a certain line item."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"scenario","__idx":1},"children":["Scenario"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Your customer has purchased ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["200"]}," tokens in a single line item with activation ID ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["abc123"]},". They want to allow access to the line item ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["only if"]}," the requester is from the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Engineering"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Product Management"]},", or ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Product Marketing"]}," departments. They also want to allocate ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["150"]}," tokens to Engineering, and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["50"]}," tokens to Product Management and Product Marketing combined."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Nobody else should be able to consume tokens from this line item."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"steps-in-this-section","__idx":2},"children":["Steps in This Section"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#step-1-check-the-line-item"},"children":["Step 1: Check the line item"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#step-2-set-up-a-rate-table"},"children":["Step 2: Set Up a Rate Table"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#step-3-define-conditions"},"children":["Step 3: Define Conditions"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#step-4-create-actions-based-on-the-conditions"},"children":["Step 4: Create Actions Based on the Conditions"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#step-5-verify-the-setup"},"children":["Step 5: Verify the Setup"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#step-6-check-enforcement-of-allocations"},"children":["Step 6: Check Enforcement of Allocations"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#optional-retrieve-actions-to-verify-token-consumption"},"children":["Optional: Retrieve Actions to Verify Token Consumption"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#optional-further-exercise"},"children":["Optional: Further Exercise"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#optional-clean-up"},"children":["Optional: Clean Up"]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Split","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-1-check-the-line-item","__idx":3},"children":["Step 1: Check the line item"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/<version>/instances/{instanceId}/line-items"]}," using GET to view the line item that your customer has purchased."," ","Take a note of the activation ID and quantity in the response."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Further reading:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/apis/openapi-spec/line-items/addactivation"},"children":["Map a line item to an instance"]}," (API Reference)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/apis/openapi-spec/line-items/getactivationsforinstance"},"children":["Get a list of line items"]}," (API Reference)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/guides/elastic-access-concepts-for-all-back-office-types#line-items"},"children":["Line Items"]}," (User Guide)."]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/lockicons_outline.fe713255c781ec98810fde10236510245f92d8e3083fb8de0ce8b5fe8d6fad50.9c1bb791.svg","alt":"LockIcons_Outline.svg","framed":false,"withLightbox":true,"width":"","height":"16px"},"children":[]},"  ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authorization"]},": administration token or client token"]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API Call"]}]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"oas-products/dynamicmonetization/apis/openapi-spec.yaml","operationId":"getActivationsForInstance","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X GET \\\n  'https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/instances/{instanceId}/line-items' \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>'"},{"lang":"javascript","title":"JavaScript","source":"const instanceId = 'YOUR_instanceId_PARAMETER';\nconst resp = await fetch(\n  `https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/instances/${instanceId}/line-items`,\n  {\n    method: 'GET',\n    headers: {\n      Authorization: 'Bearer <YOUR_JWT_HERE>'\n    }\n  }\n);\n\nconst data = await resp.text();\nconsole.log(data);"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const instanceId = 'YOUR_instanceId_PARAMETER';\n  const resp = await fetch(\n    `https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/instances/${instanceId}/line-items`,\n    {\n      method: 'GET',\n      headers: {\n        Authorization: 'Bearer <YOUR_JWT_HERE>'\n      }\n    }\n  );\n\n  const data = await resp.text();\n  console.log(data);\n}\n\nrun();"},{"lang":"python","title":"Python","source":"import requests\n\ninstance_id = \"YOUR_instanceId_PARAMETER\"\nurl = \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/instances/\" + instance_id + \"/line-items\"\n\nheaders = {\"Authorization\": \"Bearer <YOUR_JWT_HERE>\"}\n\nresponse = requests.get(url, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var host = \"https://{siteid}.flexnetoperations.{domainextension}\";\n    var instanceId = \"YOUR_instanceId_PARAMETER\";\n    var pathname = \"/dynamicmonetization/provisioning/api/v1.1/instances/%7BinstanceId%7D/line-items\";\n    var request = HttpRequest.newBuilder()\n      .GET()\n      .uri(URI.create(host + pathname ))\n      .header(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new()\n    {\n      DefaultRequestHeaders =\n      {\n        {\"Authorization\", \"Bearer <YOUR_JWT_HERE>\"},\n      }\n    };\n\n      var InstanceId = \"YOUR_instanceId_PARAMETER\";\n    using HttpResponseMessage request = await client.GetAsync(\"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/instances/\" + InstanceId + \"/line-items\");\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\nconst instanceId = \"YOUR_instanceId_PARAMETER\";\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Bearer <YOUR_JWT_HERE>\"\n  ],\n  CURLOPT_URL => \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/instances/\" . instanceId . \"/line-items\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  instanceId := \"YOUR_instanceId_PARAMETER\";\n  reqUrl := \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/instances/\" + instanceId + \"/line-items\"\n  req, err := http.NewRequest(\"GET\", reqUrl, nil)\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"ruby","title":"Ruby","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\ninstance_id = 'YOUR_instanceId_PARAMETER'\nurl = URI('https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/instances/' + instance_id + '/line-items')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest['Authorization'] = 'Bearer <YOUR_JWT_HERE>'\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"r","title":"R","source":"library(httr)\n\ninstance_id = \"YOUR_instanceId_PARAMETER\"\n\n# create you own operator\n\"%&%\" <- function(x, y)paste0(x,y)\n\nurl = \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/instances/\" %&% instance_id %&% \"/line-items\"\n\ndata_req <- GET(\n  url,\n  add_headers(\"Authorization\" = \"Bearer <YOUR_JWT_HERE>\"),\n  verbose()\n)\n\ncontent(data_req)"}]},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Example Response"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The response includes details about the line item. Note the activation ID ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["abc123"]}," and quantity of ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["200"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"[\n  {\n    \"activationId\": \"abc123\",\n    \"state\": \"DEPLOYED\",\n    \"start\": 1695772800000,\n    \"end\": 1790467199999,\n    \"quantity\": 200,\n    \"used\": 0,\n    \"attributes\": {\n      \"elastic\": true,\n      \"rateTableSeries\": \"1\"\n    }\n  }\n]\n","lang":"json"},"children":[]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Split","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-2-set-up-a-rate-table","__idx":4},"children":["Step 2: Set Up a Rate Table"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["POST to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/<version>/rate-tables"]}," to create a rate table. Ensure that the rate table has an item that can be requested by requesters."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Further reading:",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/tutorials/managing-rate-tables-and-access-requests#creating-a-rate-table"},"children":["Creating a Rate Table"]}," (Tutorial)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/apis/openapi-spec/rate-tables/postratetables"},"children":["Create a rate table"]}," (API Reference)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/guides/elastic-access-concepts-for-all-back-office-types#rate-tables"},"children":["Rate Tables"]}," (User Guide)."]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/lockicons_outline.fe713255c781ec98810fde10236510245f92d8e3083fb8de0ce8b5fe8d6fad50.9c1bb791.svg","alt":"LockIcons_Outline.svg","framed":false,"withLightbox":true,"width":"","height":"16px"},"children":[]},"  ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authorization"]},": administration token"]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API Call"]}]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"oas-products/dynamicmonetization/apis/openapi-spec.yaml","operationId":"postRateTables","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X POST \\\n  'https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/rate-tables' \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"effectiveFrom\": 0,\n    \"series\": \"string\",\n    \"version\": \"string\",\n    \"items\": [\n      {\n        \"name\": \"string\",\n        \"version\": \"string\",\n        \"rate\": 0.1,\n        \"formula\": \"string\"\n      }\n    ]\n  }'"},{"lang":"javascript","title":"JavaScript","source":"const resp = await fetch(\n  `https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/rate-tables`,\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      Authorization: 'Bearer <YOUR_JWT_HERE>'\n    },\n    body: JSON.stringify({\n      effectiveFrom: 0,\n      series: 'string',\n      version: 'string',\n      items: [\n        {\n          name: 'string',\n          version: 'string',\n          rate: 0.1,\n          formula: 'string'\n        }\n      ]\n    })\n  }\n);\n\nconst data = await resp.json();\nconsole.log(data);"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const resp = await fetch(\n    `https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/rate-tables`,\n    {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json',\n        Authorization: 'Bearer <YOUR_JWT_HERE>'\n      },\n      body: JSON.stringify({\n        effectiveFrom: 0,\n        series: 'string',\n        version: 'string',\n        items: [\n          {\n            name: 'string',\n            version: 'string',\n            rate: 0.1,\n            formula: 'string'\n          }\n        ]\n      })\n    }\n  );\n\n  const data = await resp.json();\n  console.log(data);\n}\n\nrun();"},{"lang":"python","title":"Python","source":"import requests\n\nurl = \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/rate-tables\"\n\npayload = {\n  \"effectiveFrom\": 0,\n  \"series\": \"string\",\n  \"version\": \"string\",\n  \"items\": [\n    {\n      \"name\": \"string\",\n      \"version\": \"string\",\n      \"rate\": 0.1,\n      \"formula\": \"string\"\n    }\n  ]\n}\n\nheaders = {\n  \"Content-Type\": \"application/json\",\n  \"Authorization\": \"Bearer <YOUR_JWT_HERE>\"\n}\n\nresponse = requests.post(url, json=payload, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var payload = String.join(\"\\n\"\n      , \"{\"\n      , \" \\\"effectiveFrom\\\": 0,\"\n      , \" \\\"series\\\": \\\"string\\\",\"\n      , \" \\\"version\\\": \\\"string\\\",\"\n      , \" \\\"items\\\": [\"\n      , \"  {\"\n      , \"   \\\"name\\\": \\\"string\\\",\"\n      , \"   \\\"version\\\": \\\"string\\\",\"\n      , \"   \\\"rate\\\": 0.1,\"\n      , \"   \\\"formula\\\": \\\"string\\\"\"\n      , \"  }\"\n      , \" ]\"\n      , \"}\"\n    );\n\n    var host = \"https://{siteid}.flexnetoperations.{domainextension}\";\n    var pathname = \"/dynamicmonetization/provisioning/api/v1.1/rate-tables\";\n    var request = HttpRequest.newBuilder()\n      .POST(HttpRequest.BodyPublishers.ofString(payload))\n      .uri(URI.create(host + pathname ))\n      .header(\"Content-Type\", \"application/json\")\n      .header(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\nusing System.Text;\nusing System.Text.Json;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new()\n    {\n      DefaultRequestHeaders =\n      {\n        {\"Authorization\", \"Bearer <YOUR_JWT_HERE>\"},\n      }\n    };\n\n    string json = JsonSerializer.Serialize(new\n    {\n      effectiveFrom = \"0\",\n      series = \"string\",\n      version = \"string\",\n      items = new[] {\n        new {\n          name = \"string\",\n          version = \"string\",\n          rate = \"0.1\",\n          formula = \"string\"\n        }\n      },\n    });\n\n    using StringContent postData = new(json, Encoding.UTF8, \"application/json\");\n    using HttpResponseMessage request = await client.PostAsync(\"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/rate-tables\", postData);\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\n$curl = curl_init();\n\n$payload = array(\n  \"effectiveFrom\" => 0,\n  \"series\" => \"string\",\n  \"version\" => \"string\",\n  \"items\" => array(\n    array(\n      \"name\" => \"string\",\n      \"version\" => \"string\",\n      \"rate\" => 0.1,\n      \"formula\" => \"string\"\n    )\n  )\n);\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Bearer <YOUR_JWT_HERE>\",\n    \"Content-Type: application/json\"\n  ],\n  CURLOPT_POSTFIELDS => json_encode($payload),\n  CURLOPT_URL => \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/rate-tables\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"bytes\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  reqUrl := \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/rate-tables\"\n  var data = []byte(`{\n    \"effectiveFrom\": 0,\n    \"series\": \"string\",\n    \"version\": \"string\",\n    \"items\": [\n      {\n        \"name\": \"string\",\n        \"version\": \"string\",\n        \"rate\": 0.1,\n        \"formula\": \"string\"\n      }\n    ]\n  }`)\n  req, err := http.NewRequest(\"POST\", reqUrl, bytes.NewBuffer(data))\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Content-Type\", \"application/json\")\n  req.Header.Add(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"ruby","title":"Ruby","source":"require 'json'\nrequire 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI('https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/rate-tables')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest['Content-Type'] = 'application/json'\nrequest['Authorization'] = 'Bearer <YOUR_JWT_HERE>'\nrequest.body = {\n  effectiveFrom: 0,\n  series: 'string',\n  version: 'string',\n  items: [\n    {\n      name: 'string',\n      version: 'string',\n      rate: 0.1,\n      formula: 'string'\n    }\n  ]\n}.to_json\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"r","title":"R","source":"library(httr)\n\nbody = '{\n   \"effectiveFrom\": 0,\n   \"series\": \"string\",\n   \"version\": \"string\",\n   \"items\": [\n    {\n     \"name\": \"string\",\n     \"version\": \"string\",\n     \"rate\": 0.1,\n     \"formula\": \"string\"\n    }\n   ]\n}'\n\nurl = \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/provisioning/api/v1.1/rate-tables\"\n\ndata_req <- POST(\n  url,\n  add_headers(\"Content-Type\" = \"application/json\", \"Authorization\" = \"Bearer <YOUR_JWT_HERE>\"),\n  body = body,\n  encode = \"json\",\n  verbose()\n)\n\ncontent(data_req)"},{"lang":"json","title":"Payload application/json","source":"{\n  \"effectiveFrom\": 0,\n  \"series\": \"string\",\n  \"version\": \"string\",\n  \"items\": [\n    {\n      \"name\": \"string\",\n      \"version\": \"string\",\n      \"rate\": 0.1,\n      \"formula\": \"string\"\n    }\n  ]\n}"}]},"children":[]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Split","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-3-define-conditions","__idx":5},"children":["Step 3: Define Conditions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create conditions that check:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["if the requester's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["department"]}," attribute is set to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Engineering"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["if the requester's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["department"]}," attribute is set to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ProductManagement"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ProductMarketing"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The response will return two condition objects, each with a generated ID. Note the first ID associated with the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Engineering"]}," department, as it will be needed in the next step."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Further reading:",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/apis/openapi-spec/rules-of-access/postconditionsofaccess"},"children":["Create conditions"]}," (API Reference)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/guides/rules-of-access#what-are-conditions"},"children":["What Are Conditions"]}," (User Guide)."]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/lockicons_outline.fe713255c781ec98810fde10236510245f92d8e3083fb8de0ce8b5fe8d6fad50.9c1bb791.svg","alt":"LockIcons_Outline.svg","framed":false,"withLightbox":true,"width":"","height":"16px"},"children":[]},"  ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authorization"]},": administration token or client token"]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API Call"]}]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"oas-products/dynamicmonetization/apis/openapi-spec.yaml","operationId":"postConditionsOfAccess","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X POST \\\n  'https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/{instanceId}/conditions' \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"conditions\": [\n      {\n        \"name\": \"compositeCondition\",\n        \"operator\": \"AND\",\n        \"conditions\": [\n          {\n            \"operator\": \"IN\",\n            \"property\": \"status\",\n            \"values\": [\n              \"active\",\n              \"pending\"\n            ]\n          },\n          {\n            \"operator\": \"NOT\",\n            \"condition\": {\n              \"operator\": \"IN\",\n              \"property\": \"category\",\n              \"values\": [\n                \"restricted\"\n              ]\n            }\n          }\n        ]\n      },\n      {\n        \"name\": \"simpleCondition\",\n        \"operator\": \"IN\",\n        \"property\": \"category\",\n        \"values\": [\n          \"gold\",\n          \"silver\"\n        ]\n      }\n    ]\n  }'"},{"lang":"javascript","title":"JavaScript","source":"const instanceId = 'YOUR_instanceId_PARAMETER';\nconst resp = await fetch(\n  `https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/${instanceId}/conditions`,\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      Authorization: 'Bearer <YOUR_JWT_HERE>'\n    },\n    body: JSON.stringify({\n      conditions: [\n        {\n          name: 'compositeCondition',\n          operator: 'AND',\n          conditions: [\n            {\n              operator: 'IN',\n              property: 'status',\n              values: ['active', 'pending']\n            },\n            {\n              operator: 'NOT',\n              condition: {\n                operator: 'IN',\n                property: 'category',\n                values: ['restricted']\n              }\n            }\n          ]\n        },\n        {\n          name: 'simpleCondition',\n          operator: 'IN',\n          property: 'category',\n          values: ['gold', 'silver']\n        }\n      ]\n    })\n  }\n);\n\nconst data = await resp.json();\nconsole.log(data);"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const instanceId = 'YOUR_instanceId_PARAMETER';\n  const resp = await fetch(\n    `https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/${instanceId}/conditions`,\n    {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json',\n        Authorization: 'Bearer <YOUR_JWT_HERE>'\n      },\n      body: JSON.stringify({\n        conditions: [\n          {\n            name: 'compositeCondition',\n            operator: 'AND',\n            conditions: [\n              {\n                operator: 'IN',\n                property: 'status',\n                values: ['active', 'pending']\n              },\n              {\n                operator: 'NOT',\n                condition: {\n                  operator: 'IN',\n                  property: 'category',\n                  values: ['restricted']\n                }\n              }\n            ]\n          },\n          {\n            name: 'simpleCondition',\n            operator: 'IN',\n            property: 'category',\n            values: ['gold', 'silver']\n          }\n        ]\n      })\n    }\n  );\n\n  const data = await resp.json();\n  console.log(data);\n}\n\nrun();"},{"lang":"python","title":"Python","source":"import requests\n\ninstance_id = \"YOUR_instanceId_PARAMETER\"\nurl = \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" + instance_id + \"/conditions\"\n\npayload = {\n  \"conditions\": [\n    {\n      \"name\": \"compositeCondition\",\n      \"operator\": \"AND\",\n      \"conditions\": [\n        {\n          \"operator\": \"IN\",\n          \"property\": \"status\",\n          \"values\": [\n            \"active\",\n            \"pending\"\n          ]\n        },\n        {\n          \"operator\": \"NOT\",\n          \"condition\": {\n            \"operator\": \"IN\",\n            \"property\": \"category\",\n            \"values\": [\n              \"restricted\"\n            ]\n          }\n        }\n      ]\n    },\n    {\n      \"name\": \"simpleCondition\",\n      \"operator\": \"IN\",\n      \"property\": \"category\",\n      \"values\": [\n        \"gold\",\n        \"silver\"\n      ]\n    }\n  ]\n}\n\nheaders = {\n  \"Content-Type\": \"application/json\",\n  \"Authorization\": \"Bearer <YOUR_JWT_HERE>\"\n}\n\nresponse = requests.post(url, json=payload, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var payload = String.join(\"\\n\"\n      , \"{\"\n      , \" \\\"conditions\\\": [\"\n      , \"  {\"\n      , \"   \\\"name\\\": \\\"compositeCondition\\\",\"\n      , \"   \\\"operator\\\": \\\"AND\\\",\"\n      , \"   \\\"conditions\\\": [\"\n      , \"    {\"\n      , \"     \\\"operator\\\": \\\"IN\\\",\"\n      , \"     \\\"property\\\": \\\"status\\\",\"\n      , \"     \\\"values\\\": [\"\n      , \"      \\\"active\\\",\"\n      , \"      \\\"pending\\\"\"\n      , \"     ]\"\n      , \"    },\"\n      , \"    {\"\n      , \"     \\\"operator\\\": \\\"NOT\\\",\"\n      , \"     \\\"condition\\\": {\"\n      , \"      \\\"operator\\\": \\\"IN\\\",\"\n      , \"      \\\"property\\\": \\\"category\\\",\"\n      , \"      \\\"values\\\": [\"\n      , \"       \\\"restricted\\\"\"\n      , \"      ]\"\n      , \"     }\"\n      , \"    }\"\n      , \"   ]\"\n      , \"  },\"\n      , \"  {\"\n      , \"   \\\"name\\\": \\\"simpleCondition\\\",\"\n      , \"   \\\"operator\\\": \\\"IN\\\",\"\n      , \"   \\\"property\\\": \\\"category\\\",\"\n      , \"   \\\"values\\\": [\"\n      , \"    \\\"gold\\\",\"\n      , \"    \\\"silver\\\"\"\n      , \"   ]\"\n      , \"  }\"\n      , \" ]\"\n      , \"}\"\n    );\n\n    var host = \"https://{siteid}.flexnetoperations.{domainextension}\";\n    var instanceId = \"YOUR_instanceId_PARAMETER\";\n    var pathname = \"/dynamicmonetization/api/v1.1/instances/%7BinstanceId%7D/conditions\";\n    var request = HttpRequest.newBuilder()\n      .POST(HttpRequest.BodyPublishers.ofString(payload))\n      .uri(URI.create(host + pathname ))\n      .header(\"Content-Type\", \"application/json\")\n      .header(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\nusing System.Text;\nusing System.Text.Json;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new()\n    {\n      DefaultRequestHeaders =\n      {\n        {\"Authorization\", \"Bearer <YOUR_JWT_HERE>\"},\n      }\n    };\n\n    string json = JsonSerializer.Serialize(new\n    {\n      conditions = new[] {\n        new {\n          name = \"compositeCondition\",\n          operator = \"AND\",\n          conditions = new[] {\n            new {\n              operator = \"IN\",\n              property = \"status\",\n              values = new[] {\n                \"active\",\n                \"pending\"\n              },\n            },\n            new {\n              operator = \"NOT\",\n              condition = new {\n                operator = \"IN\",\n                property = \"category\",\n                values = new[] {\n                  \"restricted\"\n                },\n              }\n            }\n          },\n        },\n        new {\n          name = \"simpleCondition\",\n          operator = \"IN\",\n          property = \"category\",\n          values = new[] {\n            \"gold\",\n            \"silver\"\n          },\n        }\n      },\n    });\n\n    using StringContent postData = new(json, Encoding.UTF8, \"application/json\");\n      var InstanceId = \"YOUR_instanceId_PARAMETER\";\n    using HttpResponseMessage request = await client.PostAsync(\"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" + InstanceId + \"/conditions\", postData);\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\nconst instanceId = \"YOUR_instanceId_PARAMETER\";\n$curl = curl_init();\n\n$payload = array(\n  \"conditions\" => array(\n    array(\n      \"name\" => \"compositeCondition\",\n      \"operator\" => \"AND\",\n      \"conditions\" => array(\n        array(\n          \"operator\" => \"IN\",\n          \"property\" => \"status\",\n          \"values\" => array(\n            \"active\",\n            \"pending\"\n          )\n        ),\n        array(\n          \"operator\" => \"NOT\",\n          \"condition\" => array(\n            \"operator\" => \"IN\",\n            \"property\" => \"category\",\n            \"values\" => array(\n              \"restricted\"\n            )\n          )\n        )\n      )\n    ),\n    array(\n      \"name\" => \"simpleCondition\",\n      \"operator\" => \"IN\",\n      \"property\" => \"category\",\n      \"values\" => array(\n        \"gold\",\n        \"silver\"\n      )\n    )\n  )\n);\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Bearer <YOUR_JWT_HERE>\",\n    \"Content-Type: application/json\"\n  ],\n  CURLOPT_POSTFIELDS => json_encode($payload),\n  CURLOPT_URL => \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" . instanceId . \"/conditions\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"bytes\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  instanceId := \"YOUR_instanceId_PARAMETER\";\n  reqUrl := \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" + instanceId + \"/conditions\"\n  var data = []byte(`{\n    \"conditions\": [\n      {\n        \"name\": \"compositeCondition\",\n        \"operator\": \"AND\",\n        \"conditions\": [\n          {\n            \"operator\": \"IN\",\n            \"property\": \"status\",\n            \"values\": [\n              \"active\",\n              \"pending\"\n            ]\n          },\n          {\n            \"operator\": \"NOT\",\n            \"condition\": {\n              \"operator\": \"IN\",\n              \"property\": \"category\",\n              \"values\": [\n                \"restricted\"\n              ]\n            }\n          }\n        ]\n      },\n      {\n        \"name\": \"simpleCondition\",\n        \"operator\": \"IN\",\n        \"property\": \"category\",\n        \"values\": [\n          \"gold\",\n          \"silver\"\n        ]\n      }\n    ]\n  }`)\n  req, err := http.NewRequest(\"POST\", reqUrl, bytes.NewBuffer(data))\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Content-Type\", \"application/json\")\n  req.Header.Add(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"ruby","title":"Ruby","source":"require 'json'\nrequire 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\ninstance_id = 'YOUR_instanceId_PARAMETER'\nurl = URI('https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/' + instance_id + '/conditions')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest['Content-Type'] = 'application/json'\nrequest['Authorization'] = 'Bearer <YOUR_JWT_HERE>'\nrequest.body = {\n  conditions: [\n    {\n      name: 'compositeCondition',\n      operator: 'AND',\n      conditions: [\n        {\n          operator: 'IN',\n          property: 'status',\n          values: ['active', 'pending']\n        },\n        {\n          operator: 'NOT',\n          condition: {\n            operator: 'IN',\n            property: 'category',\n            values: ['restricted']\n          }\n        }\n      ]\n    },\n    {\n      name: 'simpleCondition',\n      operator: 'IN',\n      property: 'category',\n      values: ['gold', 'silver']\n    }\n  ]\n}.to_json\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"r","title":"R","source":"library(httr)\n\nbody = '{\n   \"conditions\": [\n    {\n     \"name\": \"compositeCondition\",\n     \"operator\": \"AND\",\n     \"conditions\": [\n      {\n       \"operator\": \"IN\",\n       \"property\": \"status\",\n       \"values\": [\n        \"active\",\n        \"pending\"\n       ]\n      },\n      {\n       \"operator\": \"NOT\",\n       \"condition\": {\n        \"operator\": \"IN\",\n        \"property\": \"category\",\n        \"values\": [\n         \"restricted\"\n        ]\n       }\n      }\n     ]\n    },\n    {\n     \"name\": \"simpleCondition\",\n     \"operator\": \"IN\",\n     \"property\": \"category\",\n     \"values\": [\n      \"gold\",\n      \"silver\"\n     ]\n    }\n   ]\n}'\n\ninstance_id = \"YOUR_instanceId_PARAMETER\"\n\n# create you own operator\n\"%&%\" <- function(x, y)paste0(x,y)\n\nurl = \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" %&% instance_id %&% \"/conditions\"\n\ndata_req <- POST(\n  url,\n  add_headers(\"Content-Type\" = \"application/json\", \"Authorization\" = \"Bearer <YOUR_JWT_HERE>\"),\n  body = body,\n  encode = \"json\",\n  verbose()\n)\n\ncontent(data_req)"},{"lang":"json","title":"Payload application/json","source":"{\n  \"conditions\": [\n    {\n      \"name\": \"compositeCondition\",\n      \"operator\": \"AND\",\n      \"conditions\": [\n        {\n          \"operator\": \"IN\",\n          \"property\": \"status\",\n          \"values\": [\n            \"active\",\n            \"pending\"\n          ]\n        },\n        {\n          \"operator\": \"NOT\",\n          \"condition\": {\n            \"operator\": \"IN\",\n            \"property\": \"category\",\n            \"values\": [\n              \"restricted\"\n            ]\n          }\n        }\n      ]\n    },\n    {\n      \"name\": \"simpleCondition\",\n      \"operator\": \"IN\",\n      \"property\": \"category\",\n      \"values\": [\n        \"gold\",\n        \"silver\"\n      ]\n    }\n  ]\n}"}]},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Request Body Example"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"[ \n  {\n    \"operator\": \"IN\",\n    \"property\": \"department\",\n    \"values\": [\n      \"Engineering\"\n    ]\n  },\n  {\n    \"operator\": \"IN\",\n    \"property\": \"department\",\n    \"values\": [\n      \"ProductManagement\",\n      \"ProductMarketing\"\n    ]\n  }\n]\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Example Response"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"[ \n  {\n    \"operator\": \"IN\",\n    \"property\": \"department\",\n    \"values\": [\n      \"Engineering\"\n    ],\n    \"id\": \"673cd8ee-d4d4-48ba-a4cc-235e61c96516\"\n  },\n  {\n    \"operator\": \"IN\",\n    \"property\": \"department\",\n    \"values\": [\n      \"ProductManagement\",\n      \"ProductMarketing\"\n    ],\n    \"id\": \"8077bc18-c3f7-4d9d-a560-637d5b118d0b\"\n  }\n]\n","lang":"json"},"children":[]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Split","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-4-create-actions-based-on-the-conditions","__idx":6},"children":["Step 4: Create Actions Based on the Conditions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Now, define actions that use the conditions to allow access and allocate the tokens. Replace the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["conditionId"]}," with the generated ID received in your conditions response."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add a final condition that denies requests from anything not matching one of the conditions. This prevents tokens being consumed, which have been allocated to the two groups."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Further reading:",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/apis/openapi-spec/rules-of-access/postconditionsofaccess"},"children":["Create conditions"]}," (API Reference)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/apis/openapi-spec/rules-of-access/createactions"},"children":["Create a list of actions and allocations for a line item"]}," (API Reference)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/guides/rules-of-access#what-are-conditions"},"children":["What Are Conditions"]}," (User Guide)."]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/lockicons_outline.fe713255c781ec98810fde10236510245f92d8e3083fb8de0ce8b5fe8d6fad50.9c1bb791.svg","alt":"LockIcons_Outline.svg","framed":false,"withLightbox":true,"width":"","height":"16px"},"children":[]},"  ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authorization"]},": administration token or client token"]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API Call"]}]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"oas-products/dynamicmonetization/apis/openapi-spec.yaml","operationId":"createActions","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X POST \\\n  'https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/{instanceId}/line-items/{lineItemId}/actions' \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"actions\": [\n      {\n        \"name\": \"string\",\n        \"conditionId\": \"1e06e0eb-07f6-4fcd-8750-870cbafd1693\",\n        \"action\": \"ALLOW\",\n        \"allocation\": 1000\n      }\n    ]\n  }'"},{"lang":"javascript","title":"JavaScript","source":"const instanceId = 'YOUR_instanceId_PARAMETER';\nconst lineItemId = 'YOUR_lineItemId_PARAMETER';\nconst resp = await fetch(\n  `https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/${instanceId}/line-items/${lineItemId}/actions`,\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      Authorization: 'Bearer <YOUR_JWT_HERE>'\n    },\n    body: JSON.stringify({\n      actions: [\n        {\n          name: 'string',\n          conditionId: '1e06e0eb-07f6-4fcd-8750-870cbafd1693',\n          action: 'ALLOW',\n          allocation: 1000\n        }\n      ]\n    })\n  }\n);\n\nconst data = await resp.json();\nconsole.log(data);"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const instanceId = 'YOUR_instanceId_PARAMETER';\n  const lineItemId = 'YOUR_lineItemId_PARAMETER';\n  const resp = await fetch(\n    `https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/${instanceId}/line-items/${lineItemId}/actions`,\n    {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json',\n        Authorization: 'Bearer <YOUR_JWT_HERE>'\n      },\n      body: JSON.stringify({\n        actions: [\n          {\n            name: 'string',\n            conditionId: '1e06e0eb-07f6-4fcd-8750-870cbafd1693',\n            action: 'ALLOW',\n            allocation: 1000\n          }\n        ]\n      })\n    }\n  );\n\n  const data = await resp.json();\n  console.log(data);\n}\n\nrun();"},{"lang":"python","title":"Python","source":"import requests\n\ninstance_id = \"YOUR_instanceId_PARAMETER\"\nline_item_id = \"YOUR_lineItemId_PARAMETER\"\nurl = \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" + instance_id + \"/line-items/\" + line_item_id + \"/actions\"\n\npayload = {\n  \"actions\": [\n    {\n      \"name\": \"string\",\n      \"conditionId\": \"1e06e0eb-07f6-4fcd-8750-870cbafd1693\",\n      \"action\": \"ALLOW\",\n      \"allocation\": 1000\n    }\n  ]\n}\n\nheaders = {\n  \"Content-Type\": \"application/json\",\n  \"Authorization\": \"Bearer <YOUR_JWT_HERE>\"\n}\n\nresponse = requests.post(url, json=payload, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var payload = String.join(\"\\n\"\n      , \"{\"\n      , \" \\\"actions\\\": [\"\n      , \"  {\"\n      , \"   \\\"name\\\": \\\"string\\\",\"\n      , \"   \\\"conditionId\\\": \\\"1e06e0eb-07f6-4fcd-8750-870cbafd1693\\\",\"\n      , \"   \\\"action\\\": \\\"ALLOW\\\",\"\n      , \"   \\\"allocation\\\": 1000\"\n      , \"  }\"\n      , \" ]\"\n      , \"}\"\n    );\n\n    var host = \"https://{siteid}.flexnetoperations.{domainextension}\";\n    var instanceId = \"YOUR_instanceId_PARAMETER\";\n    var lineItemId = \"YOUR_lineItemId_PARAMETER\";\n    var pathname = \"/dynamicmonetization/api/v1.1/instances/%7BinstanceId%7D/line-items/%7BlineItemId%7D/actions\";\n    var request = HttpRequest.newBuilder()\n      .POST(HttpRequest.BodyPublishers.ofString(payload))\n      .uri(URI.create(host + pathname ))\n      .header(\"Content-Type\", \"application/json\")\n      .header(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\nusing System.Text;\nusing System.Text.Json;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new()\n    {\n      DefaultRequestHeaders =\n      {\n        {\"Authorization\", \"Bearer <YOUR_JWT_HERE>\"},\n      }\n    };\n\n    string json = JsonSerializer.Serialize(new\n    {\n      actions = new[] {\n        new {\n          name = \"string\",\n          conditionId = \"1e06e0eb-07f6-4fcd-8750-870cbafd1693\",\n          action = \"ALLOW\",\n          allocation = \"1000\"\n        }\n      },\n    });\n\n    using StringContent postData = new(json, Encoding.UTF8, \"application/json\");\n      var InstanceId = \"YOUR_instanceId_PARAMETER\";\n      var LineItemId = \"YOUR_lineItemId_PARAMETER\";\n    using HttpResponseMessage request = await client.PostAsync(\"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" + InstanceId + \"/line-items/\" + LineItemId + \"/actions\", postData);\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\nconst instanceId = \"YOUR_instanceId_PARAMETER\";\nconst lineItemId = \"YOUR_lineItemId_PARAMETER\";\n$curl = curl_init();\n\n$payload = array(\n  \"actions\" => array(\n    array(\n      \"name\" => \"string\",\n      \"conditionId\" => \"1e06e0eb-07f6-4fcd-8750-870cbafd1693\",\n      \"action\" => \"ALLOW\",\n      \"allocation\" => 1000\n    )\n  )\n);\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Bearer <YOUR_JWT_HERE>\",\n    \"Content-Type: application/json\"\n  ],\n  CURLOPT_POSTFIELDS => json_encode($payload),\n  CURLOPT_URL => \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" . instanceId . \"/line-items/\" . lineItemId . \"/actions\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"bytes\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  instanceId := \"YOUR_instanceId_PARAMETER\";\n  lineItemId := \"YOUR_lineItemId_PARAMETER\";\n  reqUrl := \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" + instanceId + \"/line-items/\" + lineItemId + \"/actions\"\n  var data = []byte(`{\n    \"actions\": [\n      {\n        \"name\": \"string\",\n        \"conditionId\": \"1e06e0eb-07f6-4fcd-8750-870cbafd1693\",\n        \"action\": \"ALLOW\",\n        \"allocation\": 1000\n      }\n    ]\n  }`)\n  req, err := http.NewRequest(\"POST\", reqUrl, bytes.NewBuffer(data))\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Content-Type\", \"application/json\")\n  req.Header.Add(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"ruby","title":"Ruby","source":"require 'json'\nrequire 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\ninstance_id = 'YOUR_instanceId_PARAMETER'\nline_item_id = 'YOUR_lineItemId_PARAMETER'\nurl = URI('https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/' + instance_id + '/line-items/' + line_item_id + '/actions')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest['Content-Type'] = 'application/json'\nrequest['Authorization'] = 'Bearer <YOUR_JWT_HERE>'\nrequest.body = {\n  actions: [\n    {\n      name: 'string',\n      conditionId: '1e06e0eb-07f6-4fcd-8750-870cbafd1693',\n      action: 'ALLOW',\n      allocation: 1000\n    }\n  ]\n}.to_json\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"r","title":"R","source":"library(httr)\n\nbody = '{\n   \"actions\": [\n    {\n     \"name\": \"string\",\n     \"conditionId\": \"1e06e0eb-07f6-4fcd-8750-870cbafd1693\",\n     \"action\": \"ALLOW\",\n     \"allocation\": 1000\n    }\n   ]\n}'\n\ninstance_id = \"YOUR_instanceId_PARAMETER\"\nline_item_id = \"YOUR_lineItemId_PARAMETER\"\n\n# create you own operator\n\"%&%\" <- function(x, y)paste0(x,y)\n\nurl = \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" %&% instance_id %&% \"/line-items/\" %&% line_item_id %&% \"/actions\"\n\ndata_req <- POST(\n  url,\n  add_headers(\"Content-Type\" = \"application/json\", \"Authorization\" = \"Bearer <YOUR_JWT_HERE>\"),\n  body = body,\n  encode = \"json\",\n  verbose()\n)\n\ncontent(data_req)"},{"lang":"json","title":"Payload application/json","source":"{\n  \"actions\": [\n    {\n      \"name\": \"string\",\n      \"conditionId\": \"1e06e0eb-07f6-4fcd-8750-870cbafd1693\",\n      \"action\": \"ALLOW\",\n      \"allocation\": 1000\n    }\n  ]\n}"}]},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Request Body Example"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"[\n  {\n    \"name\": \"Engineering allocation\",\n    \"conditionId\": \"673cd8ee-d4d4-48ba-a4cc-235e61c96516\",\n    \"action\": \"ALLOW\",\n    \"allocation\": 100\n  },\n  {\n    \"name\": \"PM & PMM allocation\",\n    \"conditionId\": \"8077bc18-c3f7-4d9d-a560-637d5b118d0b\",\n    \"action\": \"ALLOW\",\n    \"allocation\": 150\n  },\n  {\n    \"name\": \"default\",\n    \"conditionId\": \"\",\n    \"action\":\"DENY\"\n  }\n]\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Response Example"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"[\n  {\n    \"name\": \"Engineering allocation\",\n    \"conditionId\": \"673cd8ee-d4d4-48ba-a4cc-235e61c96516\",\n    \"action\": \"ALLOW\",\n    \"allocation\": 100,\n    \"id\": \"6e8d23b0-8e7c-4962-8963-74ef1de693e2\"\n  },\n  {\n    \"name\": \"PM & PMM allocation\",\n    \"conditionId\": \"8077bc18-c3f7-4d9d-a560-637d5b118d0b\",\n    \"action\": \"ALLOW\",\n    \"allocation\": 150,\n    \"id\": \"d8a9e55e-ad56-4b89-849f-c08eae92feb8\"\n  },\n  {\n    \"name\": \"default\",\n    \"conditionId\": \"\",\n    \"action\":\"DENY\",\n    \"id\": \"7fdf0258-3350-4d94-868f-f5c8e821a616\"\n  }\n]\n","lang":"json"},"children":[]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Split","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-5-verify-the-setup","__idx":7},"children":["Step 5: Verify the Setup"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Call ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["/conditions"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["/actions"]}," to confirm everything is configured correctly."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Further reading:",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/apis/openapi-spec/rules-of-access/postconditionsofaccess"},"children":["Create conditions"]}," (API Reference)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/apis/openapi-spec/rules-of-access/createactions"},"children":["Create a list of actions and allocations for a line item"]}," (API Reference)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/guides/rules-of-access#what-are-conditions"},"children":["What Are Conditions"]}," (User Guide)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/guides/rules-of-access#what-are-actions"},"children":["What Are Actions"]}," (User Guide)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/guides/rules-of-access#how-actions-and-conditions-work-together"},"children":["How Actions and Conditions Work Together"]}," (User Guide)."]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/lockicons_outline.fe713255c781ec98810fde10236510245f92d8e3083fb8de0ce8b5fe8d6fad50.9c1bb791.svg","alt":"LockIcons_Outline.svg","framed":false,"withLightbox":true,"width":"","height":"16px"},"children":[]},"  ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authorization"]},": administration token or client token"]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API Call to Check Conditions"]}]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"oas-products/dynamicmonetization/apis/openapi-spec.yaml","operationId":"getConditionsOfAccess","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X GET \\\n  'https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/{instanceId}/conditions' \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>'"},{"lang":"javascript","title":"JavaScript","source":"const instanceId = 'YOUR_instanceId_PARAMETER';\nconst resp = await fetch(\n  `https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/${instanceId}/conditions`,\n  {\n    method: 'GET',\n    headers: {\n      Authorization: 'Bearer <YOUR_JWT_HERE>'\n    }\n  }\n);\n\nconst data = await resp.text();\nconsole.log(data);"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const instanceId = 'YOUR_instanceId_PARAMETER';\n  const resp = await fetch(\n    `https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/${instanceId}/conditions`,\n    {\n      method: 'GET',\n      headers: {\n        Authorization: 'Bearer <YOUR_JWT_HERE>'\n      }\n    }\n  );\n\n  const data = await resp.text();\n  console.log(data);\n}\n\nrun();"},{"lang":"python","title":"Python","source":"import requests\n\ninstance_id = \"YOUR_instanceId_PARAMETER\"\nurl = \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" + instance_id + \"/conditions\"\n\nheaders = {\"Authorization\": \"Bearer <YOUR_JWT_HERE>\"}\n\nresponse = requests.get(url, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var host = \"https://{siteid}.flexnetoperations.{domainextension}\";\n    var instanceId = \"YOUR_instanceId_PARAMETER\";\n    var pathname = \"/dynamicmonetization/api/v1.1/instances/%7BinstanceId%7D/conditions\";\n    var request = HttpRequest.newBuilder()\n      .GET()\n      .uri(URI.create(host + pathname ))\n      .header(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new()\n    {\n      DefaultRequestHeaders =\n      {\n        {\"Authorization\", \"Bearer <YOUR_JWT_HERE>\"},\n      }\n    };\n\n      var InstanceId = \"YOUR_instanceId_PARAMETER\";\n    using HttpResponseMessage request = await client.GetAsync(\"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" + InstanceId + \"/conditions\");\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\nconst instanceId = \"YOUR_instanceId_PARAMETER\";\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Bearer <YOUR_JWT_HERE>\"\n  ],\n  CURLOPT_URL => \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" . instanceId . \"/conditions\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  instanceId := \"YOUR_instanceId_PARAMETER\";\n  reqUrl := \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" + instanceId + \"/conditions\"\n  req, err := http.NewRequest(\"GET\", reqUrl, nil)\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"ruby","title":"Ruby","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\ninstance_id = 'YOUR_instanceId_PARAMETER'\nurl = URI('https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/' + instance_id + '/conditions')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest['Authorization'] = 'Bearer <YOUR_JWT_HERE>'\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"r","title":"R","source":"library(httr)\n\ninstance_id = \"YOUR_instanceId_PARAMETER\"\n\n# create you own operator\n\"%&%\" <- function(x, y)paste0(x,y)\n\nurl = \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" %&% instance_id %&% \"/conditions\"\n\ndata_req <- GET(\n  url,\n  add_headers(\"Authorization\" = \"Bearer <YOUR_JWT_HERE>\"),\n  verbose()\n)\n\ncontent(data_req)"}]},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API Call to Check Actions"]}]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"oas-products/dynamicmonetization/apis/openapi-spec.yaml","operationId":"getActions","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X GET \\\n  'https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/{instanceId}/line-items/{lineItemId}/actions' \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>'"},{"lang":"javascript","title":"JavaScript","source":"const instanceId = 'YOUR_instanceId_PARAMETER';\nconst lineItemId = 'YOUR_lineItemId_PARAMETER';\nconst resp = await fetch(\n  `https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/${instanceId}/line-items/${lineItemId}/actions`,\n  {\n    method: 'GET',\n    headers: {\n      Authorization: 'Bearer <YOUR_JWT_HERE>'\n    }\n  }\n);\n\nconst data = await resp.text();\nconsole.log(data);"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const instanceId = 'YOUR_instanceId_PARAMETER';\n  const lineItemId = 'YOUR_lineItemId_PARAMETER';\n  const resp = await fetch(\n    `https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/${instanceId}/line-items/${lineItemId}/actions`,\n    {\n      method: 'GET',\n      headers: {\n        Authorization: 'Bearer <YOUR_JWT_HERE>'\n      }\n    }\n  );\n\n  const data = await resp.text();\n  console.log(data);\n}\n\nrun();"},{"lang":"python","title":"Python","source":"import requests\n\ninstance_id = \"YOUR_instanceId_PARAMETER\"\nline_item_id = \"YOUR_lineItemId_PARAMETER\"\nurl = \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" + instance_id + \"/line-items/\" + line_item_id + \"/actions\"\n\nheaders = {\"Authorization\": \"Bearer <YOUR_JWT_HERE>\"}\n\nresponse = requests.get(url, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var host = \"https://{siteid}.flexnetoperations.{domainextension}\";\n    var instanceId = \"YOUR_instanceId_PARAMETER\";\n    var lineItemId = \"YOUR_lineItemId_PARAMETER\";\n    var pathname = \"/dynamicmonetization/api/v1.1/instances/%7BinstanceId%7D/line-items/%7BlineItemId%7D/actions\";\n    var request = HttpRequest.newBuilder()\n      .GET()\n      .uri(URI.create(host + pathname ))\n      .header(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new()\n    {\n      DefaultRequestHeaders =\n      {\n        {\"Authorization\", \"Bearer <YOUR_JWT_HERE>\"},\n      }\n    };\n\n      var InstanceId = \"YOUR_instanceId_PARAMETER\";\n      var LineItemId = \"YOUR_lineItemId_PARAMETER\";\n    using HttpResponseMessage request = await client.GetAsync(\"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" + InstanceId + \"/line-items/\" + LineItemId + \"/actions\");\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\nconst instanceId = \"YOUR_instanceId_PARAMETER\";\nconst lineItemId = \"YOUR_lineItemId_PARAMETER\";\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Bearer <YOUR_JWT_HERE>\"\n  ],\n  CURLOPT_URL => \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" . instanceId . \"/line-items/\" . lineItemId . \"/actions\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  instanceId := \"YOUR_instanceId_PARAMETER\";\n  lineItemId := \"YOUR_lineItemId_PARAMETER\";\n  reqUrl := \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" + instanceId + \"/line-items/\" + lineItemId + \"/actions\"\n  req, err := http.NewRequest(\"GET\", reqUrl, nil)\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"ruby","title":"Ruby","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\ninstance_id = 'YOUR_instanceId_PARAMETER'\nline_item_id = 'YOUR_lineItemId_PARAMETER'\nurl = URI('https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/' + instance_id + '/line-items/' + line_item_id + '/actions')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest['Authorization'] = 'Bearer <YOUR_JWT_HERE>'\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"r","title":"R","source":"library(httr)\n\ninstance_id = \"YOUR_instanceId_PARAMETER\"\nline_item_id = \"YOUR_lineItemId_PARAMETER\"\n\n# create you own operator\n\"%&%\" <- function(x, y)paste0(x,y)\n\nurl = \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" %&% instance_id %&% \"/line-items/\" %&% line_item_id %&% \"/actions\"\n\ndata_req <- GET(\n  url,\n  add_headers(\"Authorization\" = \"Bearer <YOUR_JWT_HERE>\"),\n  verbose()\n)\n\ncontent(data_req)"}]},"children":[]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Split","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-6-check-enforcement-of-allocations","__idx":8},"children":["Step 6: Check Enforcement of Allocations"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Verify that the item was successfully accessed. The response should indicate which action was used."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Further reading:",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/apis/openapi-spec/non-session-access-request/postaccessrequest"},"children":["Access request for elastic tokens"]}," (API Reference)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/guides/elastic-access-concepts-for-all-back-office-types#access-requests"},"children":["Access Requests"]}," (User Guide)."]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/lockicons_outline.fe713255c781ec98810fde10236510245f92d8e3083fb8de0ce8b5fe8d6fad50.9c1bb791.svg","alt":"LockIcons_Outline.svg","framed":false,"withLightbox":true,"width":"","height":"16px"},"children":[]},"  ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authorization"]},": administration token or client token"]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API Call"]}]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"oas-products/dynamicmonetization/apis/openapi-spec.yaml","operationId":"postAccessRequest","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X POST \\\n  'https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/elastic/api/v1.1/instances/{instanceId}/access-request' \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \\\n  -H 'Content-Type: application/json' \\\n  -H 'correlationId: string' \\\n  -d '{\n    \"requester\": {\n      \"type\": \"string\",\n      \"value\": \"string\"\n    },\n    \"requestedItems\": [\n      {\n        \"item\": \"string\",\n        \"version\": \"string\",\n        \"count\": 0.1,\n        \"variables\": {},\n        \"metaData\": {}\n      }\n    ]\n  }'"},{"lang":"javascript","title":"JavaScript","source":"const instanceId = 'YOUR_instanceId_PARAMETER';\nconst resp = await fetch(\n  `https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/elastic/api/v1.1/instances/${instanceId}/access-request`,\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      correlationId: 'string',\n      Authorization: 'Bearer <YOUR_JWT_HERE>'\n    },\n    body: JSON.stringify({\n      requester: {\n        type: 'string',\n        value: 'string'\n      },\n      requestedItems: [\n        {\n          item: 'string',\n          version: 'string',\n          count: 0.1,\n          variables: {},\n          metaData: {}\n        }\n      ]\n    })\n  }\n);\n\nconst data = await resp.json();\nconsole.log(data);"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const instanceId = 'YOUR_instanceId_PARAMETER';\n  const resp = await fetch(\n    `https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/elastic/api/v1.1/instances/${instanceId}/access-request`,\n    {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json',\n        correlationId: 'string',\n        Authorization: 'Bearer <YOUR_JWT_HERE>'\n      },\n      body: JSON.stringify({\n        requester: {\n          type: 'string',\n          value: 'string'\n        },\n        requestedItems: [\n          {\n            item: 'string',\n            version: 'string',\n            count: 0.1,\n            variables: {},\n            metaData: {}\n          }\n        ]\n      })\n    }\n  );\n\n  const data = await resp.json();\n  console.log(data);\n}\n\nrun();"},{"lang":"python","title":"Python","source":"import requests\n\ninstance_id = \"YOUR_instanceId_PARAMETER\"\nurl = \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/elastic/api/v1.1/instances/\" + instance_id + \"/access-request\"\n\npayload = {\n  \"requester\": {\n    \"type\": \"string\",\n    \"value\": \"string\"\n  },\n  \"requestedItems\": [\n    {\n      \"item\": \"string\",\n      \"version\": \"string\",\n      \"count\": 0.1,\n      \"variables\": {},\n      \"metaData\": {}\n    }\n  ]\n}\n\nheaders = {\n  \"Content-Type\": \"application/json\",\n  \"correlationId\": \"string\",\n  \"Authorization\": \"Bearer <YOUR_JWT_HERE>\"\n}\n\nresponse = requests.post(url, json=payload, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var payload = String.join(\"\\n\"\n      , \"{\"\n      , \" \\\"requester\\\": {\"\n      , \"  \\\"type\\\": \\\"string\\\",\"\n      , \"  \\\"value\\\": \\\"string\\\"\"\n      , \" },\"\n      , \" \\\"requestedItems\\\": [\"\n      , \"  {\"\n      , \"   \\\"item\\\": \\\"string\\\",\"\n      , \"   \\\"version\\\": \\\"string\\\",\"\n      , \"   \\\"count\\\": 0.1,\"\n      , \"   \\\"variables\\\": {},\"\n      , \"   \\\"metaData\\\": {}\"\n      , \"  }\"\n      , \" ]\"\n      , \"}\"\n    );\n\n    var host = \"https://{siteid}.flexnetoperations.{domainextension}\";\n    var instanceId = \"YOUR_instanceId_PARAMETER\";\n    var pathname = \"/dynamicmonetization/elastic/api/v1.1/instances/%7BinstanceId%7D/access-request\";\n    var request = HttpRequest.newBuilder()\n      .POST(HttpRequest.BodyPublishers.ofString(payload))\n      .uri(URI.create(host + pathname ))\n      .header(\"Content-Type\", \"application/json\")\n      .header(\"correlationId\", \"string\")\n      .header(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\nusing System.Text;\nusing System.Text.Json;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new()\n    {\n      DefaultRequestHeaders =\n      {\n        {\"correlationId\", \"string\"},\n        {\"Authorization\", \"Bearer <YOUR_JWT_HERE>\"},\n      }\n    };\n\n    string json = JsonSerializer.Serialize(new\n    {\n      requester = new {\n        type = \"string\",\n        value = \"string\"\n      },\n      requestedItems = new[] {\n        new {\n          item = \"string\",\n          version = \"string\",\n          count = \"0.1\",\n          variables = new {},\n          metaData = new {},\n        }\n      },\n    });\n\n    using StringContent postData = new(json, Encoding.UTF8, \"application/json\");\n      var InstanceId = \"YOUR_instanceId_PARAMETER\";\n    using HttpResponseMessage request = await client.PostAsync(\"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/elastic/api/v1.1/instances/\" + InstanceId + \"/access-request\", postData);\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\nconst instanceId = \"YOUR_instanceId_PARAMETER\";\n$curl = curl_init();\n\n$payload = array(\n  \"requester\" => array(\n    \"type\" => \"string\",\n    \"value\" => \"string\"\n  ),\n  \"requestedItems\" => array(\n    array(\n      \"item\" => \"string\",\n      \"version\" => \"string\",\n      \"count\" => 0.1,\n      \"variables\" => (object)[],\n      \"metaData\" => (object)[]\n    )\n  )\n);\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Bearer <YOUR_JWT_HERE>\",\n    \"Content-Type: application/json\",\n    \"correlationId: string\"\n  ],\n  CURLOPT_POSTFIELDS => json_encode($payload),\n  CURLOPT_URL => \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/elastic/api/v1.1/instances/\" . instanceId . \"/access-request\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"bytes\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  instanceId := \"YOUR_instanceId_PARAMETER\";\n  reqUrl := \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/elastic/api/v1.1/instances/\" + instanceId + \"/access-request\"\n  var data = []byte(`{\n    \"requester\": {\n      \"type\": \"string\",\n      \"value\": \"string\"\n    },\n    \"requestedItems\": [\n      {\n        \"item\": \"string\",\n        \"version\": \"string\",\n        \"count\": 0.1,\n        \"variables\": {},\n        \"metaData\": {}\n      }\n    ]\n  }`)\n  req, err := http.NewRequest(\"POST\", reqUrl, bytes.NewBuffer(data))\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Content-Type\", \"application/json\")\n  req.Header.Add(\"correlationId\", \"string\")\n  req.Header.Add(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"ruby","title":"Ruby","source":"require 'json'\nrequire 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\ninstance_id = 'YOUR_instanceId_PARAMETER'\nurl = URI('https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/elastic/api/v1.1/instances/' + instance_id + '/access-request')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest['Content-Type'] = 'application/json'\nrequest['correlationId'] = 'string'\nrequest['Authorization'] = 'Bearer <YOUR_JWT_HERE>'\nrequest.body = {\n  requester: {\n    type: 'string',\n    value: 'string'\n  },\n  requestedItems: [\n    {\n      item: 'string',\n      version: 'string',\n      count: 0.1,\n      variables: {},\n      metaData: {}\n    }\n  ]\n}.to_json\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"r","title":"R","source":"library(httr)\n\nbody = '{\n   \"requester\": {\n    \"type\": \"string\",\n    \"value\": \"string\"\n   },\n   \"requestedItems\": [\n    {\n     \"item\": \"string\",\n     \"version\": \"string\",\n     \"count\": 0.1,\n     \"variables\": {},\n     \"metaData\": {}\n    }\n   ]\n}'\n\ninstance_id = \"YOUR_instanceId_PARAMETER\"\n\n# create you own operator\n\"%&%\" <- function(x, y)paste0(x,y)\n\nurl = \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/elastic/api/v1.1/instances/\" %&% instance_id %&% \"/access-request\"\n\ndata_req <- POST(\n  url,\n  add_headers(\"Content-Type\" = \"application/json\", \"correlationId\" = \"string\", \"Authorization\" = \"Bearer <YOUR_JWT_HERE>\"),\n  body = body,\n  encode = \"json\",\n  verbose()\n)\n\ncontent(data_req)"},{"lang":"json","title":"Payload application/json","source":"{\n  \"requester\": {\n    \"type\": \"string\",\n    \"value\": \"string\"\n  },\n  \"requestedItems\": [\n    {\n      \"item\": \"string\",\n      \"version\": \"string\",\n      \"count\": 0.1,\n      \"variables\": {},\n      \"metaData\": {}\n    }\n  ]\n}"}]},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Request Body Example"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"requester\": {\n    \"type\": \"user\",\n    \"value\": \"alice\",\n    \"dictionary\": {\"department\":\"engineering\"}\n  },\n  \"requestedItems\": [\n    {\n      \"item\": \"string\",\n      \"version\": \"string\",\n      \"count\": 7,\n      \"metaData\": {}\n    }\n  ]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Response Example"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"correlationId\": \"f36d6ceb-7f83-4838-ae5a-933e6ced4e12\",\n  \"requester\": {\n    \"type\": \"user\",\n    \"value\": \"alice\",\",\n    \"dictionary\": {\"department\":\"engineering\"}    \n  },\n  \"requestedItems\": [\n    {\n      \"item\": \"string\",\n      \"version\": \"string\",\n      \"count\": 7,\n      \"status\": {\n        \"code\": \"1001\",\n        \"description\": \"Successfully checked out\"\n      },\n      \"totalTokensCharged\": 21,\n      \"lineItems\": [\n        {\n          \"rate\": 3.0,\n          \"actionId\": \"6e8d23b0-8e7c-4962-8963-74ef1de693e2\",\n          \"activationId\": \"abc123\",\n          \"tokensCharged\": 21\n        }\n      ]\n    }\n  ]\n}\n","lang":"json"},"children":[]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Split","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"optional-retrieve-actions-to-verify-token-consumption","__idx":9},"children":["Optional: Retrieve Actions to Verify Token Consumption"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can verify that the tokens were consumed from the line item by retrieving the actions again using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/<version>/instances/{instanceId}/line-items/{lineItemId}/actions"]},"."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Further reading:",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/apis/openapi-spec/rules-of-access/getactions"},"children":["Get actions and allocations for a line item"]}," (API Reference)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/guides/elastic-access-concepts-for-all-back-office-types#tokens"},"children":["Tokens"]}," (User Guide)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/guides/rules-of-access#what-are-actions"},"children":["What Are Actions"]}," (User Guide)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/dynamicmonetization/guides/rules-of-access#how-actions-and-conditions-work-together"},"children":["How Actions and Conditions Work Together"]}," (User Guide)."]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/lockicons_outline.fe713255c781ec98810fde10236510245f92d8e3083fb8de0ce8b5fe8d6fad50.9c1bb791.svg","alt":"LockIcons_Outline.svg","framed":false,"withLightbox":true,"width":"","height":"16px"},"children":[]},"  ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authorization"]},": administration token or client token"]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API Call"]}]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"oas-products/dynamicmonetization/apis/openapi-spec.yaml","operationId":"getActions","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X GET \\\n  'https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/{instanceId}/line-items/{lineItemId}/actions' \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>'"},{"lang":"javascript","title":"JavaScript","source":"const instanceId = 'YOUR_instanceId_PARAMETER';\nconst lineItemId = 'YOUR_lineItemId_PARAMETER';\nconst resp = await fetch(\n  `https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/${instanceId}/line-items/${lineItemId}/actions`,\n  {\n    method: 'GET',\n    headers: {\n      Authorization: 'Bearer <YOUR_JWT_HERE>'\n    }\n  }\n);\n\nconst data = await resp.text();\nconsole.log(data);"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const instanceId = 'YOUR_instanceId_PARAMETER';\n  const lineItemId = 'YOUR_lineItemId_PARAMETER';\n  const resp = await fetch(\n    `https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/${instanceId}/line-items/${lineItemId}/actions`,\n    {\n      method: 'GET',\n      headers: {\n        Authorization: 'Bearer <YOUR_JWT_HERE>'\n      }\n    }\n  );\n\n  const data = await resp.text();\n  console.log(data);\n}\n\nrun();"},{"lang":"python","title":"Python","source":"import requests\n\ninstance_id = \"YOUR_instanceId_PARAMETER\"\nline_item_id = \"YOUR_lineItemId_PARAMETER\"\nurl = \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" + instance_id + \"/line-items/\" + line_item_id + \"/actions\"\n\nheaders = {\"Authorization\": \"Bearer <YOUR_JWT_HERE>\"}\n\nresponse = requests.get(url, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var host = \"https://{siteid}.flexnetoperations.{domainextension}\";\n    var instanceId = \"YOUR_instanceId_PARAMETER\";\n    var lineItemId = \"YOUR_lineItemId_PARAMETER\";\n    var pathname = \"/dynamicmonetization/api/v1.1/instances/%7BinstanceId%7D/line-items/%7BlineItemId%7D/actions\";\n    var request = HttpRequest.newBuilder()\n      .GET()\n      .uri(URI.create(host + pathname ))\n      .header(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new()\n    {\n      DefaultRequestHeaders =\n      {\n        {\"Authorization\", \"Bearer <YOUR_JWT_HERE>\"},\n      }\n    };\n\n      var InstanceId = \"YOUR_instanceId_PARAMETER\";\n      var LineItemId = \"YOUR_lineItemId_PARAMETER\";\n    using HttpResponseMessage request = await client.GetAsync(\"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" + InstanceId + \"/line-items/\" + LineItemId + \"/actions\");\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\nconst instanceId = \"YOUR_instanceId_PARAMETER\";\nconst lineItemId = \"YOUR_lineItemId_PARAMETER\";\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Bearer <YOUR_JWT_HERE>\"\n  ],\n  CURLOPT_URL => \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" . instanceId . \"/line-items/\" . lineItemId . \"/actions\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  instanceId := \"YOUR_instanceId_PARAMETER\";\n  lineItemId := \"YOUR_lineItemId_PARAMETER\";\n  reqUrl := \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" + instanceId + \"/line-items/\" + lineItemId + \"/actions\"\n  req, err := http.NewRequest(\"GET\", reqUrl, nil)\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"ruby","title":"Ruby","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\ninstance_id = 'YOUR_instanceId_PARAMETER'\nline_item_id = 'YOUR_lineItemId_PARAMETER'\nurl = URI('https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/' + instance_id + '/line-items/' + line_item_id + '/actions')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest['Authorization'] = 'Bearer <YOUR_JWT_HERE>'\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"r","title":"R","source":"library(httr)\n\ninstance_id = \"YOUR_instanceId_PARAMETER\"\nline_item_id = \"YOUR_lineItemId_PARAMETER\"\n\n# create you own operator\n\"%&%\" <- function(x, y)paste0(x,y)\n\nurl = \"https://{siteid}.flexnetoperations.{domainextension}/dynamicmonetization/api/v1.1/instances/\" %&% instance_id %&% \"/line-items/\" %&% line_item_id %&% \"/actions\"\n\ndata_req <- GET(\n  url,\n  add_headers(\"Authorization\" = \"Bearer <YOUR_JWT_HERE>\"),\n  verbose()\n)\n\ncontent(data_req)"}]},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Response Example"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"[\n  {\n    \"name\": \"Engineering allocation\",\n    \"conditionId\": \"673cd8ee-d4d4-48ba-a4cc-235e61c96516\",\n    \"action\": \"ALLOW\",\n    \"allocation\": 100,\n    \"id\": \"6e8d23b0-8e7c-4962-8963-74ef1de693e2\",\n    \"used\": 21\n  },\n  {\n    \"name\": \"PM & PMM allocation\",\n    \"conditionId\": \"8077bc18-c3f7-4d9d-a560-637d5b118d0b\",\n    \"action\": \"ALLOW\",\n    \"allocation\": 150,\n    \"id\": \"d8a9e55e-ad56-4b89-849f-c08eae92feb8\"\n  },\n  {\n    \"name\": \"default\",\n    \"conditionId\": \"\",\n    \"action\":\"DENY\",\n    \"id\": \"7fdf0258-3350-4d94-868f-f5c8e821a616\"\n  }\n]\n","lang":"json"},"children":[]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"optional-further-exercise","__idx":10},"children":["Optional: Further Exercise"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["As a further exercise, you could:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Create a request that can access tokens by somebody from Product Management."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Try a request by somebody from the Customer Success team, and check that it is denied."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"optional-clean-up","__idx":11},"children":["Optional: Clean Up"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To remove the configuration, use the following API calls:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Delete Actions"]},":",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"DELETE ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/<version>/instances/{instanceId}/line-items/{lineItemId}/actions"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Delete Conditions"]},":",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"DELETE ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/<version>/instances/{instanceId}/conditions"]}]}]}]}]},"headings":[{"value":"Controlling Access with Conditions and Actions","id":"controlling-access-with-conditions-and-actions","depth":1},{"value":"Scenario","id":"scenario","depth":2},{"value":"Steps in This Section","id":"steps-in-this-section","depth":3},{"value":"Step 1: Check the line item","id":"step-1-check-the-line-item","depth":3},{"value":"Step 2: Set Up a Rate Table","id":"step-2-set-up-a-rate-table","depth":3},{"value":"Step 3: Define Conditions","id":"step-3-define-conditions","depth":3},{"value":"Step 4: Create Actions Based on the Conditions","id":"step-4-create-actions-based-on-the-conditions","depth":3},{"value":"Step 5: Verify the Setup","id":"step-5-verify-the-setup","depth":3},{"value":"Step 6: Check Enforcement of Allocations","id":"step-6-check-enforcement-of-allocations","depth":3},{"value":"Optional: Retrieve Actions to Verify Token Consumption","id":"optional-retrieve-actions-to-verify-token-consumption","depth":3},{"value":"Optional: Further Exercise","id":"optional-further-exercise","depth":3},{"value":"Optional: Clean Up","id":"optional-clean-up","depth":3}],"frontmatter":{"template":"../../../@theme/Templates/StepByStep.tsx","seo":{"title":"Controlling Access with Conditions and Actions"}},"lastModified":"2026-06-02T13:48:05.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/dynamicmonetization/tutorials/controlling-access","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}