{
	"info": {
		"_postman_id": "56fffc52-ac90-4e71-b898-5b52bdb2db6f",
		"name": "CrushBank API Ingestion Prod",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "17203306",
		"_collection_link": "https://dark-flare-4986-1.postman.co/workspace/Crushbank~3aa9135c-4933-4c3f-973b-68400d4dfa1a/collection/17203306-56fffc52-ac90-4e71-b898-5b52bdb2db6f?action=share&creator=17203306&source=collection_link"
	},
	"item": [
		{
			"name": "Ingestion API Prod",
			"item": [
				{
					"name": "Get Token External",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Save token as environment variable\", function () {\r",
									"\tvar jsonData = pm.response.json();    \r",
									"\tpm.environment.set('CBAPI_token', jsonData.accessToken);\r",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text",
								"disabled": true
							},
							{
								"key": "Content-Type",
								"value": "application/x-www-form-urlencoded",
								"type": "text",
								"disabled": true
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"clientId\": \"3a65e913-d777-426b-a8eb-7ddc5dc38a18\",\r\n    \"clientSecret\": \"MzY3LTJkZTFkMzM3LTZjNjItNDVlYy1iMTBmLTk2MGZiNjA1MGM3NA==\"\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "http://externalauthentication.crushbank.com//authenticationtoken/authentication/external",
							"protocol": "http",
							"host": [
								"externalauthentication",
								"crushbank",
								"com"
							],
							"path": [
								"",
								"authenticationtoken",
								"authentication",
								"external"
							]
						}
					},
					"response": []
				},
				{
					"name": "Create API Integration",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{CBAPI_token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n  \"name\": \"APITest\"\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://api.crushbank.com/api/Ingestion/v1/Integration",
							"protocol": "https",
							"host": [
								"api",
								"crushbank",
								"com"
							],
							"path": [
								"api",
								"Ingestion",
								"v1",
								"Integration"
							]
						}
					},
					"response": []
				},
				{
					"name": "Ingest APITicket",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{CBAPI_token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n  \"Context\": {\r\n    \"IntegrationUuid\": \"AD73508E-2348-4237-BA25-453AD30CB369\"\r\n  },\r\n  \"Content\": {\r\n    \"Identifier\": \"ticket1111\",\r\n    \"CreatedBy\": \"Allan Poe\",\r\n    \"CreatedDate\": \"2023-05-04T10:10:19.9594707-05:00\",\r\n    \"UpdatedBy\": \"Pablo Neruda\",\r\n    \"UpdatedDate\": \"2023-05-04T10:10:19.9594707-05:00\",\r\n    \"ClientName\": \"Home depot\",\r\n    \"CompanySite\": \"https://homedepot.itglue.com\",\r\n    \"Link\": \"https://staging.connectwisedev.com/v4_6_release/services/system_io/Service/fv_sr100_request.rails?service_recid=1288\",\r\n    \"Title\": \"demo server is down\",\r\n    \"Description\": \"server issue description...\",\r\n    \"Properties\": {\r\n      \"Status\": \"New\",\r\n      \"Type\": \"Application\",\r\n      \"SubType\": \"Internet\",\r\n      \"Priority\": \"Critical\"\r\n    },\r\n    \"WorkNotes\": [\r\n      {\r\n        \"Title\": \"Adam\",\r\n        \"Description\": \"I checked VPN config and is ok.\",\r\n        \"Date\": \"2023-04-21T08:57:19.9596241-05:00\",\r\n        \"Type\": \"Internal\"\r\n      }\r\n    ],\r\n    \"TimeEntries\": [\r\n      {\r\n        \"Title\": \"Adriana\",\r\n        \"Description\": \"Time entry description\",\r\n        \"StartDate\": \"2023-05-04T09:10:19.9594707-05:00\",\r\n        \"EndDate\": \"2023-05-04T10:10:19.9594707-05:00\",\r\n        \"Type\": \"External\"\r\n      }\r\n    ]\r\n  },\r\n  \"Permissions\": [\r\n      \"jdelgador@crushbank.com\" \r\n  ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://api.crushbank.com/api/ingestion/v1/ticket",
							"protocol": "https",
							"host": [
								"api",
								"crushbank",
								"com"
							],
							"path": [
								"api",
								"ingestion",
								"v1",
								"ticket"
							]
						}
					},
					"response": []
				},
				{
					"name": "Ingest APICRM",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJDb21wYW55SWQiOiIzNjciLCJDb21wYW55VXVJZCI6IjNhNjVlOTEzLWQ3NzctNDI2Yi1hOGViLTdkZGM1ZGMzOGExOCIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2F1dGhvcml6YXRpb25kZWNpc2lvbiI6WyJDcnVzaGJhbmtXZWJBcGkuR2V0U29sdXRpb25zIiwiQ3J1c2hiYW5rV2ViQXBpLlJhdGVEb2N1bWVudCIsIkluZ2VzdGlvbkFQSS5DcmVhdGVJbnRlZ3JhdGlvbiIsIkluZ2VzdGlvbkFQSS5Jbmdlc3Rpb24iXSwibmJmIjoxNjgzNTg0ODY1LCJleHAiOjE2ODM1ODY2NjUsImlhdCI6MTY4MzU4NDg2NX0.Fp6HWWffSg9Mmh4dcr459P3BjGfbMAkR7M9RgWmmGvk",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n  \"context\": {\r\n    \"integrationUuid\": \"966442B4-6136-4C7E-A11B-E2D5F2A33FC9\"\r\n  },\r\n  \"content\": {\r\n    \"identifier\": \"CRM001\",\r\n    \"createdBy\": \"Tatiana Albarracín\",\r\n    \"createdDate\": \"2023-04-17T20:43:58.240Z\",\r\n    \"updatedBy\": \"Cata\",\r\n    \"updatedDate\": \"2023-04-17T20:43:58.240Z\",\r\n    \"companySite\": \"homedepot.itglue.com/\",\r\n    \"link\": \"https://staging.connectwisedev.com/v4_6_release/services/system_io/router/openrecord.rails?recordType=ContactFV&recid=211&companyName=crushbank_c\",\r\n    \"clientName\": \"Home depot\",\r\n    \"Title\": \" Kim Taehyung\",\r\n    \"properties\": {\r\n      \"Phone\": \"3107753996\",\r\n      \"address\": \"street 789\",\r\n      \"city\": \"LA\",\r\n      \"songs\": \"568524\"\r\n    }   \r\n  },\r\n  \"Permissions\": [\r\n  ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://api.crushbank.com/api/ingestion/v1/crm",
							"protocol": "https",
							"host": [
								"api",
								"crushbank",
								"com"
							],
							"path": [
								"api",
								"ingestion",
								"v1",
								"crm"
							]
						},
						"description": "Ingest contact in API.\n\nto get token use Authentication > GetTokenExternal request:\n\nclientId is the company Guid  \nclientSecret is the ApiKey generated in CB company form"
					},
					"response": []
				},
				{
					"name": "Ingest APIConfigStage",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJDb21wYW55SWQiOiIxMTQ2IiwiQ29tcGFueVV1SWQiOiI4OTdiOWM1MC1hOWFiLTQ0YzktOGRhNi1kMTdiNGQ4MTFlMjgiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9hdXRob3JpemF0aW9uZGVjaXNpb24iOlsiQ3J1c2hiYW5rV2ViQXBpLkdldFNvbHV0aW9ucyIsIkNydXNoYmFua1dlYkFwaS5SYXRlRG9jdW1lbnQiLCJJbmdlc3Rpb25BUEkuQ3JlYXRlSW50ZWdyYXRpb24iLCJJbmdlc3Rpb25BUEkuSW5nZXN0aW9uIl0sIm5iZiI6MTY4MzI5NTc0OSwiZXhwIjoxNjgzMjk3NTQ5LCJpYXQiOjE2ODMyOTU3NDl9.iowI4T64Tp2hYm5vEP1K18JqwkSi69zqaNq2m93eVqw",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n  \"context\": {\r\n    \"IntegrationUuid\": \"AD73508E-2348-4237-BA25-453AD30CB369\"\r\n  },\r\n  \"content\": {\r\n    \"identifier\": \"ASBRY1111\",\r\n    \"createdBy\": \"Bryan\",\r\n    \"createdDate\": \"2023-04-17T20:43:58.240Z\",\r\n    \"updatedBy\": \"Cata\",\r\n    \"updatedDate\": \"2023-04-17T20:43:58.240Z\",\r\n    \"companySite\": \"homedepot.itglue.com/\",\r\n    \"link\": \"https://staging.connectwisedev.com/v4_6_release/services/system_io/router/openrecord.rails?recordType=ConfigFV&recid=59&companyName=crushbank_c\",\r\n    \"clientName\": \"Home depot\",\r\n    \"Title\": \"demo domain\",\r\n    \"properties\": {\r\n      \"IP\": \"191.16.58.13\",\r\n      \"domain\": \"homedepot.com\",\r\n      \"provider\": \"hostinger\"\r\n    }  \r\n  },\r\n  \"Permissions\": [\r\n      \"jdelgador@crushbank.com\" \r\n  ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://api.crushbank.com/api/ingestion/v1/config",
							"protocol": "https",
							"host": [
								"api",
								"crushbank",
								"com"
							],
							"path": [
								"api",
								"ingestion",
								"v1",
								"config"
							]
						},
						"description": "Ingest contact in API.\n\nto get token use Authentication > GetTokenExternal request:\n\nclientId is the company Guid  \nclientSecret is the ApiKey generated in CB company form"
					},
					"response": []
				},
				{
					"name": "Ingest APIDocument",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{CBAPI_token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "Metadata",
									"value": "{\n  \"context\": {\n    \"integrationUuid\": \"966442B4-6136-4C7E-A11B-E2D5F2A33FC9\"\n  },\n  \"content\": {\n    \"identifier\": \"DOC001\",\n    \"createdBy\": \"Tatiana Albarracin\",\n    \"createdDate\": \"2023-04-17T20:43:58.240Z\",\n    \"updatedBy\": \"Cata\",\n    \"updatedDate\": \"2023-04-17T20:43:58.240Z\",\n    \"clientName\": \"tatiana's company\",\n    \"Title\": \"TetsAPITati.pdf\",    \n    \"properties\": {\n      \"Author\": \"Kim Taehuyng\",\n      \"subject\": \"Song\"\n    }   \n  },\n  \"Permissions\": [     \n  ] \n}",
									"type": "text"
								},
								{
									"key": "File",
									"type": "file",
									"src": "/C:/Users/tatiana.albarracinr/Desktop/Mine/All/FAKER 2.0 .pdf"
								}
							]
						},
						"url": {
							"raw": "https://api.crushbank.com/api/ingestion/v1/document",
							"protocol": "https",
							"host": [
								"api",
								"crushbank",
								"com"
							],
							"path": [
								"api",
								"ingestion",
								"v1",
								"document"
							]
						},
						"description": "Ingest contact in API.\n\nto get token use Authentication > GetTokenExternal request:\n\nclientId is the company Guid  \nclientSecret is the ApiKey generated in CB company form"
					},
					"response": []
				},
				{
					"name": "Update Integration",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJDb21wYW55SWQiOiIxMTQ2IiwiQ29tcGFueVV1SWQiOiI4OTdiOWM1MC1hOWFiLTQ0YzktOGRhNi1kMTdiNGQ4MTFlMjgiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9hdXRob3JpemF0aW9uZGVjaXNpb24iOlsiQ3J1c2hiYW5rV2ViQXBpLkdldFNvbHV0aW9ucyIsIkNydXNoYmFua1dlYkFwaS5SYXRlRG9jdW1lbnQiLCJJbmdlc3Rpb25BUEkuQ3JlYXRlSW50ZWdyYXRpb24iLCJJbmdlc3Rpb25BUEkuSW5nZXN0aW9uIl0sIm5iZiI6MTY4MzAzOTI5MCwiZXhwIjoxNjgzMDQxMDkwLCJpYXQiOjE2ODMwMzkyOTB9.kixaCLVoQ9XqoG6i4k-vna0cQ67-EARwPKFYCQdsfNo",
									"type": "string"
								}
							]
						},
						"method": "PUT",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n  \"IntegrationUuid\": \"DAC0509C-F067-4A20-A146-FD6221A5A005\",\r\n  \"Name\": \"Allan Poe\",\r\n  \"Enabled\": true\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://api.crushbank.com/api/Ingestion/v1/Integration",
							"protocol": "https",
							"host": [
								"api",
								"crushbank",
								"com"
							],
							"path": [
								"api",
								"Ingestion",
								"v1",
								"Integration"
							]
						}
					},
					"response": []
				}
			]
		}
	]
}