User Tools

Site Tools


api2:tag_system:tag_edges

To create a link between two Tags because one includes the other, you can create a Tag Edge from one to the other. As such you are creating a DAG (directed acyclic graph) of Tags. Please note that .

Object resources

Property Type Description
id Integer identifier for the database of Domoscio's API
ancestor_id Integer The target Tag of the current Edge
descendant_id Integer The source Tag of the current Edge
tag_set_id Integer The Tag Set the Tag Edge belongs to
direct Boolean If the edge is direct or indirect
created_at DateTime Date of creation of the object
updated_at DateTime Last time the object has been modified

Create (POST)

Method POST
URL /tag_edges
Parameters (*Requiered parameters)
Property Type Description
ancestor_id* Integer The target Tag of the current Edge
descendant_id* Integer The source Tag of the current Edge
Send the request (JSON input example)
{
	ancestor_id: 1278,
	descendant_id: 1279
}
Get the response (JSON output example)
{
    "id": 1829,
    "ancestor_id": 1278,
    "descendant_id": 1279,
    "tag_set_id": 216,
    "created_at": "2017-11-24T10:08:30.705Z",
    "updated_at": "2017-11-24T10:08:30.705Z"
}

Fetch (GET)

Method GET
URL /tag_edges/{tag_edge_id}

If no tag_edge_id is provided it will fetch all Tag Edges for your instance.

Get the response (JSON output example)

With ID provided

{
    "id": 1829,
    "ancestor_id": 1278,
    "descendant_id": 1279,
    "tag_set_id": 216,
    "created_at": "2017-11-24T10:08:30.705Z",
    "updated_at": "2017-11-24T10:08:30.705Z"
}

Without ID provided

[
    {
        "id": 1762,
        "ancestor_id": 1229,
        "descendant_id": 1243,
        "tag_set_id": 213,
        "created_at": "2017-09-20T14:15:34.199Z",
        "updated_at": "2017-09-20T14:15:34.199Z"
    },
    {
        "id": 1829,
        "ancestor_id": 1278,
        "descendant_id": 1279,
        "tag_set_id": 216,
        "created_at": "2017-11-24T10:08:30.705Z",
        "updated_at": "2017-11-24T10:08:30.705Z"
    }
]
api2/tag_system/tag_edges.txt · Last modified: 2017/11/24 11:16 by maries