====== 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:content [2017/10/13 13:47] maries |
api2:knowledge_content:content [2018/07/23 09:46] (current) maries |
||
---|---|---|---|
Line 3: | Line 3: | ||
===Object resources=== | ===Object resources=== | ||
^ Property ^ Type ^ Description ^ | ^ Property ^ Type ^ Description ^ | ||
+ | | id | Integer | identifier for the database of Domoscio's API | | ||
| name | String | Custom content | | | name | String | Custom content | | ||
| uid | String | The ID of this knowledge node in your Database. Useful if you cannot store the ID returned by the API | | | uid | String | The ID of this knowledge node in your Database. Useful if you cannot store the ID returned by the API | | ||
+ | | content_url | String | URL on which the content can be accessed | | ||
+ | | format | String | format of the content | | ||
| type | String | "Evaluation" if the content is a question, "Learning" otherwise | | | type | String | "Evaluation" if the content is a question, "Learning" otherwise | | ||
+ | | created_at | DateTime | Date of creation of the object | | ||
+ | | updated_at | DateTime | Last time the object has been modified | | ||
===Create (POST)=== | ===Create (POST)=== | ||
Line 15: | Line 20: | ||
^ Property ^ Type ^ Description ^ | ^ Property ^ Type ^ Description ^ | ||
- | | name* | String | Custom data | | + | | name | String | Custom data | |
- | | uid | String | The ID of this knowledge node in your Database. Useful if you cannot store the ID returned by the API | | + | | uid* | String | The ID of this knowledge node in your Database. Useful if you cannot store the ID returned by the API | |
+ | | content_url | String | URL on which the content can be accessed | | ||
| type* | String | "Evaluation" if the content is a question, "Learning" otherwise | | | type* | String | "Evaluation" if the content is a question, "Learning" otherwise | | ||
+ | | format | String | format of the content | | ||
==Send the request (JSON input example)== | ==Send the request (JSON input example)== | ||
Line 23: | Line 30: | ||
<code> | <code> | ||
{ | { | ||
- | name : “on PGCD”, | + | name : "on PGCD", |
- | uid: “question1”, | + | uid: "question1", |
- | type: “Evaluation” | + | format: "qti", |
+ | type: "Evaluation" | ||
} | } | ||
</code> | </code> | ||
Line 33: | Line 41: | ||
<code> | <code> | ||
{ | { | ||
- | id: 1, | + | "id": 2749, |
- | instance_id: 1, | + | "uid": "question1", |
- | type: "Evaluation", | + | "type": "Evaluation", |
- | name: “on PGCD”, | + | "name": "on PGCD", |
- | uid: “question1” | + | "content_url": null, |
+ | "format": qti, | ||
+ | "created_at": "2017-11-22T16:31:45.071Z", | ||
+ | "updated_at": "2017-11-22T16:31:45.071Z" | ||
} | } | ||
</code> | </code> | ||
Line 54: | Line 65: | ||
<code> | <code> | ||
{ | { | ||
- | id: 1, | + | "id": 2749, |
- | instance_id: 1, | + | "uid": "question1", |
- | name: “on PGCD”, | + | "created_at": "2017-11-22T16:31:45.071Z", |
- | type: “Evaluation”, | + | "updated_at": "2017-11-22T16:31:45.412Z", |
- | uid: 1 | + | "name": "on PGCD", |
+ | "content_url": null, | ||
+ | "format": qti, | ||
+ | "type": "Evaluation" | ||
} | } | ||
</code> | </code> | ||
Line 66: | Line 80: | ||
<code> | <code> | ||
[ | [ | ||
+ | { | ||
+ | "id": 709, | ||
+ | "uid": "video", | ||
+ | "created_at": "2017-09-20T14:35:38.843Z", | ||
+ | "updated_at": "2017-09-20T14:35:38.843Z", | ||
+ | "name": "1_4", | ||
+ | "content_url": null, | ||
+ | "format": null, | ||
+ | "type": "Read" | ||
+ | }, | ||
+ | { | ||
+ | "id": 2749, | ||
+ | "uid": "question1", | ||
+ | "created_at": "2017-11-22T16:31:45.071Z", | ||
+ | "updated_at": "2017-11-22T16:31:45.412Z", | ||
+ | "name": "on PGCD", | ||
+ | "content_url": null, | ||
+ | "format": qti, | ||
+ | "type": "Evaluation" | ||
+ | } | ||
+ | ] | ||
+ | </code> | ||
+ | |||
+ | ===EDIT (PUT)=== | ||
+ | |||
+ | ^ Method | PUT | | ||
+ | ^ URL | /contents/{content_id} | | ||
+ | |||
+ | ==Editable parameters== | ||
+ | |||
+ | ^ Property ^ Type ^ Description/expected values | | ||
+ | | name | String | Custom data (<255 characters) | | ||
+ | | content_url | String | URL on which the content can be accessed | | ||
+ | |||
+ | ==Send the request (JSON input example)== | ||
+ | |||
+ | <code> | ||
{ | { | ||
- | id: 1, | + | name : "on PGCD - difficult" |
- | instance_id: 1, | + | } |
- | name: “on PGCD”, | + | </code> |
- | type: “Evaluation”, | + | |
- | uid: “1” | + | ==Get the response (JSON output example)== |
- | }, | + | |
- | { | + | <code> |
- | id: 2, | + | { |
- | instance_id: 1, | + | "id": 2749, |
- | name: “on PPCM”, | + | "name": "on PDCG - difficult", |
- | type: “Learning”, | + | "created_at": "2017-11-22T16:31:45.071Z", |
- | uid: “2” | + | "updated_at": "2017-11-22T16:42:49.954Z", |
+ | "uid": "question1", | ||
+ | "format": qti, | ||
+ | "content_url": null | ||
} | } | ||
- | ] | ||
</code> | </code> | ||