{
  "_type": "export",
  "__export_format": 4,
  "__export_date": "2026-10-17T00:00:00.000Z",
  "__export_source": "kdpika-docs-v1",
  "resources": [
    {
      "_id": "wrk_kdpika_v1_sandbox",
      "_type": "workspace",
      "name": "KDPika Licensing API v1 Sandbox",
      "description": "Real11-operation Sandbox sequence. Mutates test data and ends by revoking its test license. No payment integration. Run serially; do not retry uncertain creates/renewals. Secrets use local run variables, never logs or exported populated environments.",
      "scope": "collection"
    },
    {
      "_id": "env_kdpika_v1_sandbox",
      "_type": "environment",
      "parentId": "wrk_kdpika_v1_sandbox",
      "name": "Sandbox",
      "data": {
        "base_url": "https://licensing.kdpika.com/api/v1",
        "app_id": "YOUR_SANDBOX_PUBLIC_APP_ID",
        "api_key": "YOUR_SANDBOX_DEVELOPER_API_KEY",
        "product_id": "YOUR_INTERNAL_PRODUCT_ID",
        "plan_id": "YOUR_PRODUCT_PLAN_ID",
        "customer_email": "customer@example.invalid",
        "installation_id": "YOUR_PERSISTED_SANDBOX_INSTALLATION_ID",
        "idempotency_key": "YOUR_UNIQUE_SANDBOX_TEST_EVENT_ID",
        "license_id": "YOUR_LICENSE_ID",
        "license_key": "YOUR_SANDBOX_LICENSE_KEY",
        "activation_token": "YOUR_SANDBOX_ACTIVATION_TOKEN",
        "allow_loopback": "0"
      },
      "dataPropertyOrder": null,
      "color": null,
      "isPrivate": true
    },
    {
      "_id": "req_kdpika_publicKey",
      "_type": "request",
      "parentId": "wrk_kdpika_v1_sandbox",
      "name": "01 public-key",
      "method": "GET",
      "url": "{% assign kdp_valid = false %}{% assign kdp_scheme = _.base_url | split: '://' | first %}{% assign kdp_host = _.base_url | split: '://' | last | split: '/' | first | split: ':' | first %}{% assign kdp_suffix = _.base_url | slice: -7, 7 %}{% if kdp_scheme == 'https' %}{% assign kdp_valid = true %}{% endif %}{% if kdp_scheme == 'http' and _.allow_loopback == '1' %}{% if kdp_host == '127.0.0.1' or kdp_host == 'localhost' %}{% assign kdp_valid = true %}{% endif %}{% endif %}{% if kdp_suffix != '/api/v1' or kdp_host == '' or _.base_url contains '@' or _.base_url contains '?' or _.base_url contains '#' or _.base_url contains ' ' %}{% assign kdp_valid = false %}{% endif %}{% if kdp_valid %}{{ _.base_url }}{% else %}kdpika-blocked://sandbox-only{% endif %}/public-key",
      "headers": [
        {
          "name": "Accept",
          "value": "application/json"
        },
        {
          "name": "User-Agent",
          "value": "KDPikaDocsCollection/1.0"
        }
      ],
      "parameters": [],
      "authentication": {},
      "metaSortKey": 1,
      "body": {},
      "preRequestScript": "const get = name => insomnia.variables.get(name);\nconst reject = message => { console.warn(message); insomnia.request.url = 'kdpika-blocked://sandbox-only'; insomnia.request.method = 'GET'; ['Authorization','X-App-ID','Idempotency-Key','Cookie'].forEach(name => insomnia.request.removeHeader(name)); if (insomnia.request.body) insomnia.request.body.update({mode:'raw',raw:'{}'}); };\nconst base = String(get('base_url') || '');\nconst safe = /^https:\\/\\/[^/@?#\\s]+\\/api\\/v1$/.test(base);\nconst local = String(get('allow_loopback')) === '1' && /^http:\\/\\/(?:127\\.0\\.0\\.1|localhost):[0-9]+\\/api\\/v1$/.test(base);\nif (!safe && !local) reject('Use an HTTPS API base or an explicitly opted-in loopback test base.');\n",
      "afterResponseScript": "const body = insomnia.response.json();\ninsomnia.test('Expected HTTP status', () => insomnia.expect(insomnia.response.code).to.equal(200));\ninsomnia.test('Successful JSON response', () => insomnia.expect(body.success).to.equal(true));\ninsomnia.test('Request correlation ID', () => insomnia.expect(body.request_id).to.match(/^req_[a-f0-9]{24}$/));\n",
      "settingFollowRedirects": "off",
      "settingStoreCookies": false,
      "settingSendCookies": false
    },
    {
      "_id": "req_kdpika_create",
      "_type": "request",
      "parentId": "wrk_kdpika_v1_sandbox",
      "name": "02 create-license",
      "method": "POST",
      "url": "{% assign kdp_valid = false %}{% assign kdp_scheme = _.base_url | split: '://' | first %}{% assign kdp_host = _.base_url | split: '://' | last | split: '/' | first | split: ':' | first %}{% assign kdp_suffix = _.base_url | slice: -7, 7 %}{% if kdp_scheme == 'https' %}{% assign kdp_valid = true %}{% endif %}{% if kdp_scheme == 'http' and _.allow_loopback == '1' %}{% if kdp_host == '127.0.0.1' or kdp_host == 'localhost' %}{% assign kdp_valid = true %}{% endif %}{% endif %}{% if kdp_suffix != '/api/v1' or kdp_host == '' or _.base_url contains '@' or _.base_url contains '?' or _.base_url contains '#' or _.base_url contains ' ' %}{% assign kdp_valid = false %}{% endif %}{% assign kdp_key_prefix = _.api_key | slice: 0, 12 %}{% unless kdp_key_prefix == 'lmp_sandbox_' %}{% assign kdp_valid = false %}{% endunless %}{% if kdp_valid %}{{ _.base_url }}{% else %}kdpika-blocked://sandbox-only{% endif %}/licenses",
      "headers": [
        {
          "name": "Accept",
          "value": "application/json"
        },
        {
          "name": "User-Agent",
          "value": "KDPikaDocsCollection/1.0"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Authorization",
          "value": "Bearer {{ _.api_key}}"
        },
        {
          "name": "Idempotency-Key",
          "value": "{{ _.idempotency_key}}"
        }
      ],
      "parameters": [],
      "authentication": {},
      "metaSortKey": 2,
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"product_id\": \"{{ _.product_id}}\",\n  \"plan_id\": \"{{ _.plan_id}}\",\n  \"customer\": {\n    \"email\": \"{{ _.customer_email}}\",\n    \"name\": \"Synthetic collection customer\"\n  }\n}"
      },
      "preRequestScript": "const get = name => insomnia.variables.get(name);\nconst reject = message => { console.warn(message); insomnia.request.url = 'kdpika-blocked://sandbox-only'; insomnia.request.method = 'GET'; ['Authorization','X-App-ID','Idempotency-Key','Cookie'].forEach(name => insomnia.request.removeHeader(name)); if (insomnia.request.body) insomnia.request.body.update({mode:'raw',raw:'{}'}); };\nconst base = String(get('base_url') || '');\nconst safe = /^https:\\/\\/[^/@?#\\s]+\\/api\\/v1$/.test(base);\nconst local = String(get('allow_loopback')) === '1' && /^http:\\/\\/(?:127\\.0\\.0\\.1|localhost):[0-9]+\\/api\\/v1$/.test(base);\nif (!safe && !local) reject('Use an HTTPS API base or an explicitly opted-in loopback test base.');\nif (!String(get('api_key') || '').startsWith('lmp_sandbox_')) reject('A Sandbox developer API key is required.');\n",
      "afterResponseScript": "const body = insomnia.response.json();\ninsomnia.test('Expected HTTP status', () => insomnia.expect(insomnia.response.code).to.equal(201));\ninsomnia.test('Successful JSON response', () => insomnia.expect(body.success).to.equal(true));\ninsomnia.test('Request correlation ID', () => insomnia.expect(body.request_id).to.match(/^req_[a-f0-9]{24}$/));\nif (body.success === true && body.license) { insomnia.variables.set('license_id', body.license.id); insomnia.variables.set('license_key', body.license.license_key); }\n",
      "settingFollowRedirects": "off",
      "settingStoreCookies": false,
      "settingSendCookies": false
    },
    {
      "_id": "req_kdpika_activate",
      "_type": "request",
      "parentId": "wrk_kdpika_v1_sandbox",
      "name": "03 activate",
      "method": "POST",
      "url": "{% assign kdp_valid = false %}{% assign kdp_scheme = _.base_url | split: '://' | first %}{% assign kdp_host = _.base_url | split: '://' | last | split: '/' | first | split: ':' | first %}{% assign kdp_suffix = _.base_url | slice: -7, 7 %}{% if kdp_scheme == 'https' %}{% assign kdp_valid = true %}{% endif %}{% if kdp_scheme == 'http' and _.allow_loopback == '1' %}{% if kdp_host == '127.0.0.1' or kdp_host == 'localhost' %}{% assign kdp_valid = true %}{% endif %}{% endif %}{% if kdp_suffix != '/api/v1' or kdp_host == '' or _.base_url contains '@' or _.base_url contains '?' or _.base_url contains '#' or _.base_url contains ' ' %}{% assign kdp_valid = false %}{% endif %}{% assign kdp_license_prefix = _.license_key | upcase | slice: 0, 4 %}{% unless kdp_license_prefix == 'TEST' and _.license_key contains '-' %}{% assign kdp_valid = false %}{% endunless %}{% if kdp_valid %}{{ _.base_url }}{% else %}kdpika-blocked://sandbox-only{% endif %}/licenses/activate",
      "headers": [
        {
          "name": "Accept",
          "value": "application/json"
        },
        {
          "name": "User-Agent",
          "value": "KDPikaDocsCollection/1.0"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "X-App-ID",
          "value": "{{ _.app_id}}"
        },
        {
          "name": "X-Environment",
          "value": "SANDBOX"
        }
      ],
      "parameters": [],
      "authentication": {},
      "metaSortKey": 3,
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"license_key\": \"{{ _.license_key}}\",\n  \"device_id\": \"{{ _.installation_id}}\",\n  \"email\": \"{{ _.customer_email}}\",\n  \"device_name\": \"Sandbox collection\",\n  \"platform\": \"test\",\n  \"app_version\": \"1.0.0\"\n}"
      },
      "preRequestScript": "const get = name => insomnia.variables.get(name);\nconst reject = message => { console.warn(message); insomnia.request.url = 'kdpika-blocked://sandbox-only'; insomnia.request.method = 'GET'; ['Authorization','X-App-ID','Idempotency-Key','Cookie'].forEach(name => insomnia.request.removeHeader(name)); if (insomnia.request.body) insomnia.request.body.update({mode:'raw',raw:'{}'}); };\nconst base = String(get('base_url') || '');\nconst safe = /^https:\\/\\/[^/@?#\\s]+\\/api\\/v1$/.test(base);\nconst local = String(get('allow_loopback')) === '1' && /^http:\\/\\/(?:127\\.0\\.0\\.1|localhost):[0-9]+\\/api\\/v1$/.test(base);\nif (!safe && !local) reject('Use an HTTPS API base or an explicitly opted-in loopback test base.');\nif (!/^TEST[A-Z0-9]*-/i.test(String(get('license_key') || ''))) reject('Use a TEST-prefixed Sandbox license key.');\n",
      "afterResponseScript": "const body = insomnia.response.json();\ninsomnia.test('Expected HTTP status', () => insomnia.expect(insomnia.response.code).to.equal(200));\ninsomnia.test('Successful JSON response', () => insomnia.expect(body.success).to.equal(true));\ninsomnia.test('Request correlation ID', () => insomnia.expect(body.request_id).to.match(/^req_[a-f0-9]{24}$/));\ninsomnia.test('Sandbox signed snapshot', () => insomnia.expect(body.license.payload.environment).to.equal('sandbox'));\nif (body.success === true && body.license?.payload?.environment === 'sandbox') insomnia.variables.set('activation_token', body.activation_token);\n",
      "settingFollowRedirects": "off",
      "settingStoreCookies": false,
      "settingSendCookies": false
    },
    {
      "_id": "req_kdpika_validate",
      "_type": "request",
      "parentId": "wrk_kdpika_v1_sandbox",
      "name": "04 validate",
      "method": "POST",
      "url": "{% assign kdp_valid = false %}{% assign kdp_scheme = _.base_url | split: '://' | first %}{% assign kdp_host = _.base_url | split: '://' | last | split: '/' | first | split: ':' | first %}{% assign kdp_suffix = _.base_url | slice: -7, 7 %}{% if kdp_scheme == 'https' %}{% assign kdp_valid = true %}{% endif %}{% if kdp_scheme == 'http' and _.allow_loopback == '1' %}{% if kdp_host == '127.0.0.1' or kdp_host == 'localhost' %}{% assign kdp_valid = true %}{% endif %}{% endif %}{% if kdp_suffix != '/api/v1' or kdp_host == '' or _.base_url contains '@' or _.base_url contains '?' or _.base_url contains '#' or _.base_url contains ' ' %}{% assign kdp_valid = false %}{% endif %}{% if kdp_valid %}{{ _.base_url }}{% else %}kdpika-blocked://sandbox-only{% endif %}/licenses/validate",
      "headers": [
        {
          "name": "Accept",
          "value": "application/json"
        },
        {
          "name": "User-Agent",
          "value": "KDPikaDocsCollection/1.0"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Authorization",
          "value": "Bearer {{ _.activation_token}}"
        },
        {
          "name": "X-Installation-ID",
          "value": "{{ _.installation_id}}"
        }
      ],
      "parameters": [],
      "authentication": {},
      "metaSortKey": 4,
      "body": {
        "mimeType": "application/json",
        "text": "{}"
      },
      "preRequestScript": "const get = name => insomnia.variables.get(name);\nconst reject = message => { console.warn(message); insomnia.request.url = 'kdpika-blocked://sandbox-only'; insomnia.request.method = 'GET'; ['Authorization','X-App-ID','Idempotency-Key','Cookie'].forEach(name => insomnia.request.removeHeader(name)); if (insomnia.request.body) insomnia.request.body.update({mode:'raw',raw:'{}'}); };\nconst base = String(get('base_url') || '');\nconst safe = /^https:\\/\\/[^/@?#\\s]+\\/api\\/v1$/.test(base);\nconst local = String(get('allow_loopback')) === '1' && /^http:\\/\\/(?:127\\.0\\.0\\.1|localhost):[0-9]+\\/api\\/v1$/.test(base);\nif (!safe && !local) reject('Use an HTTPS API base or an explicitly opted-in loopback test base.');\n",
      "afterResponseScript": "const body = insomnia.response.json();\ninsomnia.test('Expected HTTP status', () => insomnia.expect(insomnia.response.code).to.equal(200));\ninsomnia.test('Successful JSON response', () => insomnia.expect(body.success).to.equal(true));\ninsomnia.test('Request correlation ID', () => insomnia.expect(body.request_id).to.match(/^req_[a-f0-9]{24}$/));\ninsomnia.test('Validation accepted', () => insomnia.expect(body.valid).to.equal(true));\n",
      "settingFollowRedirects": "off",
      "settingStoreCookies": false,
      "settingSendCookies": false
    },
    {
      "_id": "req_kdpika_show",
      "_type": "request",
      "parentId": "wrk_kdpika_v1_sandbox",
      "name": "05 get-license",
      "method": "GET",
      "url": "{% assign kdp_valid = false %}{% assign kdp_scheme = _.base_url | split: '://' | first %}{% assign kdp_host = _.base_url | split: '://' | last | split: '/' | first | split: ':' | first %}{% assign kdp_suffix = _.base_url | slice: -7, 7 %}{% if kdp_scheme == 'https' %}{% assign kdp_valid = true %}{% endif %}{% if kdp_scheme == 'http' and _.allow_loopback == '1' %}{% if kdp_host == '127.0.0.1' or kdp_host == 'localhost' %}{% assign kdp_valid = true %}{% endif %}{% endif %}{% if kdp_suffix != '/api/v1' or kdp_host == '' or _.base_url contains '@' or _.base_url contains '?' or _.base_url contains '#' or _.base_url contains ' ' %}{% assign kdp_valid = false %}{% endif %}{% assign kdp_key_prefix = _.api_key | slice: 0, 12 %}{% unless kdp_key_prefix == 'lmp_sandbox_' %}{% assign kdp_valid = false %}{% endunless %}{% if kdp_valid %}{{ _.base_url }}{% else %}kdpika-blocked://sandbox-only{% endif %}/licenses/{{ _.license_id}}",
      "headers": [
        {
          "name": "Accept",
          "value": "application/json"
        },
        {
          "name": "User-Agent",
          "value": "KDPikaDocsCollection/1.0"
        },
        {
          "name": "Authorization",
          "value": "Bearer {{ _.api_key}}"
        }
      ],
      "parameters": [],
      "authentication": {},
      "metaSortKey": 5,
      "body": {},
      "preRequestScript": "const get = name => insomnia.variables.get(name);\nconst reject = message => { console.warn(message); insomnia.request.url = 'kdpika-blocked://sandbox-only'; insomnia.request.method = 'GET'; ['Authorization','X-App-ID','Idempotency-Key','Cookie'].forEach(name => insomnia.request.removeHeader(name)); if (insomnia.request.body) insomnia.request.body.update({mode:'raw',raw:'{}'}); };\nconst base = String(get('base_url') || '');\nconst safe = /^https:\\/\\/[^/@?#\\s]+\\/api\\/v1$/.test(base);\nconst local = String(get('allow_loopback')) === '1' && /^http:\\/\\/(?:127\\.0\\.0\\.1|localhost):[0-9]+\\/api\\/v1$/.test(base);\nif (!safe && !local) reject('Use an HTTPS API base or an explicitly opted-in loopback test base.');\nif (!String(get('api_key') || '').startsWith('lmp_sandbox_')) reject('A Sandbox developer API key is required.');\n",
      "afterResponseScript": "const body = insomnia.response.json();\ninsomnia.test('Expected HTTP status', () => insomnia.expect(insomnia.response.code).to.equal(200));\ninsomnia.test('Successful JSON response', () => insomnia.expect(body.success).to.equal(true));\ninsomnia.test('Request correlation ID', () => insomnia.expect(body.request_id).to.match(/^req_[a-f0-9]{24}$/));\n",
      "settingFollowRedirects": "off",
      "settingStoreCookies": false,
      "settingSendCookies": false
    },
    {
      "_id": "req_kdpika_deactivate",
      "_type": "request",
      "parentId": "wrk_kdpika_v1_sandbox",
      "name": "06 deactivate",
      "method": "POST",
      "url": "{% assign kdp_valid = false %}{% assign kdp_scheme = _.base_url | split: '://' | first %}{% assign kdp_host = _.base_url | split: '://' | last | split: '/' | first | split: ':' | first %}{% assign kdp_suffix = _.base_url | slice: -7, 7 %}{% if kdp_scheme == 'https' %}{% assign kdp_valid = true %}{% endif %}{% if kdp_scheme == 'http' and _.allow_loopback == '1' %}{% if kdp_host == '127.0.0.1' or kdp_host == 'localhost' %}{% assign kdp_valid = true %}{% endif %}{% endif %}{% if kdp_suffix != '/api/v1' or kdp_host == '' or _.base_url contains '@' or _.base_url contains '?' or _.base_url contains '#' or _.base_url contains ' ' %}{% assign kdp_valid = false %}{% endif %}{% if kdp_valid %}{{ _.base_url }}{% else %}kdpika-blocked://sandbox-only{% endif %}/licenses/deactivate",
      "headers": [
        {
          "name": "Accept",
          "value": "application/json"
        },
        {
          "name": "User-Agent",
          "value": "KDPikaDocsCollection/1.0"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Authorization",
          "value": "Bearer {{ _.activation_token}}"
        }
      ],
      "parameters": [],
      "authentication": {},
      "metaSortKey": 6,
      "body": {
        "mimeType": "application/json",
        "text": "{}"
      },
      "preRequestScript": "const get = name => insomnia.variables.get(name);\nconst reject = message => { console.warn(message); insomnia.request.url = 'kdpika-blocked://sandbox-only'; insomnia.request.method = 'GET'; ['Authorization','X-App-ID','Idempotency-Key','Cookie'].forEach(name => insomnia.request.removeHeader(name)); if (insomnia.request.body) insomnia.request.body.update({mode:'raw',raw:'{}'}); };\nconst base = String(get('base_url') || '');\nconst safe = /^https:\\/\\/[^/@?#\\s]+\\/api\\/v1$/.test(base);\nconst local = String(get('allow_loopback')) === '1' && /^http:\\/\\/(?:127\\.0\\.0\\.1|localhost):[0-9]+\\/api\\/v1$/.test(base);\nif (!safe && !local) reject('Use an HTTPS API base or an explicitly opted-in loopback test base.');\n",
      "afterResponseScript": "const body = insomnia.response.json();\ninsomnia.test('Expected HTTP status', () => insomnia.expect(insomnia.response.code).to.equal(200));\ninsomnia.test('Successful JSON response', () => insomnia.expect(body.success).to.equal(true));\ninsomnia.test('Request correlation ID', () => insomnia.expect(body.request_id).to.match(/^req_[a-f0-9]{24}$/));\n",
      "settingFollowRedirects": "off",
      "settingStoreCookies": false,
      "settingSendCookies": false
    },
    {
      "_id": "req_kdpika_suspend",
      "_type": "request",
      "parentId": "wrk_kdpika_v1_sandbox",
      "name": "07 suspend",
      "method": "POST",
      "url": "{% assign kdp_valid = false %}{% assign kdp_scheme = _.base_url | split: '://' | first %}{% assign kdp_host = _.base_url | split: '://' | last | split: '/' | first | split: ':' | first %}{% assign kdp_suffix = _.base_url | slice: -7, 7 %}{% if kdp_scheme == 'https' %}{% assign kdp_valid = true %}{% endif %}{% if kdp_scheme == 'http' and _.allow_loopback == '1' %}{% if kdp_host == '127.0.0.1' or kdp_host == 'localhost' %}{% assign kdp_valid = true %}{% endif %}{% endif %}{% if kdp_suffix != '/api/v1' or kdp_host == '' or _.base_url contains '@' or _.base_url contains '?' or _.base_url contains '#' or _.base_url contains ' ' %}{% assign kdp_valid = false %}{% endif %}{% assign kdp_key_prefix = _.api_key | slice: 0, 12 %}{% unless kdp_key_prefix == 'lmp_sandbox_' %}{% assign kdp_valid = false %}{% endunless %}{% if kdp_valid %}{{ _.base_url }}{% else %}kdpika-blocked://sandbox-only{% endif %}/licenses/{{ _.license_id}}/suspend",
      "headers": [
        {
          "name": "Accept",
          "value": "application/json"
        },
        {
          "name": "User-Agent",
          "value": "KDPikaDocsCollection/1.0"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Authorization",
          "value": "Bearer {{ _.api_key}}"
        }
      ],
      "parameters": [],
      "authentication": {},
      "metaSortKey": 7,
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"reason\": \"Sandbox collection test\"\n}"
      },
      "preRequestScript": "const get = name => insomnia.variables.get(name);\nconst reject = message => { console.warn(message); insomnia.request.url = 'kdpika-blocked://sandbox-only'; insomnia.request.method = 'GET'; ['Authorization','X-App-ID','Idempotency-Key','Cookie'].forEach(name => insomnia.request.removeHeader(name)); if (insomnia.request.body) insomnia.request.body.update({mode:'raw',raw:'{}'}); };\nconst base = String(get('base_url') || '');\nconst safe = /^https:\\/\\/[^/@?#\\s]+\\/api\\/v1$/.test(base);\nconst local = String(get('allow_loopback')) === '1' && /^http:\\/\\/(?:127\\.0\\.0\\.1|localhost):[0-9]+\\/api\\/v1$/.test(base);\nif (!safe && !local) reject('Use an HTTPS API base or an explicitly opted-in loopback test base.');\nif (!String(get('api_key') || '').startsWith('lmp_sandbox_')) reject('A Sandbox developer API key is required.');\n",
      "afterResponseScript": "const body = insomnia.response.json();\ninsomnia.test('Expected HTTP status', () => insomnia.expect(insomnia.response.code).to.equal(200));\ninsomnia.test('Successful JSON response', () => insomnia.expect(body.success).to.equal(true));\ninsomnia.test('Request correlation ID', () => insomnia.expect(body.request_id).to.match(/^req_[a-f0-9]{24}$/));\n",
      "settingFollowRedirects": "off",
      "settingStoreCookies": false,
      "settingSendCookies": false
    },
    {
      "_id": "req_kdpika_restore",
      "_type": "request",
      "parentId": "wrk_kdpika_v1_sandbox",
      "name": "08 restore",
      "method": "POST",
      "url": "{% assign kdp_valid = false %}{% assign kdp_scheme = _.base_url | split: '://' | first %}{% assign kdp_host = _.base_url | split: '://' | last | split: '/' | first | split: ':' | first %}{% assign kdp_suffix = _.base_url | slice: -7, 7 %}{% if kdp_scheme == 'https' %}{% assign kdp_valid = true %}{% endif %}{% if kdp_scheme == 'http' and _.allow_loopback == '1' %}{% if kdp_host == '127.0.0.1' or kdp_host == 'localhost' %}{% assign kdp_valid = true %}{% endif %}{% endif %}{% if kdp_suffix != '/api/v1' or kdp_host == '' or _.base_url contains '@' or _.base_url contains '?' or _.base_url contains '#' or _.base_url contains ' ' %}{% assign kdp_valid = false %}{% endif %}{% assign kdp_key_prefix = _.api_key | slice: 0, 12 %}{% unless kdp_key_prefix == 'lmp_sandbox_' %}{% assign kdp_valid = false %}{% endunless %}{% if kdp_valid %}{{ _.base_url }}{% else %}kdpika-blocked://sandbox-only{% endif %}/licenses/{{ _.license_id}}/restore",
      "headers": [
        {
          "name": "Accept",
          "value": "application/json"
        },
        {
          "name": "User-Agent",
          "value": "KDPikaDocsCollection/1.0"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Authorization",
          "value": "Bearer {{ _.api_key}}"
        }
      ],
      "parameters": [],
      "authentication": {},
      "metaSortKey": 8,
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"reason\": \"Sandbox collection test\"\n}"
      },
      "preRequestScript": "const get = name => insomnia.variables.get(name);\nconst reject = message => { console.warn(message); insomnia.request.url = 'kdpika-blocked://sandbox-only'; insomnia.request.method = 'GET'; ['Authorization','X-App-ID','Idempotency-Key','Cookie'].forEach(name => insomnia.request.removeHeader(name)); if (insomnia.request.body) insomnia.request.body.update({mode:'raw',raw:'{}'}); };\nconst base = String(get('base_url') || '');\nconst safe = /^https:\\/\\/[^/@?#\\s]+\\/api\\/v1$/.test(base);\nconst local = String(get('allow_loopback')) === '1' && /^http:\\/\\/(?:127\\.0\\.0\\.1|localhost):[0-9]+\\/api\\/v1$/.test(base);\nif (!safe && !local) reject('Use an HTTPS API base or an explicitly opted-in loopback test base.');\nif (!String(get('api_key') || '').startsWith('lmp_sandbox_')) reject('A Sandbox developer API key is required.');\n",
      "afterResponseScript": "const body = insomnia.response.json();\ninsomnia.test('Expected HTTP status', () => insomnia.expect(insomnia.response.code).to.equal(200));\ninsomnia.test('Successful JSON response', () => insomnia.expect(body.success).to.equal(true));\ninsomnia.test('Request correlation ID', () => insomnia.expect(body.request_id).to.match(/^req_[a-f0-9]{24}$/));\n",
      "settingFollowRedirects": "off",
      "settingStoreCookies": false,
      "settingSendCookies": false
    },
    {
      "_id": "req_kdpika_renew",
      "_type": "request",
      "parentId": "wrk_kdpika_v1_sandbox",
      "name": "09 renew",
      "method": "POST",
      "url": "{% assign kdp_valid = false %}{% assign kdp_scheme = _.base_url | split: '://' | first %}{% assign kdp_host = _.base_url | split: '://' | last | split: '/' | first | split: ':' | first %}{% assign kdp_suffix = _.base_url | slice: -7, 7 %}{% if kdp_scheme == 'https' %}{% assign kdp_valid = true %}{% endif %}{% if kdp_scheme == 'http' and _.allow_loopback == '1' %}{% if kdp_host == '127.0.0.1' or kdp_host == 'localhost' %}{% assign kdp_valid = true %}{% endif %}{% endif %}{% if kdp_suffix != '/api/v1' or kdp_host == '' or _.base_url contains '@' or _.base_url contains '?' or _.base_url contains '#' or _.base_url contains ' ' %}{% assign kdp_valid = false %}{% endif %}{% assign kdp_key_prefix = _.api_key | slice: 0, 12 %}{% unless kdp_key_prefix == 'lmp_sandbox_' %}{% assign kdp_valid = false %}{% endunless %}{% if kdp_valid %}{{ _.base_url }}{% else %}kdpika-blocked://sandbox-only{% endif %}/licenses/{{ _.license_id}}/renew",
      "headers": [
        {
          "name": "Accept",
          "value": "application/json"
        },
        {
          "name": "User-Agent",
          "value": "KDPikaDocsCollection/1.0"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Authorization",
          "value": "Bearer {{ _.api_key}}"
        }
      ],
      "parameters": [],
      "authentication": {},
      "metaSortKey": 9,
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"days\": 30\n}"
      },
      "preRequestScript": "const get = name => insomnia.variables.get(name);\nconst reject = message => { console.warn(message); insomnia.request.url = 'kdpika-blocked://sandbox-only'; insomnia.request.method = 'GET'; ['Authorization','X-App-ID','Idempotency-Key','Cookie'].forEach(name => insomnia.request.removeHeader(name)); if (insomnia.request.body) insomnia.request.body.update({mode:'raw',raw:'{}'}); };\nconst base = String(get('base_url') || '');\nconst safe = /^https:\\/\\/[^/@?#\\s]+\\/api\\/v1$/.test(base);\nconst local = String(get('allow_loopback')) === '1' && /^http:\\/\\/(?:127\\.0\\.0\\.1|localhost):[0-9]+\\/api\\/v1$/.test(base);\nif (!safe && !local) reject('Use an HTTPS API base or an explicitly opted-in loopback test base.');\nif (!String(get('api_key') || '').startsWith('lmp_sandbox_')) reject('A Sandbox developer API key is required.');\n",
      "afterResponseScript": "const body = insomnia.response.json();\ninsomnia.test('Expected HTTP status', () => insomnia.expect(insomnia.response.code).to.equal(200));\ninsomnia.test('Successful JSON response', () => insomnia.expect(body.success).to.equal(true));\ninsomnia.test('Request correlation ID', () => insomnia.expect(body.request_id).to.match(/^req_[a-f0-9]{24}$/));\n",
      "settingFollowRedirects": "off",
      "settingStoreCookies": false,
      "settingSendCookies": false
    },
    {
      "_id": "req_kdpika_resetDevices",
      "_type": "request",
      "parentId": "wrk_kdpika_v1_sandbox",
      "name": "10 reset-devices",
      "method": "POST",
      "url": "{% assign kdp_valid = false %}{% assign kdp_scheme = _.base_url | split: '://' | first %}{% assign kdp_host = _.base_url | split: '://' | last | split: '/' | first | split: ':' | first %}{% assign kdp_suffix = _.base_url | slice: -7, 7 %}{% if kdp_scheme == 'https' %}{% assign kdp_valid = true %}{% endif %}{% if kdp_scheme == 'http' and _.allow_loopback == '1' %}{% if kdp_host == '127.0.0.1' or kdp_host == 'localhost' %}{% assign kdp_valid = true %}{% endif %}{% endif %}{% if kdp_suffix != '/api/v1' or kdp_host == '' or _.base_url contains '@' or _.base_url contains '?' or _.base_url contains '#' or _.base_url contains ' ' %}{% assign kdp_valid = false %}{% endif %}{% assign kdp_key_prefix = _.api_key | slice: 0, 12 %}{% unless kdp_key_prefix == 'lmp_sandbox_' %}{% assign kdp_valid = false %}{% endunless %}{% if kdp_valid %}{{ _.base_url }}{% else %}kdpika-blocked://sandbox-only{% endif %}/licenses/{{ _.license_id}}/reset-devices",
      "headers": [
        {
          "name": "Accept",
          "value": "application/json"
        },
        {
          "name": "User-Agent",
          "value": "KDPikaDocsCollection/1.0"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Authorization",
          "value": "Bearer {{ _.api_key}}"
        }
      ],
      "parameters": [],
      "authentication": {},
      "metaSortKey": 10,
      "body": {
        "mimeType": "application/json",
        "text": "{}"
      },
      "preRequestScript": "const get = name => insomnia.variables.get(name);\nconst reject = message => { console.warn(message); insomnia.request.url = 'kdpika-blocked://sandbox-only'; insomnia.request.method = 'GET'; ['Authorization','X-App-ID','Idempotency-Key','Cookie'].forEach(name => insomnia.request.removeHeader(name)); if (insomnia.request.body) insomnia.request.body.update({mode:'raw',raw:'{}'}); };\nconst base = String(get('base_url') || '');\nconst safe = /^https:\\/\\/[^/@?#\\s]+\\/api\\/v1$/.test(base);\nconst local = String(get('allow_loopback')) === '1' && /^http:\\/\\/(?:127\\.0\\.0\\.1|localhost):[0-9]+\\/api\\/v1$/.test(base);\nif (!safe && !local) reject('Use an HTTPS API base or an explicitly opted-in loopback test base.');\nif (!String(get('api_key') || '').startsWith('lmp_sandbox_')) reject('A Sandbox developer API key is required.');\n",
      "afterResponseScript": "const body = insomnia.response.json();\ninsomnia.test('Expected HTTP status', () => insomnia.expect(insomnia.response.code).to.equal(200));\ninsomnia.test('Successful JSON response', () => insomnia.expect(body.success).to.equal(true));\ninsomnia.test('Request correlation ID', () => insomnia.expect(body.request_id).to.match(/^req_[a-f0-9]{24}$/));\n",
      "settingFollowRedirects": "off",
      "settingStoreCookies": false,
      "settingSendCookies": false
    },
    {
      "_id": "req_kdpika_revoke",
      "_type": "request",
      "parentId": "wrk_kdpika_v1_sandbox",
      "name": "11 revoke",
      "method": "POST",
      "url": "{% assign kdp_valid = false %}{% assign kdp_scheme = _.base_url | split: '://' | first %}{% assign kdp_host = _.base_url | split: '://' | last | split: '/' | first | split: ':' | first %}{% assign kdp_suffix = _.base_url | slice: -7, 7 %}{% if kdp_scheme == 'https' %}{% assign kdp_valid = true %}{% endif %}{% if kdp_scheme == 'http' and _.allow_loopback == '1' %}{% if kdp_host == '127.0.0.1' or kdp_host == 'localhost' %}{% assign kdp_valid = true %}{% endif %}{% endif %}{% if kdp_suffix != '/api/v1' or kdp_host == '' or _.base_url contains '@' or _.base_url contains '?' or _.base_url contains '#' or _.base_url contains ' ' %}{% assign kdp_valid = false %}{% endif %}{% assign kdp_key_prefix = _.api_key | slice: 0, 12 %}{% unless kdp_key_prefix == 'lmp_sandbox_' %}{% assign kdp_valid = false %}{% endunless %}{% if kdp_valid %}{{ _.base_url }}{% else %}kdpika-blocked://sandbox-only{% endif %}/licenses/{{ _.license_id}}/revoke",
      "headers": [
        {
          "name": "Accept",
          "value": "application/json"
        },
        {
          "name": "User-Agent",
          "value": "KDPikaDocsCollection/1.0"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Authorization",
          "value": "Bearer {{ _.api_key}}"
        }
      ],
      "parameters": [],
      "authentication": {},
      "metaSortKey": 11,
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"reason\": \"Sandbox collection test\"\n}"
      },
      "preRequestScript": "const get = name => insomnia.variables.get(name);\nconst reject = message => { console.warn(message); insomnia.request.url = 'kdpika-blocked://sandbox-only'; insomnia.request.method = 'GET'; ['Authorization','X-App-ID','Idempotency-Key','Cookie'].forEach(name => insomnia.request.removeHeader(name)); if (insomnia.request.body) insomnia.request.body.update({mode:'raw',raw:'{}'}); };\nconst base = String(get('base_url') || '');\nconst safe = /^https:\\/\\/[^/@?#\\s]+\\/api\\/v1$/.test(base);\nconst local = String(get('allow_loopback')) === '1' && /^http:\\/\\/(?:127\\.0\\.0\\.1|localhost):[0-9]+\\/api\\/v1$/.test(base);\nif (!safe && !local) reject('Use an HTTPS API base or an explicitly opted-in loopback test base.');\nif (!String(get('api_key') || '').startsWith('lmp_sandbox_')) reject('A Sandbox developer API key is required.');\n",
      "afterResponseScript": "const body = insomnia.response.json();\ninsomnia.test('Expected HTTP status', () => insomnia.expect(insomnia.response.code).to.equal(200));\ninsomnia.test('Successful JSON response', () => insomnia.expect(body.success).to.equal(true));\ninsomnia.test('Request correlation ID', () => insomnia.expect(body.request_id).to.match(/^req_[a-f0-9]{24}$/));\n",
      "settingFollowRedirects": "off",
      "settingStoreCookies": false,
      "settingSendCookies": false
    }
  ]
}
