User relations allow you to link any object to another. Each relation must specify the relation type and the linked objects.
Relations can be of two types:
manual – linked within the application or via import
automatic – objects are automatically assigned based on the relation type configuration (by filter)
Retrieving a relation (GET)
Listing objects in a relation:
https://demo.flexibee.eu/c/demo/faktura-vydana/1/uzivatelske-vazby
It is also possible to include the linked object directly as part of the relation export:
https://demo.flexibee.eu/c/demo/faktura-vydana/1/uzivatelske-vazby.xml?detail=full&includes=/winstrom/uzivatelska-vazba/object
For listing, you can also use the relations detail level configuration and export them as part of the object:
https://demo.flexibee.eu/c/demo/faktura-vydana/1.xml?relations=uzivatelske-vazby
Importing a relation (PUT/POST)
Example of importing a manual relation in XML:
<?xml version="1.0" encoding="UTF-8"?>
<winstrom version="1.0">
<adresar>
<id>109</id>
<uzivatelske-vazby>
<uzivatelska-vazba>
<id>ext:VAZBA:TESTEXTID-CEN</id>
<evidenceType>cenik</evidenceType>
<object>code:SKL-0001/2022</object>
<popis>popisek skl</popis>
<poznam>poznam skl</poznam>
<vazbaTyp>code:ADRCEN</vazbaTyp>
</uzivatelska-vazba>
</uzivatelske-vazby>
</adresar>
</winstrom>
Example of importing a manual relation in JSON:
{
"winstrom":{
"@version":"1.0",
"interni-doklad":[
{
"id":"1054",
"uzivatelske-vazby":[
{
"vazbaTyp":"code:INT-FAV",
"evidenceType":"faktura-vydana",
"object":"code:VF1-0073/2022"
}
]
}
]
}
}
Deleting a relation (PUT/POST)
Example of deleting a manual relation:
<?xml version="1.0" encoding="UTF-8"?>
<winstrom version="1.0">
<uzivatelska-vazba action="delete">
<id>ext:VAZBA:TESTEXTID-CEN</id>
</uzivatelska-vazba>
</winstrom>
