{
	"info": {
		"_postman_id": "a873837c-2628-49ee-a6da-56e439610ef4",
		"name": "CRM Integration Guide - http://api.demo.otv-se.com/",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "Managing accounts",
			"description": "",
			"item": [
				{
					"name": "Create an account",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "19ea4c81-9204-47b6-854c-63d819882703",
								"type": "text/javascript",
								"exec": [
									"var jsonData = JSON.parse(responseBody);",
									"postman.setEnvironmentVariable(\"accountId\", jsonData._id);"
								]
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n\t\"billingAddress\": [\r\n    \t{\r\n        \t\"key\": \"\",\r\n        \t\"value\": \"\"\r\n    \t}\r\n     ]\r\n}"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/adm/v1/accounts",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"adm",
								"v1",
								"accounts"
							]
						}
					},
					"response": []
				},
				{
					"name": "Create an account with entitlements",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "1d932010-9175-4ed6-a2b2-2f970da3cf19",
								"type": "text/javascript",
								"exec": [
									"var jsonData = JSON.parse(responseBody);",
									"postman.setEnvironmentVariable(\"accountId\", jsonData.ADM._id);",
									"postman.setEnvironmentVariable(\"entitlementId\", jsonData.RMG.responseList[0]._id);"
								]
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"account\": {\r\n        \"billingAddress\": [\r\n        \t{\r\n            \t\"key\": \"\",\r\n            \t\"value\": \"\"\r\n        \t}\r\n         ],\r\n         \"users\": [{\r\n\t        \"status\": \"ENABLED\",           \r\n\t        \"name\": \"{{username}}\",\r\n\t        \"password\":\"{{password}}\"\r\n\t     }]\r\n    },\r\n     \"entitlements\": [{\r\n        \"productId\": \"productId1\",\r\n        \"productType\": \"TRANSACTIONAL\",\r\n        \"validityType\": \"ABSOLUTE\",\r\n        \"validFrom\": \"2016-04-06T13:47:59.228Z\",\r\n        \"expiryDate\": \"2020-04-06T13:47:59.228Z\"\r\n    }]  \r\n}"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/gateway/v1/accountService",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"gateway",
								"v1",
								"accountService"
							]
						}
					},
					"response": []
				},
				{
					"name": "Get account information – basic",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "1ffec900-43bf-4e9d-864b-962052904bdc",
								"type": "text/javascript",
								"exec": [
									""
								]
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{  \r\n         \"accountNumber\":\"acct1\",\r\n         \"billingAddress\" : [\r\n         ]\r\n}"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/adm/v1/accounts/{{accountId}}",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"adm",
								"v1",
								"accounts",
								"{{accountId}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "Get account information – full",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "dc887eac-549a-4d76-a2ba-60f464f40a38",
								"type": "text/javascript",
								"exec": [
									"var jsonData = JSON.parse(responseBody);",
									"postman.setEnvironmentVariable(\"userId\", jsonData.getADM.users[0]._id);"
								]
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{  \r\n         \"accountNumber\":\"acct1\",\r\n         \"billingAddress\" : [\r\n         ]\r\n}"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/gateway/v1/accountService/{{accountId}}",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"gateway",
								"v1",
								"accountService",
								"{{accountId}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "Update user credentials",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{ \"password\":\"{{password}}\"}"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/adm/v1/users/{{userId}}",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"adm",
								"v1",
								"users",
								"{{userId}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "Change an account's status",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{   \"status\": \"SUSPENDED\"   }"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/adm/v1/accounts/{{accountId}}",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"adm",
								"v1",
								"accounts",
								"{{accountId}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "Delete an account",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "56c66b8f-123a-4964-bddf-9a0513b0c1b5",
								"type": "text/javascript",
								"exec": [
									""
								]
							}
						}
					],
					"request": {
						"method": "DELETE",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": ""
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/gateway/v1/accountService/{{accountId}}",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"gateway",
								"v1",
								"accountService",
								"{{accountId}}"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Managing devices",
			"description": "",
			"item": [
				{
					"name": "Device utility API",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "5d50085c-95b2-4f8b-990a-dc958e908084",
								"type": "text/javascript",
								"exec": [
									"var jsonData = JSON.parse(responseBody);",
									"postman.setEnvironmentVariable(\"deviceId\", jsonData._id);"
								]
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"deviceInformation\": {\n        \"securePlayer\": {\n            \"codecs\": [\n                \"H264\"\n            ],\n            \"streamings\": [\n                \"HLS\"\n            ],\n            \"DRMs\": [\n                \"PRM\"\n            ]\n        },\n        \"device\": {\n            \"screen\": {\n                \"height\": \"2560\",\n                \"density\": \"560\",\n                \"width\": \"1440\"\n            },\n            \"hardware\": {\n                \"model\": \"Pixel XL\",\n                \"manufacturer\": \"Google\",\n                \"type\": \"Handheld\"\n            },\n            \"OS\": {\n                \"type\": \"Android\",\n                \"version\": \"8.1.0\"\n            },\n            \"CPU\": {\n                \"neon\": \"true\",\n                \"frequency\": \"1.5936\",\n                \"cores\": \"4\"\n            },\n            \"GPU\": {\n                \"frequency\": null,\n                \"cores\": null\n            }\n        }\n    },\n    \"deviceType\": \"OPEN\",\n    \"accountUid\": \"{{accountId}}\"\n}"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/adm/v1/devices/",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"adm",
								"v1",
								"devices",
								""
							]
						}
					},
					"response": []
				},
				{
					"name": "Get OTT device list for an account",
					"request": {
						"method": "GET",
						"header": [],
						"body": {},
						"url": {
							"raw": "http://{{host}}:{{port}}/adm/v1/devices?filter={\"accountUid\":\"{{accountId}}\",\"deviceType\":\"OPEN\"}",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"adm",
								"v1",
								"devices"
							],
							"query": [
								{
									"key": "filter",
									"value": "{\"accountUid\":\"{{accountId}}\",\"deviceType\":\"OPEN\"}"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Remove devices from an account",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n  \"accountUid\":\"{{accountId}}\",\r\n  \"deviceIdList\":[\"{{deviceId}}\"]\r\n}"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/gateway/v1/deviceService/actions/remove",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"gateway",
								"v1",
								"deviceService",
								"actions",
								"remove"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Managing products",
			"description": "",
			"item": [
				{
					"name": "Create a product",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "85a0ec3a-ff9b-49bf-99ba-8eedfda39728",
								"type": "text/javascript",
								"exec": [
									"var jsonData = JSON.parse(responseBody);",
									"postman.setEnvironmentVariable(\"productId\", jsonData.self.split(\"/\").pop());"
								]
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"type\": \"transactional\",\r\n    \"name\": \"NAME_01\",\r\n    \"providerId\": \"PROVIDER_ID_001\",\r\n    \"providerResourceId\": \"PROVIDER_RESOURCE_ID_001\"\r\n}"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/cpm/commercial/v1/products",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"cpm",
								"commercial",
								"v1",
								"products"
							]
						}
					},
					"response": []
				},
				{
					"name": "Get product information",
					"request": {
						"method": "GET",
						"header": [],
						"body": {},
						"url": {
							"raw": "http://{{host}}:{{port}}/cpm/commercial/v1/products/{{productId}}",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"cpm",
								"commercial",
								"v1",
								"products",
								"{{productId}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "Update a product",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n\t\"type\": \"transactional\",\r\n\t\"purchasablePeriod\":{\r\n\t    \"start\":\"2018-01-01T00:00:00Z\",\r\n\t    \"end\":\"2020-01-01T00:00:00Z\"\r\n\t},\r\n\t\"nominalPrice\": {\r\n        \"amount\": 50,\r\n        \"currency\": \"EUR\"\r\n    }\r\n}"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/cpm/commercial/v1/products/{{productId}}",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"cpm",
								"commercial",
								"v1",
								"products",
								"{{productId}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "Delete a product",
					"request": {
						"method": "DELETE",
						"header": [],
						"body": {},
						"url": {
							"raw": "http://{{host}}:{{port}}/cpm/commercial/v1/products/{{productId}}",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"cpm",
								"commercial",
								"v1",
								"products",
								"{{productId}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "Live Channel Utility API Editorial",
					"request": {
						"method": "GET",
						"header": [],
						"body": {},
						"url": {
							"raw": "http://{{host}}:{{port}}/cpm/content/v1/editorialChannels",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"cpm",
								"content",
								"v1",
								"editorialChannels"
							]
						}
					},
					"response": []
				},
				{
					"name": "Live Channel Utility API Editorial",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "04f139f6-8b61-4bb5-8fe6-55257cd0e6bb",
								"type": "text/javascript",
								"exec": [
									""
								]
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"name\": \"CNNEC\",\r\n    \"providerId\": \"{{eChPrId}}\",\r\n\t\"providerResourceId\": \"{{eChPrResId}}\"\r\n}"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/cpm/content/v1/editorialChannels",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"cpm",
								"content",
								"v1",
								"editorialChannels"
							]
						}
					},
					"response": []
				},
				{
					"name": "Live Channel Utility API Editorial",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"name\": \"CNN\",\r\n    \"providerId\": \"tchp01\",\r\n    \"providerResourceId\": \"tchpr01\"\r\n}"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/cpm/content/v1/editorialChannels/{{editorialChannelId}}",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"cpm",
								"content",
								"v1",
								"editorialChannels",
								"{{editorialChannelId}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "Live Channel Utility API Technical",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "d1cfba25-4b42-4c21-b5a3-975dd777a951",
								"type": "text/javascript",
								"exec": [
									""
								]
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"name\": \"CNNTC\",\r\n    \"providerId\": \"{{tChPrId}}\",\r\n    \"providerResourceId\": \"{{tChPrResId}}\",\r\n    \"editorialChannelRef\": {\r\n\t    \"providerId\": \"{{eChPrId}}\",\r\n\t    \"providerResourceId\": \"{{eChPrResId}}\"\r\n    }\r\n}"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/cpm/content/v1/technicalChannels",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"cpm",
								"content",
								"v1",
								"technicalChannels"
							]
						}
					},
					"response": []
				},
				{
					"name": "Live Channel Utility API Technical",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"name\": \"CNN\",\r\n    \"providerId\": \"tchp01\",\r\n    \"providerResourceId\": \"tchpr01\",\r\n    \"editorialChannelRef\": {\r\n        \"providerId\": \"tchp01\",\r\n        \"providerResourceId\": \"tchpr01\"\r\n    }\r\n}"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/cpm/content/v1/technicalChannels/{{technicalChannelId}}",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"cpm",
								"content",
								"v1",
								"technicalChannels",
								"{{technicalChannelId}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "Get live channels",
					"request": {
						"method": "GET",
						"header": [],
						"body": {},
						"url": {
							"raw": "http://{{host}}:{{port}}/cpm/content/v1/technicalChannels",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"cpm",
								"content",
								"v1",
								"technicalChannels"
							]
						}
					},
					"response": []
				},
				{
					"name": "Link a product to live channels",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"productLinkSet\": [\r\n        {\r\n            \"productRef\": {\r\n                \"id\": \"{{productId}}\"\r\n            },\r\n            \"marketableRef\": {\r\n                \"type\": \"technicalChannel\",\r\n                \"id\": \"{{technicalChannelId}}\"\r\n            }\r\n        }\r\n\t]\r\n}"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/cpm/content/v1/productLinks",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"cpm",
								"content",
								"v1",
								"productLinks"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Managing subscriptions",
			"description": "",
			"item": [
				{
					"name": "Subscribe an account to products",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n      \"accountUid\": \"{{accountId}}\",\r\n      \"entitlements\": [\r\n      \t{\r\n\t\t    \"productId\": \"{{productId}}\",\r\n\t\t    \"productType\": \"SUBSCRIPTION\",\r\n\t\t    \"validityType\": \"ABSOLUTE\",\r\n\t\t    \"validFrom\": \"2016-04-06T13:47:59.228Z\",\r\n\t\t    \"expiryDate\": \"2020-04-06T13:47:59.228Z\"\r\n\t    }\r\n      ]\r\n}"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/gateway/v1/productService/actions/subscribe",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"gateway",
								"v1",
								"productService",
								"actions",
								"subscribe"
							]
						}
					},
					"response": []
				},
				{
					"name": "Unsubscribe an account from products",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n      \"accountUid\": \"{{accountId}}\",\r\n      \"productIdList\":[\"{{productId}}\"]\r\n}"
						},
						"url": {
							"raw": "http://{{host}}:{{port}}/gateway/v1/productService/actions/unsubscribe",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"gateway",
								"v1",
								"productService",
								"actions",
								"unsubscribe"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Managing Direct-to-Home (DTH) subscriptions",
			"description": "",
			"item": [
				{
					"name": "Subscribe a device to DTH products",
					"request": {
						"method": "PUT",
						"header": [],
						"body": {},
						"url": {
							"raw": "http://{{host}}:{{port}}/cag/{{casInstanceName}}/devices/{{deviceId}}/entitlements",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"cag",
								"{{casInstanceName}}",
								"devices",
								"{{deviceId}}",
								"entitlements"
							]
						}
					},
					"response": []
				},
				{
					"name": "Unsubscribe a device from DTH products",
					"request": {
						"method": "DELETE",
						"header": [],
						"body": {},
						"url": {
							"raw": "http://{{host}}:{{port}}/cag/{{casInstanceName}}/devices/{{deviceId}}/entitlements?products={{productId}}",
							"protocol": "http",
							"host": [
								"{{host}}"
							],
							"port": "{{port}}",
							"path": [
								"cag",
								"{{casInstanceName}}",
								"devices",
								"{{deviceId}}",
								"entitlements"
							],
							"query": [
								{
									"key": "products",
									"value": "{{productId}}"
								}
							]
						}
					},
					"response": []
				}
			]
		}
	]
}