Domoscio API (v2.7.2.4)

We designed the Domoscio API in a Restful way, so that your user experience is simple and straightforward.

You will find in this documentation all the information necessary to interact with the API.

To keep in touch with the latest developments, check the Changelog just here!

Authentication

The workflow to authentify is based on Oauth2 protocol. The AuthorizationToken is given to the user when he starts working with the Domoscio API. This token must remain secret. To have access to Domoscio functionalities the user should follow these steps:

  1. The AuthorizationToken should be used inside the Header of the request when calling the API for the first time & when the RefreshToken expires:
    Authorization: Bearer < AuthorizationToken >

  2. Inside the response Header, the AccessToken and RefreshToken will be given:
    AccessToken: < AccessToken >
    RefreshToken: < RefreshToken >

  3. The RefreshToken should now be used in the header of the API request with the AccessToken. Here is an example on how to retrieve the AccessToken & RefreshToken:

  • Note: You will receive the AccessToken in the response at every request. However, when the RefreshToken is expired, you will receive a 401 error. At this point, it will be necessary to reuse the AuthenticationToken to retrieve a new pair of RefreshToken / AccessToken.

Response Status

Domoscio API uses conventional HTTP response codes to indicate the success or failure of an API request. In general:

  • Codes in the 2xx range indicate success.
  • Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.).
  • Codes in the 5xx range indicate an error with Domoscio's servers (Refer to the Domoscio Support in this case).
HTTP Status Code Description
200 - OK Everything worked as expected.
400 - Bad Request The request was unacceptable, often due to missing a required parameter.
401 - Unauthorized No valid Authentication Token provided.
404 - Not Found The requested resource doesn't exist.
422 - Unprocessable Entity The parameters were valid but the request failed, often due to already existing Objects with the input parameters.
500, 502, 503, 504 - Server Errors Something went wrong on Domoscio API's end. Please contact the Domoscio support.

KnowledgeGraph

A KnowledgeGraph (KG) is the first object to instantiate while setting up your content on our API. It is the top level of aggregation for knowledge nodes and edges. You can use it to describe your course, a book or even your whole knowledge map.

Create KnowledgeGraph

Create KnowledgeGraphs with payload parameters

Request Body schema: application/json
name
string

Object name.

uid
string

Object UID.

Responses

Request samples

Content type
application/json
{
  • "name": "Corporate Finance",
  • "uid": "fin101"
}

Response samples

Content type
application/json
{
  • "id": 45,
  • "name": "string",
  • "created_at": "2020-03-25T13:33:57.640Z",
  • "updated_at": "2020-03-25T13:33:57.640Z",
  • "uid": "string"
}

Get KnowledgeGraphs

Get KnowledgeGraphs with payload parameters (limit number of data in response is 200, use page parameter to get the following data).

Request Body schema: application/json
integer or Array of integers

Fetch the object(s) with ID.

string or Array of strings

Fetch the object(s) with UID.

string or Array of strings

Fetch the object(s) with name.

sort_by
string

Parameter(s) to sort the response by.
Example: 'param1.asc,param2.desc' will sort the data with param1 in ascending order then with param2 in descending order.

page
integer
Default: 1

Response page number with index starting from 1. One page contains 200 objects per default (can be modified with per_page parameter).

per_page
integer
Default: 200

Number of objects to display per page.

Responses

Request samples

Content type
application/json
[ ]

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Get a Knowledge Graph by ID

Get a specific knowledge graph

path Parameters
id
required
integer <int64>

Knowledge Graph ID

Responses

Response samples

Content type
application/json
{
  • "id": 45,
  • "name": "Corporate Finance",
  • "uid": "fin101",
  • "created_at": "2020-03-25T13:33:57.640Z",
  • "updated_at": "2020-03-25T13:33:57.640Z"
}

Update Knowledge Graph

Update a knowledge graph

path Parameters
id
required
integer <int64>

Knowledge Graph ID

Request Body schema: application/json
name
string

Object name.

uid
string

Object UID.

Responses

Request samples

Content type
application/json
{
  • "name": "No more Corporate Finance",
  • "uid": "fin101"
}

Response samples

Content type
application/json
{
  • "id": 45,
  • "name": "string",
  • "created_at": "2020-03-25T13:33:57.640Z",
  • "updated_at": "2020-03-25T13:33:57.640Z",
  • "uid": "uid_object"
}

Delete KnowledgeGraph

Please note that the deletion of an object is permanent and irrevocable, we advise deleting objects with care and attention.

path Parameters
required
integer or string

KnowledgeGraph ID or UID

Responses

Response samples

Content type
application/json
{
  • "response": true
}

KnowledgeNode

A KnowledgeNode (KN) is the second object to instantiate while setting up your content on our API. It is the central model of the application; it can be linked to multiple KnowledgeGraphs. You can use it to describe your content architecture, i.e skills, knowledges, know-hows, etc.

Create KnowledgeNode

Create a KnowledgeNode object

Request Body schema: application/json
name
string

Object name.

uid
required
string

Object UID.

knowledge_graph_id
integer

Object related to a set of KnowledgeGraph ID. It will create automatically the KnowledgeGraphNode that correspond to this association.

knowledge_graph_uid
String

Object related to a set of KnowledgeGraph UID. It will create automatically the KnowledgeGraphNode that correspond to this association.

knowledge_graph_ids
Array

Object related to a set of KnowledgeGraph IDs. It will create automatically the KnowledgeGraphNodes that correspond to the associations.

knowledge_graph_uids
Array

Object related to a set of KnowledgeGraph UIDs. It will create automatically the KnowledgeGraphNodes that correspond to the associations.

description
string

Object description

mean
number
Default: 60

Object's mean

standard_deviation
number
Default: 15

Object's standarddeviation

Responses

Request samples

Content type
application/json
{
  • "name": "Financial Assets",
  • "uid": "fa",
  • "knowledge_graph_id": 45
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "knowledge_graph_id": 0,
  • "created_at": "2020-03-25T13:33:57.640Z",
  • "updated_at": "2020-03-25T13:33:57.640Z",
  • "name": "string",
  • "uid": "string",
  • "difficulty": 1,
  • "description": "string"
}

Get KnowledgeNodes

Get KnowledgeNodes with payload parameters (limit number of data in response is 200, use page parameter to get the following data).

Request Body schema: application/json
integer or Array of integers

Fetch the object(s) with ID.

string or Array of strings

Fetch the object(s) with UID.

knowledge_graph_id
integer

Object related to a specific KnowledgeGraph ID.

knowledge_graph_uid
string

Object related to a specific KnowledgeGraph UID.

string or Array of strings

Fetch the object(s) with name.

sort_by
string

Parameter(s) to sort the response by.
Example: 'param1.asc,param2.desc' will sort the data with param1 in ascending order then with param2 in descending order.

page
integer
Default: 1

Response page number with index starting from 1. One page contains 200 objects per default (can be modified with per_page parameter).

per_page
integer
Default: 200

Number of objects to display per page.

Responses

Request samples

Content type
application/json
[ ]

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Get a KnowledgeNode by ID

Get a specific KnowledgeNode with ID or UID of the object

path Parameters
required
integer or string

KnowledgeNode ID or UID

Request Body schema: application/json
key_type
string

Key type to use. If key_type='uid', UID will be considered instead of ID.

Responses

Request samples

Content type
application/json
{
  • "key_type": "uid"
}

Response samples

Content type
application/json