Files
workavia-drive/Documentation/docs/internal-documentation/backend-services/knowledge-graph/README.md
T
montaghanmy 10fe6f78d1 feat: init
2023-03-23 11:03:16 +01:00

50 lines
1018 B
Markdown

# Knowledge-graph
## Twake to Knowledge-graph events
Twake can send events to the knowledge graph following this documentation:
[Events from Twake](./pushed-from-twake.md)
## Knowledge-graph to Twake REST
The knowledge graph can send us event at the following endpoint:
`POST https://api.twake.app/internal/services/knowledge-graph/v1/push`
Authorized by a Token authorization header:
`Authorization: Token {some token defined together}`
And with the following data in JSON:
```
{
events: [KnowledgeGraphCallbackEvent, KnowledgeGraphCallbackEvent, KnowledgeGraphCallbackEvent, ...]
}
type KnowledgeGraphCallbackEvent = {
recipients: {
type: "user";
id: string; // KG user id which is a md5 of the email
}[];
event: {
type: "user_tags"; //More events will be added later
data: {
//For user_tags event only
tags?: {
value: string;
weight: number;
}[];
};
};
};
```
The reply will be if everything was alright:
```
{
"status": "success"
}
```