====== Differences ====== This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
api2:knowledge_content:content [2017/10/07 14:49] 127.0.0.1 external edit |
api2:knowledge_content:content [2018/07/23 09:46] (current) maries |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | A Content is anything that contains learning. It can be a video, some text, a question, a picture, and so on.\\ | ||
+ | |||
+ | ===Object resources=== | ||
+ | ^ Property ^ Type ^ Description ^ | ||
+ | | id | Integer | identifier for the database of Domoscio's API | | ||
+ | | 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 | | ||
+ | | 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 | | ||
+ | | created_at | DateTime | Date of creation of the object | | ||
+ | | updated_at | DateTime | Last time the object has been modified | | ||
+ | |||
+ | ===Create (POST)=== | ||
+ | |||
+ | ^ Method | POST | | ||
+ | ^ URL | /contents | | ||
+ | |||
+ | ==Parameters (*Requiered parameters)== | ||
+ | |||
+ | ^ Property ^ Type ^ Description ^ | ||
+ | | 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 | | ||
+ | | content_url | String | URL on which the content can be accessed | | ||
+ | | type* | String | "Evaluation" if the content is a question, "Learning" otherwise | | ||
+ | | format | String | format of the content | | ||
+ | |||
+ | ==Send the request (JSON input example)== | ||
+ | |||
+ | <code> | ||
+ | { | ||
+ | name : "on PGCD", | ||
+ | uid: "question1", | ||
+ | format: "qti", | ||
+ | type: "Evaluation" | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | ==Get the response (JSON output example)== | ||
+ | |||
+ | <code> | ||
+ | { | ||
+ | "id": 2749, | ||
+ | "uid": "question1", | ||
+ | "type": "Evaluation", | ||
+ | "name": "on PGCD", | ||
+ | "content_url": null, | ||
+ | "format": qti, | ||
+ | "created_at": "2017-11-22T16:31:45.071Z", | ||
+ | "updated_at": "2017-11-22T16:31:45.071Z" | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | ===Fetch (GET)=== | ||
+ | |||
+ | ^ Method | GET| | ||
+ | ^ URL | /contents/{content_id} | | ||
+ | |||
+ | If no content_id is provided it will fetch all the Contents for your instance. | ||
+ | |||
+ | ==Get the response (JSON output example)== | ||
+ | |||
+ | **With ID provided**\\ | ||
+ | |||
+ | <code> | ||
+ | { | ||
+ | "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> | ||
+ | |||
+ | |||
+ | **Without ID provided**\\ | ||
+ | <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> | ||
+ | { | ||
+ | name : "on PGCD - difficult" | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | ==Get the response (JSON output example)== | ||
+ | |||
+ | <code> | ||
+ | { | ||
+ | "id": 2749, | ||
+ | "name": "on PDCG - difficult", | ||
+ | "created_at": "2017-11-22T16:31:45.071Z", | ||
+ | "updated_at": "2017-11-22T16:42:49.954Z", | ||
+ | "uid": "question1", | ||
+ | "format": qti, | ||
+ | "content_url": null | ||
+ | } | ||
+ | </code> | ||
+ | |||