{
	"info": {
		"_postman_id": "7df619cd-111f-456c-a4d7-3feca47d6f19",
		"name": "logintap_v1 Biometry Only",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "5492679"
	},
	"item": [
		{
			"name": "{{url}}/api/v1/user with webAuthnConfirm",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Body matches uuid+type+id\", function () {",
							"    (pm.expect(pm.response.text()).to.include(\"uuid\") & ",
							"    pm.expect(pm.response.text()).to.include(\"type\") & ",
							"    pm.expect(pm.response.text()).to.include(\"id\"));",
							"});",
							"",
							"var s = pm.response.text();",
							"var obj = JSON.parse(s);",
							"console.log(obj);",
							"pm.globals.set(\"userUUid\", obj.uuid);",
							"pm.globals.set(\"sessionUUid\", obj.sessionUUID);"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{token}}",
						"type": "text"
					}
				],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "enabled",
							"value": "1",
							"type": "text"
						},
						{
							"key": "applicationUUID",
							"value": "{{appUUid}}",
							"type": "text"
						},
						{
							"key": "webAuthnConfirm",
							"value": "1",
							"type": "default"
						}
					]
				},
				"url": {
					"raw": "{{url}}/api/v1/user",
					"host": [
						"{{url}}"
					],
					"path": [
						"api",
						"v1",
						"user"
					]
				}
			},
			"response": []
		},
		{
			"name": "{{url}}/api/v1/logintap/loginrequest 9=webAuth_confirm",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Body matches uuid+type+id\", function () {",
							"    (pm.expect(pm.response.text()).to.include(\"sessionUUID\"));",
							"});",
							"",
							"var s = pm.response.text();",
							"var obj = JSON.parse(s);",
							"console.log(obj);",
							"pm.globals.set(\"sessionUUid\", obj.sessionUUID);"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{token}}",
						"type": "text"
					}
				],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "userUUID",
							"value": "{{userUUid}}",
							"type": "text"
						},
						{
							"key": "applicationUUID",
							"value": "{{appUUid}}",
							"type": "text"
						},
						{
							"key": "webAuthnConfirm",
							"value": "9",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "{{url}}/api/v1/logintap/loginrequest",
					"host": [
						"{{url}}"
					],
					"path": [
						"api",
						"v1",
						"logintap",
						"loginrequest"
					]
				}
			},
			"response": []
		},
		{
			"name": "{{url}}/api/v1/logintap/loginresult",
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{token}}",
						"type": "text"
					}
				],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "sessionUUID",
							"value": "{{sessionUUid}}",
							"type": "text"
						},
						{
							"key": "applicationUUID",
							"value": "{{appUUid}}",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "{{url}}/api/v1/logintap/loginresult",
					"host": [
						"{{url}}"
					],
					"path": [
						"api",
						"v1",
						"logintap",
						"loginresult"
					]
				}
			},
			"response": []
		},
		{
			"name": "Получение данных пользователя",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Body matches Phone+Enabled+LoginUrl+InviteStatus+StartScreen+Email++TelegramChannel+CreateDate\", function () {",
							"    (pm.expect(pm.response.text()).to.include(\"Phone\") & ",
							"    pm.expect(pm.response.text()).to.include(\"Enabled\") & ",
							"    pm.expect(pm.response.text()).to.include(\"LoginUrl\") &",
							"    pm.expect(pm.response.text()).to.include(\"InviteStatus\") & ",
							"    pm.expect(pm.response.text()).to.include(\"StartScreen\") & ",
							"    pm.expect(pm.response.text()).to.include(\"Email\") & ",
							"    pm.expect(pm.response.text()).to.include(\"TelegramChannel\") & ",
							"    pm.expect(pm.response.text()).to.include(\"CreateDate\"));",
							"});",
							"",
							"pm.test(\"Body matches data+type+id+attributes\", function () {",
							"    ( ",
							"    pm.expect(pm.response.text()).to.include(\"data\") & ",
							"    pm.expect(pm.response.text()).to.include(\"type\") & ",
							"    pm.expect(pm.response.text()).to.include(\"id\") & ",
							"    pm.expect(pm.response.text()).to.include(\"attributes\"));",
							"});"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{token}}"
					}
				],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "applicationUUID",
							"value": "{{appUUid}}",
							"type": "text"
						},
						{
							"key": "userUUID",
							"value": "{{userUUid}}",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "{{url}}/api/v1/getuser",
					"host": [
						"{{url}}"
					],
					"path": [
						"api",
						"v1",
						"getuser"
					]
				}
			},
			"response": []
		},
		{
			"name": "{{url}}/api/v1/user Update",
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "PUT",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{token}}",
						"type": "text"
					},
					{
						"key": "",
						"value": "",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "userUUID",
							"value": "4b3e5378-0a4d-42e2-9d9b-6b3d0c1dce15",
							"type": "text"
						},
						{
							"key": "enabled",
							"value": "1",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "{{url}}/api/v1/user/?userUUID={{userUUid}}&enabled=1&email=a@ua.com&phone=123&customUUID=blabla",
					"host": [
						"{{url}}"
					],
					"path": [
						"api",
						"v1",
						"user",
						""
					],
					"query": [
						{
							"key": "userUUID",
							"value": "{{userUUid}}"
						},
						{
							"key": "enabled",
							"value": "1"
						},
						{
							"key": "email",
							"value": "a@ua.com"
						},
						{
							"key": "phone",
							"value": "123"
						},
						{
							"key": "customUUID",
							"value": "blabla"
						}
					]
				}
			},
			"response": []
		}
	]
}