{
	"info": {
		"_postman_id": "32affc8e-b90b-4330-a61b-a5171b74a6d9",
		"name": "Go",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "2373823"
	},
	"item": [
		{
			"name": "login",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"var login = pm.environment.get(\"go_auth_login\");",
							"var pass = pm.environment.get(\"go_auth_pass\");",
							"var responseData = pm.response.json();",
							"",
							"function sha512(value){",
							"   return CryptoJS.enc.Hex.stringify(CryptoJS.SHA512(value));",
							"}",
							"",
							"var challenge = responseData.challenge;",
							"",
							"var response = sha512(challenge + sha512(login + pass) + responseData.salt);",
							"",
							"pm.environment.set(\"go_auth_response\",  response);",
							"pm.environment.set(\"go_auth_challenge\",  challenge);",
							"",
							""
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{ \n    \"login\": \"{{go_login}}\" \n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://topticgo.com/auth/v1/login/loginRequest",
					"protocol": "https",
					"host": [
						"topticgo",
						"com"
					],
					"path": [
						"auth",
						"v1",
						"login",
						"loginRequest"
					]
				}
			},
			"response": []
		},
		{
			"name": "challenge",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"",
							"",
							"",
							"",
							"",
							"",
							"",
							"",
							""
						],
						"type": "text/javascript"
					}
				},
				{
					"listen": "test",
					"script": {
						"exec": [
							"",
							"",
							"",
							""
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{ \n    \"login\": \"{{go_auth_login}}\",\n    \"challenge\": \"{{go_auth_challenge}}\",\n    \"response\": \"{{go_auth_response}}\"\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://topticgo.com/auth/v1/login/challengeResponse",
					"protocol": "https",
					"host": [
						"topticgo",
						"com"
					],
					"path": [
						"auth",
						"v1",
						"login",
						"challengeResponse"
					]
				}
			},
			"response": []
		},
		{
			"name": "logout",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "https://topticgo.com/auth/v1/logout",
					"protocol": "https",
					"host": [
						"topticgo",
						"com"
					],
					"path": [
						"auth",
						"v1",
						"logout"
					]
				}
			},
			"response": []
		},
		{
			"name": "accounts",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "https://topticgo.com/manager/v1/accounts/",
					"protocol": "https",
					"host": [
						"topticgo",
						"com"
					],
					"path": [
						"manager",
						"v1",
						"accounts",
						""
					]
				}
			},
			"response": []
		},
		{
			"name": "invites",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "https://topticgo.com/selfregister/v1/{{go_account_id}}/invites",
					"protocol": "https",
					"host": [
						"topticgo",
						"com"
					],
					"path": [
						"selfregister",
						"v1",
						"{{go_account_id}}",
						"invites"
					]
				}
			},
			"response": []
		},
		{
			"name": "renew auth token",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"token\": \"string\"\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://topticgo.com/auth/v1/login/renew",
					"protocol": "https",
					"host": [
						"topticgo",
						"com"
					],
					"path": [
						"auth",
						"v1",
						"login",
						"renew"
					]
				}
			},
			"response": []
		}
	]
}