A Content deals with one or several Knowledge Nodes. For instance, the question “2 x 3 = ?” only deals with the Knowledge Node “multiplication”, while a book on Geography will deals with many Knowledge Nodes. The Knowledge Node Contents represent that relation.\\
===Object resources===
^ Property ^ Type ^ Description ^
| id | Integer | identifier for the database of Domoscio's API |
| knowlede_node_id | Integer | One of the knowledge nodes the content is related to |
| content_id | Integer | The related content |
| importance_degree | Integer | If a content is related to several knowledge nodes, that parameter indicates the relative importance of each; 1 indicates the most important knowledge node. |
| created_at | DateTime | Date of creation of the object |
| updated_at | DateTime | Last time the object has been modified |
===Create (POST)===
^ Method | POST |
^ URL | /knowledge_node_contents |
==Parameters (*Requiered parameters)==
^ Property ^ Type ^ Description ^
| knowlede_node_id (or knowledge_node_uid)* | Integer | One of the knowledge nodes the content is related to |
| content_id (or content_uid)* | Integer | The related content |
| importance_degree | Integer | If a content is related to several knowledge nodes, that parameter indicates the relative importance of each; 1 indicates the most important knowledge node. |
==Send the request (JSON input example)==
{
knowledge_node_id: 3170,
content: 2749,
importance_degree: 1
}
==Get the response (JSON output example)==
{
"id": 1719,
"knowledge_node_id": 3170,
"content_id": 2749,
"created_at": "2017-11-22T17:02:39.343Z",
"updated_at": "2017-11-22T17:02:39.343Z",
"importance_degree": 1
}
===Fetch (GET)===
^ Method | GET|
^ URL | /knowledge_node_contents/{knowledge_node_content_id} |
If no knowledge_node_content_id is provided it will fetch all the Knowledge Node Content for your instance. You can choose to filter your request thanks to the following parameters:\\
^ Property ^ Type ^ Description ^
| knowlede_node_id | Integer | One of the knowledge nodes the content is related to |
| content_id | Integer | The related content |
==Get the response (JSON output example)==
**With ID provided**\\
{
"id": 1719,
"knowledge_node_id": 3170,
"content_id": 2749,
"created_at": "2017-11-22T17:02:39.343Z",
"updated_at": "2017-11-22T17:02:39.343Z",
"importance_degree": 1
}
**Without ID provided**\\
[
{
"id": 1719,
"knowledge_node_id": 3170,
"content_id": 2749,
"created_at": "2017-11-22T17:02:39.343Z",
"updated_at": "2017-11-22T17:02:39.343Z",
"importance_degree": 1,
"instance_id": 45
}
]