User Tools

Site Tools


api2:knowledge_content:knowledge_node_content

====== Differences ====== This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
api2:knowledge_content:knowledge_node_content [2017/10/07 14:49]
127.0.0.1 external edit
api2:knowledge_content:knowledge_node_content [2018/07/23 09:49] (current)
maries
Line 1: Line 1:
 +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)==
 +
 +<​code>​
 +{
 + knowledge_node_id:​ 3170,
 + content: 2749,
 + importance_degree:​ 1
 +}
 +</​code>​
 +
 +==Get the response (JSON output example)==
 +
 +<​code>​
 +{
 +    "​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
 +}
 +</​code>​
 +
 +===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**\\
 +
 +<​code>​
 +{
 +    "​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
 +}
 +</​code>​
 +
 +
 +**Without ID provided**\\
 +<​code>​
 +[
 +    {
 +        "​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
 +    }
 +]
 +</​code>​
  
api2/knowledge_content/knowledge_node_content.1507380567.txt.gz · Last modified: 2017/10/07 14:49 by 127.0.0.1