Domoscio API (v2.4.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. To have access to Domoscio functionalities the user should follow these steps:

  • AuthorizationToken:

    The AuthorizationToken is given to the user when he starts working with the Domoscio API. This token must remain secret.

    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

201

Created

422

Unprocessable Entity

post/knowledge_graphs
https://adaptive-engine.domoscio.com/v2/instances/{client_id}/knowledge_graphs

Request samples

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

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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
id
integer or Array of integers

Fetch the object(s) with ID.

uid
string or Array of strings

Fetch the object(s) with UID.

name
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 20 objects per default (can be modified with per_page parameter).

per_page
integer
Default: 20

Number of objects to display per page.

Responses

200

OK

400

Bad Request

get/knowledge_graphs
https://adaptive-engine.domoscio.com/v2/instances/{client_id}/knowledge_graphs

Request samples

Content type
application/json
Copy
Expand all Collapse all
[ ]

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    },
  • {
    },
  • {
    }
]

Get a Knowledge Graph by ID

Get a specific knowledge graph

path Parameters
id
required
integer <int64>

Knowledge Graph ID

Responses

200

OK

400

Bad Request

get/knowledge_graphs/{id}
https://adaptive-engine.domoscio.com/v2/instances/{client_id}/knowledge_graphs/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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

200

OK

400

Bad Request

put/knowledge_graphs/{id}
https://adaptive-engine.domoscio.com/v2/instances/{client_id}/knowledge_graphs/{id}

Request samples

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

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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
id
required
integer or string

KnowledgeGraph ID or UID

Responses

200

Deleted

404

Not Found

delete/knowledge_graphs/{id}
https://adaptive-engine.domoscio.com/v2/instances/{client_id}/knowledge_graphs/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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.