====== Differences ====== This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
api2:knowledge_content:knowledge_node_content [2017/10/13 13:56] maries |
api2:knowledge_content:knowledge_node_content [2018/07/23 09:49] (current) maries |
||
|---|---|---|---|
| Line 4: | Line 4: | ||
| ^ Property ^ Type ^ Description ^ | ^ 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 | | | knowlede_node_id | Integer | One of the knowledge nodes the content is related to | | ||
| | content_id | Integer | The related content | | | 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. | | + | | 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)=== | ===Create (POST)=== | ||
| ^ Method | POST | | ^ Method | POST | | ||
| - | ^ URL | /contents | | + | ^ URL | /knowledge_node_contents | |
| ==Parameters (*Requiered parameters)== | ==Parameters (*Requiered parameters)== | ||
| ^ Property ^ Type ^ Description ^ | ^ Property ^ Type ^ Description ^ | ||
| - | | knowlede_node_id* | Integer | One of the knowledge nodes the content is related to | | + | | knowlede_node_id (or knowledge_node_uid)* | Integer | One of the knowledge nodes the content is related to | |
| - | | content_id* | Integer | The related content | | + | | 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. | | + | | 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)== | ==Send the request (JSON input example)== | ||
| Line 24: | Line 27: | ||
| <code> | <code> | ||
| { | { | ||
| - | knowledge_node_id: 1, | + | knowledge_node_id: 3170, |
| - | content: 1, | + | content: 2749, |
| importance_degree: 1 | importance_degree: 1 | ||
| } | } | ||
| Line 34: | Line 37: | ||
| <code> | <code> | ||
| { | { | ||
| - | id : 1, | + | "id": 1719, |
| - | importance_degree: 1, | + | "knowledge_node_id": 3170, |
| - | knowledge_node_id: 1, | + | "content_id": 2749, |
| - | content_id: 1 | + | "created_at": "2017-11-22T17:02:39.343Z", |
| + | "updated_at": "2017-11-22T17:02:39.343Z", | ||
| + | "importance_degree": 1 | ||
| } | } | ||
| </code> | </code> | ||
| Line 46: | Line 51: | ||
| ^ URL | /knowledge_node_contents/{knowledge_node_content_id} | | ^ 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. | + | 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)== | ==Get the response (JSON output example)== | ||
| Line 54: | Line 62: | ||
| <code> | <code> | ||
| { | { | ||
| - | id: 1, | + | "id": 1719, |
| - | importance_degree: 1, | + | "knowledge_node_id": 3170, |
| - | knowledge_node_id: 1, | + | "content_id": 2749, |
| - | content_id: 1 | + | "created_at": "2017-11-22T17:02:39.343Z", |
| + | "updated_at": "2017-11-22T17:02:39.343Z", | ||
| + | "importance_degree": 1 | ||
| } | } | ||
| </code> | </code> | ||
| Line 65: | Line 75: | ||
| <code> | <code> | ||
| [ | [ | ||
| - | { | + | { |
| - | id: 1, | + | "id": 1719, |
| - | importance_degree: 1, | + | "knowledge_node_id": 3170, |
| - | knowledge_node_id: 1, | + | "content_id": 2749, |
| - | content_id: 1 | + | "created_at": "2017-11-22T17:02:39.343Z", |
| - | }, | + | "updated_at": "2017-11-22T17:02:39.343Z", |
| - | { | + | "importance_degree": 1, |
| - | id: 2, | + | "instance_id": 45 |
| - | importance_degree: 2, | + | } |
| - | knowledge_node_id: 2, | + | |
| - | content_id: 1 | + | |
| - | } | + | |
| ] | ] | ||
| </code> | </code> | ||
| - | |||
| - | ===Fetch all Knowledge Node Content by Content (GET)=== | ||
| - | |||
| - | ^ Method | GET | | ||
| - | ^ URL | /content/{content_id}/content_knowledge_nodes | | ||