---
# System prepended metadata

title: Postup nastaveni digitoo vcetne workspaces

---

# Postup nastaveni digitoo vcetne workspaces 
## Uvod
- Stahnout Postman
- Naimportovat JSON ktery je na konci tohoto souboru popr v Teams viz obrazek
- ![image](https://hackmd.io/_uploads/S1MxupxUa.png)
- K dispozici nyni mame 3 endpointy ktere budeme potrebovat
- Nutno provest authentikaci:
- ![image](https://hackmd.io/_uploads/B1rm_TgIT.png)
    - Do pole token uvest token z digitoo appky: 
    - https://app.digitoo.ai/o1970/settings/erps
    - Kriticky krok, v pripade spatneho tokenu dojde k prirazeni do spanych jednotek.



## Ziskani ID organizace
- ![image](https://hackmd.io/_uploads/HyWF_6e86.png)
- Id si ulozim
## Ziskani ID workspace
- ![image](https://hackmd.io/_uploads/BkShdTgLa.png)
- Do orgId vyplnim ID z predchoziho requestu a nasledne si ulozim ID ktere mi tento call vrati (call se potvrzuje tlacitkem send)
- **DULEZITE tento call vraci vice workspaces, je nutno najit spravne workspace - workspace je ekvivalent ucetni jednotky**
## Ziskani Queue ID
- ![image](https://hackmd.io/_uploads/SJ_8FagUp.png)
- zde vyplnim workspaceId ktere jsem si nasel v predchozim requestu a odeslu
- Nasledne si ulozim ID - toto ID pak musim ulozit do XML souboru
- ![image](https://hackmd.io/_uploads/SJPoYaxLa.png)


## Extra Ziskani tokenu
- Pokud nechceme exposovat jmeno a heslo je mozne se authentikovat pouze pomoci tokenu (viz Uvod)
- Token zkopiruji pro danou ucetni jednotku z https://app.digitoo.ai/o1970/settings/erps
- Smazu z XML jmeno a heslo a vlozim novy attribut s nazvem Token
``` XML
<DataminingSettingsModel xmlns:dsp="http://www.gappex.com/sfp/DataSource/Parameters" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" QueueId= "e0aa37dc-62ca-4641-a0e0-bfc8eff85a55" Token="jkljklasjlk" FormIdent="Invoice" ControlIdent="FileList" ReturnUrl="https://foreigners.sfpdev.cz/Form/Detail/Invoice/">
```
- Tato funkce je zpetne kompatibilni tudiz bud vyplnim jmeno a heslo a bude se pouzivat to a nebo vyplnim token.
- Pozn. toto funguje pouze pro AfterSave WF, AfterValidation zatim neni dodelany.





### Postman JSON 
{
	"info": {
		"_postman_id": "63d3c4c5-5796-4a74-8f8f-9e59f31285c8",
		"name": "GappexDigitooInte",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "https://api.digitoo.cz/api/v2/organizations",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NUb2tlbklkIjoiOGUzNzY1OWMtOWMzZi00YzI0LWFiNDMtNWRmNDA0YzRkNzE2IiwiY3VzdG9tZXJJZCI6IjdhMzUyMmMyLTJjOTYtNGQ5Ni04ZGQ0LTdlNjZkNzU1MzVjMSIsImN1c3RvbWVyRW1haWwiOiJsdmFjbGF2ZWtAZ2FwcGV4LmN6IiwiaWF0IjoxNjk0MjU2OTgyfQ.YLMl4VJV8rlZa5Yh_qg05QsgZUhJL5xhHt7OBCou1xw",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "https://api.digitoo.cz/api/v2/organizations",
					"protocol": "https",
					"host": [
						"api",
						"digitoo",
						"cz"
					],
					"path": [
						"api",
						"v2",
						"organizations"
					]
				}
			},
			"response": []
		},
		{
			"name": "https://api.digitoo.cz/api/v2/organizations/a7031245-cc00-4a09-9ba2-13297551994e/workspaces",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NUb2tlbklkIjoiOGUzNzY1OWMtOWMzZi00YzI0LWFiNDMtNWRmNDA0YzRkNzE2IiwiY3VzdG9tZXJJZCI6IjdhMzUyMmMyLTJjOTYtNGQ5Ni04ZGQ0LTdlNjZkNzU1MzVjMSIsImN1c3RvbWVyRW1haWwiOiJsdmFjbGF2ZWtAZ2FwcGV4LmN6IiwiaWF0IjoxNjk0MjU2OTgyfQ.YLMl4VJV8rlZa5Yh_qg05QsgZUhJL5xhHt7OBCou1xw",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [
					{
						"key": "",
						"value": "",
						"type": "default"
					}
				],
				"url": {
					"raw": "https://api.digitoo.cz/api/v2/organizations/:orgId/workspaces",
					"protocol": "https",
					"host": [
						"api",
						"digitoo",
						"cz"
					],
					"path": [
						"api",
						"v2",
						"organizations",
						":orgId",
						"workspaces"
					],
					"variable": [
						{
							"key": "orgId",
							"value": "a7031245-cc00-4a09-9ba2-13297551994e"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "https://api.digitoo.cz/api/v2/workspaces/f6dde3ad-60d5-466e-a1ec-4b01a6d80acc/queues",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NUb2tlbklkIjoiOGUzNzY1OWMtOWMzZi00YzI0LWFiNDMtNWRmNDA0YzRkNzE2IiwiY3VzdG9tZXJJZCI6IjdhMzUyMmMyLTJjOTYtNGQ5Ni04ZGQ0LTdlNjZkNzU1MzVjMSIsImN1c3RvbWVyRW1haWwiOiJsdmFjbGF2ZWtAZ2FwcGV4LmN6IiwiaWF0IjoxNjk0MjU2OTgyfQ.YLMl4VJV8rlZa5Yh_qg05QsgZUhJL5xhHt7OBCou1xw",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "https://api.digitoo.cz/api/v2/workspaces/:workspaceId/queues",
					"protocol": "https",
					"host": [
						"api",
						"digitoo",
						"cz"
					],
					"path": [
						"api",
						"v2",
						"workspaces",
						":workspaceId",
						"queues"
					],
					"variable": [
						{
							"key": "workspaceId",
							"value": "f6dde3ad-60d5-466e-a1ec-4b01a6d80acc"
						}
					]
				}
			},
			"response": []
		}
	]
}