There are three possible options of usage:
- For any users by Telegram bot
- For psychologists try Telegram bot or web application
- API for dating sevices based on studies of Robert Plutchik.
About methodology See Wikipedia about R.Plutchik studies
As user
- Find Telegram bot
- Send command /start to bot
- Change your settings. Choose right language to get appropriate content
- Try Insights button to get your features
As psychologist
- Find Telegram bot
- Send command /start to bot
- Use web application to create new organizations
- Manage content of your organization. Invite other users to manage content of your organizations
- Assign groups to users for assessments
- Collect and analyze results
Use methods addcontent to add new items and change existing items in collection. Methods blockcontent and unblockcontent make items visible or hiding from users.
For editing content item structure use Content object.
For editing content items you must have organizationkey with create_content role. Users can't create or edit content items. They can assess them only. Organizations can create and edit content.
Use addassessment method to create new assessment had done by user. For calling addassessment
you must reveal sessiontoken by getsessiontoken method and use sesstiontoken as parameter.
Use Assessment object to create new assessment as a parameter for addassessment method.
Breifly. 'Cause data are using by psychology teams for their studies.
There are two authorization schemas:
- for organizations: API is awaiting the pair of organizationid and organizationkey
- for users: API is awaiting the pair of userid and valid sessiontoken
Role | Description | Admitted methods |
---|---|---|
superviser |
Organization is having this role can do everything | All |
administrator |
Role admits to manage keys to reveal new keys | addorganizationkey, removeorganizationkey, listorganizationkeys |
manage_users |
Role admits to create new users, edit exist ones, block and unblock | adduser, blockuser, unblockuser |
manage_content |
Role admits to create new content items, edit exist ones, block and unblock | addcontent, blockcontent, unblockcontent |
mining_session |
Role admits to create sessions tokens for user | getsessiontoken |
create_assessment |
Role admits to create new assesments | addassessment |
getting_feed |
Role admits getting the next content item to assessment | Not implemented yet |
getting_match |
Role admits to get matches | Not implemented yet |
object | Description |
---|---|
Organization | Organization can create users, content items. Organization provides roles for users |
User | User who can evaluate content and get matched with other users |
Content | Item (unit) for evaluation by user in Plutchik's wheel |
Assessment | Assessment (evaluation) by user of content item in Plutchik's wheel |
method | Description |
---|---|
version | Gets version Plutchik API |
π ORGANIZATION management | |
addorganizationkey | Adds new organization key with exact roles |
listorganizationkeys | Returns list of organization keys with their roles |
removeorganizationkey | Removes the organization key |
organizationinfo | Check the pair of organization id and key and returns common organization's info |
π USER management | |
adduser | Adds new user |
getsessiontoken | Gets session token for user |
blockuser | Block user |
unblockuser | Unblock user |
π CONTENT management | |
addcontent | Adds new content item |
blockcontent | Block content item |
unblockcontent | Unblock content item |
π ASSESSMENT management | |
addassessment | Adds new assessment |
export interface IOrganization {
_id: Types.ObjectId;
name: string | IMLString;
keys: Array<{
roles: Array<string>;
keyname: string;
expired: Date;
created: Date;
keyhash: string;
}>;
created: Date;
changed: Date;
}
interface IUser {
_id: Types.ObjectId;
organizationid: Types.ObjectId;
birthdate: Date;
nativelanguage: string;
secondlanguages: Array<string>,
location: string;
gender: string;
maritalstatus: string;
features: string;
blocked: boolean;
created: Date;
changed: Date;
}
export interface IContent {
_uid: Types.ObjectId;
type: ContentTypes;
url: string;
name: string;
description: string;
language: string;
restrictions: Array<string>;
organizationidref?: Types.ObjectId;
foruseronlyidref?: Types.ObjectId;
blocked: boolean;
created: Date;
changed: Date;
}
export interface IAssessment {
_id?: Types.ObjectId; // uniq ID of assessment
uid?: Types.ObjectId; // user ID, required but may be undefined. userid posted by security schema of call
cid: Types.ObjectId; // content ID
vector: {
joy?: number;
trust?: number;
fear?: number;
surprise?: number;
disgust?: number;
sadness?: number;
anger?: number;
anticipation?: number;
},
tags?: Array<string>; // tags from user
rating?: number; // value of assessed content item for match with others
created?: Date;
}
-
Description: returns object with values of versions: api, data, ai
Method:
GET
Parameters:
NONE
Security schema:
NONE
Returns:
- object version {api: x.x.x, data: x.x.x, ai: x.x.x}
- format application/json
-
Description: creates the new key with exect roles. Organization must use key with administrator roles to create new key
Method:
POST
Parameters:
Parameter description Format Where Mandatory organizationid
Uniq id of organization MongoDB uuid header β organizationkey
Key recieved from Plutchik API with role administrator MongoDB uuid header β name
Name of a new key string body β roles
Array of roles for a new key Array of strings body β Security schemas:
PlutchikAuthOrganizationId & PlutchikAuthOrganizationKey
Returns:
- format:
application/text
- data: mongoDB uuid of a new key
Request example:
POST http://localhost:8000/addorganizationkey Content-Type: application/json organizationid: 63c0e7dad80176886c22129d organizationkey: 63c2875ecb60f72dc1eb6bbb { "name": "David Rhuxel", "roles": ["manage_content", "manage_users"] }
- format:
-
Description: Deletes the key. Organization must use key with administrator roles to remove key
Method:
POST
Parameters:
Parameter description Format Where Mandatory organizationid
Uniq id of organization MongoDB uuid header β organizationkey
Key recieved from Plutchik API with role administrator MongoDB uuid header β id
Id returned by organizationkeyslist method. Can't delete key with id = 0 string body β Security schemas:
PlutchikAuthOrganizationId & PlutchikAuthOrganizationKey
Returns: NONE
Request example:
POST http://localhost:8000/removeorganizationkey Content-Type: application/json organizationid: 63c0e7dad80176886c22129d organizationkey: 63c2875ecb60f72dc1eb6bbb { "id": 1 }
-
Description: Returns all organization keys
Method:
GET
Parameters:
Parameter description Format Where Mandatory organizationid
Uniq id of organization MongoDB uuid header β organizationkey
Key recieved from Plutchik API with role administrator MongoDB uuid header β Security schemas:
PlutchikAuthOrganizationId & PlutchikAuthOrganizationKey
Returns:
- format:
application/json
- data: array of objects
Request example:
GET http://localhost:8000/organizationkeyslist Content-Type: application/json organizationid: 63c0e7dad80176886c22129d organizationkey: 63c2875ecb60f72dc1eb6bbb
- format:
-
Description: Check the pair of organization id and key and returns common organization's info
Method:
GET
Parameters:
Parameter description Format Where Mandatory organizationid
Uniq id of organization MongoDB uuid header β organizationkey
Key recieved from Plutchik API with role administrator MongoDB uuid header β Security schemas:
PlutchikAuthOrganizationId & PlutchikAuthOrganizationKey
Returns:
- format:
application/json
- data: object
{ name: string - organization name, keyname: string - name of key keyroles: array of string - list of current roles keyscount: number - count of organization's keys userscount: number - count of organization's users contentcount: number - count of organization's content items assessmentscount: number - count of organization's user assessments }
Request example:
GET http://localhost:8000/organizationinfo Content-Type: application/json organizationid: 63c0e7dad80176886c22129d organizationkey: 63c2875ecb60f72dc1eb6bbb
- format:
-
Description: creates user or updates existing user. Returns actual user information
Method:
POST
Parameters:
Parameter description Format Where Mandatory organizationid
Uniq id of organization MongoDB uuid header β organizationkey
Key recieved from Plutchik API with role manage_users MongoDB uuid header β userid
Uniq user id of user which info changed. Can be empty or absent, then new user will be created MongoDB uuid header userinfo
β userinfo.birthdate
User's birthdate YYYY-mm-dd body userinfo.nativelanguage
User's native language string body userinfo.secondlanguages
Other user's languages that can be used Array of string body userinfo.location
String as 'lat: xx.xxxxx, lng: yy.yyyyy' or 'Prague, Czech' etc. which describes user's location string body userinfo.gender
User's gender in his(her,...) opinion string body userinfo.maritalstatus
User's marital status in one's opinion string body userinfo.features
Any information about user string body Security schemas:
PlutchikAuthOrganizationId & PlutchikAuthOrganizationKey
Returns:
- format:
application/json
- data: User object
Request example:
POST http://localhost:8000/adduser Content-Type: application/json organizationid: 63c0e7dad80176886c22129d organizationkey: 63c2875ecb60f72dc1eb6bbb userid: 63c28926cb60f72dc1eb6bbf { "userinfo": { "birthdate": "1972-07-23", "nativelanguage": "English", "secondlanguages": ["French", "Ukrain"], "location": "Prague", "gender": "male", "maritalstatus": "single", "features": "extra", "blocked": "false" } }
- format:
-
Description: returns session token for user
Method:
GET
Parameters:
Parameter description Format Where Mandatory organizationid
Uniq id of organization MongoDB uuid header β organizationkey
Key recieved from Plutchik API with exact roles MongoDB uuid header β userid
User which session token requsted for MongoDB uuid header β Security schemas:
PlutchikAuthOrganizationId & PlutchikAuthOrganizationKey & PlutchikAuthUserId
Returns:
- text string MongoDB uuid
- format application/text
-
Description: Blocks user. After that user can't assess content and can't get matched
Method:
GET
Parameters:
Parameter description Format Where Mandatory organizationid
Uniq id of organization MongoDB uuid header β organizationkey
Key recieved from Plutchik API with exact roles MongoDB uuid header β userid
User which session token requsted for MongoDB uuid header β Security schemas:
PlutchikAuthOrganizationId & PlutchikAuthOrganizationKey & PlutchikAuthUserId
Returns: NONE
-
Description: Unblocks user. After that user can assess content and can get matched
Method:
GET
Parameters:
Parameter description Format Where Mandatory organizationid
Uniq id of organization MongoDB uuid header β organizationkey
Key recieved from Plutchik API with exact roles MongoDB uuid header β userid
User which session token requsted for MongoDB uuid header β Security schemas:
PlutchikAuthOrganizationId & PlutchikAuthOrganizationKey & PlutchikAuthUserId
Returns:
NONE
-
Description: creates content or updates existing content item. Returns actual content item
Method:
POST
Parameters:
Parameter description Format Where Mandatory organizationid
Uniq id of organization MongoDB uuid header β organizationkey
Key recieved from Plutchik API with exact roles MongoDB uuid header β contentinfo
body β contentinfo._id
Uniq content item's id. It can be empty or absent, then new content item will be created MongoDB uuid body contentinfo.type
String one of values: text, audio, video, image, memes string body β contentinfo.url
URL located the content item string body β contentinfo.name
Name of content item string body β contentinfo.tags
User's native language string body β contentinfo.description
Description of content item Array of string body β contentinfo.language
language of content item string body β contentinfo.restrictions
Array of restrictions Array of strings body contentinfo.blocked
Blocked or unblocked content item string: "true" or "false" body contentinfo.expired
Date time after that content item will be hide from users string RFC3339 body contentinfo.validfrom
Date time before that content item is hide from users string RFC3339 body Security schemas:
PlutchikAuthOrganizationId & PlutchikAuthOrganizationKey
Returns:
- format:
application/json
- data: Content object
Request example:
POST http://localhost:8000/addcontent Content-Type: application/json organizationid: 63c0e7dad80176886c22129d organizationkey: 63c2875ecb60f72dc1eb6bbb { "contentinfo": { "type": "memes", "url": "https://i.ytimg.com/vi/NbpdFJrothU/maxresdefault.jpg", "name": "TH sound", "tags": [], "description": "When your teacher explains how to pronounce TH", "language": "English", "restrictions": [], "blocked": "false" } }
- format:
-
Description: Blocks content item. After that users can't find and assess this content
Method:
GET
Parameters:
Parameter description Format Where Mandatory organizationid
Uniq id of organization MongoDB uuid header β organizationkey
Key recieved from Plutchik API with exact roles MongoDB uuid header β cid
Content item's uniq id MongoDB uuid path β Security schemas:
PlutchikAuthOrganizationId & PlutchikAuthOrganizationKey
Returns: NONE
-
Description: Unblocks content item. After that user can find and assess this content item
Method:
GET
Parameters:
Parameter description Format Where Mandatory organizationid
Uniq id of organization MongoDB uuid header β organizationkey
Key recieved from Plutchik API with exact roles MongoDB uuid header β cid
Content item's uniq id MongoDB uuid path β Security schemas:
PlutchikAuthOrganizationId & PlutchikAuthOrganizationKey
Returns:
NONE
-
Description: creates user's assessment of content item. Returns full object Assessment as it's saved.
Method:
POST
Parameters:
Parameter description Format Where Mandatory userid
Uniq id user MongoDB uuid header β sessiontoken
Active session token got by getsessiontoken MongoDB uuid header β assessmentinfo
β assessmentinfo.cid
Uniq content id MongoDB uuid body β assessmentinfo.tags
Array of tags from user with evaluation Array of strings body assessmentinfo.rating
Measure of confidence of user in his(her) assessment number body assessmentinfo.vector
Plutchik's wheel object object body β assessmentinfo.vector.joy
joy
evaluationfloat: 0 - 1 body assessmentinfo.vector.trust
trust
evaluationfloat: 0 - 1 body assessmentinfo.vector.fear
fear
evaluationfloat: 0 - 1 body assessmentinfo.vector.surprise
surprise
evaluationfloat: 0 - 1 body assessmentinfo.vector.sadness
sadness
evaluationfloat: 0 - 1 body assessmentinfo.vector.disgust
disgust
evaluationfloat: 0 - 1 body assessmentinfo.vector.anger
anger
evaluationfloat: 0 - 1 body assessmentinfo.vector.anticipation
anticipation
evaluationfloat: 0 - 1 body Security schemas:
PlutchikAuthUserId & PlutchikAuthSessionToken
Returns:
- format:
application/json
- data: Assessment object
Request example:
POST http://localhost:8000/addassessment Content-Type: application/json userid: 63c28926cb60f72dc1eb6bbf sessiontoken: $st.data { "assessmentinfo": { "cid": "63c83c56116ae4954bdc51ad", "vector": { "joy": 0.5, "trust": 0.6 } } }
- format:
- Wikipedia about R.Plutchik studies