Endpoints
All messages to the Iota are either from the Omikron directly, from a Client or another Iota trying to message a User on the Iota.
All messages will be marked with a sender_id this will be added on the Omikron.
It is important to note that the Iota ID is not shared with others as it is what verifies the Iota users to Tensamin.
In the response the sender_id & receiver_id must be swapped as sender.
When a message comes from an iota without a sender-id that the iota has access to or is designated for the client (33333333-3333-3333-3333-333333333333) the message will not be send.
Messages
Section titled “Messages”Client messages someone
Section titled “Client messages someone”{ "sender_id": "<user-id>", "receiver_id": "<user-id>",
"type": "message_send", "id": "<uuid>", "data": { "receiver_id": "<uuid>", "content": "<markdown (encrypted)>", "files": [ { "name": "<cool name>", "id": "<uuid>", "type": "[ image | image_top_right | file ]" } ] }}{ "sender_id": "<user-id>", "receiver_id": "<user-id>",
"type": "message_send", "id": "<uuid>", "data": {}}Client loads messages
Section titled “Client loads messages”{ "sender_id": "<user-id>",
"type":"messages_get", "id": "<uuid>", "data": { "user_id": "<user-id>", "amount": int, "offset": int }}{ "sender_id": "<iota-id>",
"type": "messages_get", "id": "<uuid>", "data": { "messages": [ { "sent_by_self": true, "timestamp": 0, // UNIX Timestamp for time sent "content": "<markdown (encrypted)>", "files": [ { "name": "<cool name>", "id": "<uuid>", "type": "[ image | image_top_right | file ]" } ], "tint": "<hex color>", "avatar": false, // unless false key is removed "display": false // unless false key is removed } ] }}Send a message to other Iota
Section titled “Send a message to other Iota”{ "type": "message_send", "id": "<message_id>", "data": { "receiver_id": "99999999-8888-7777-6666-555555555555", "content": "Hello, how are you?" }}{ "type": "message", "id": "<message_id>", "receiver": "<user_id>"}Receive live message (message_other_iota)
Section titled “Receive live message (message_other_iota)”UPDATE:
Section titled “UPDATE:”{ "type": "message_live", "id": "<message_id>", "receiver": "<user_id>",
"data": { "send_time": unixstamp, "message": "<content>", "sender_id": "99999999-8888-7777-6666-555555555555" }}Communities
Section titled “Communities”Client storing a community on their Iota
Section titled “Client storing a community on their Iota”{ "type": "add_community", "id": "<message_id>", "receiver": "<user_id>",
"data": { "community_address": "community_address", "community_title": "community_title", "position": "x.y.z" }}{ "type": "add_community", "id": "<message_id>", "receiver": "<user_id>",
"data": {}}Client loading communities from their Iota
Section titled “Client loading communities from their Iota”{ "type": "get_communities", "id": "<message_id>",
"data": {}}{ "type": "get_community", "id": "<message_id>", "receiver": "<user_id>",
"data": { "communities": [ { "community_address": "enc_community_address", "community_title": "enc_community_title", "position": "x.y.z" // Frontend defines folders etc }, { "community_address": "enc_community_address", "community_title": "enc_community_title", "position": "x.y.z" } ] }}Remove a community
Section titled “Remove a community”{ "type": "remove_community", "id": "<message_id>",
"data": { "community_address": "community-uuid-or-address" }}{ "type": "remove_community", "id": "<message_id>", "receiver": "<user_id>"}User Settings
Section titled “User Settings”Save user Settings on Iota
Section titled “Save user Settings on Iota”{ "type": "settings_save", "id": "<message_id>",
"data": { "setting_name": "<name of category>", "payload": { "this": "will", "be": "saved", "on": "the", "iota": "!" } }}{ "type": "settings_save", "id": "<message_id>", "receiver": "<user_id>",
"data": {}}Load user Settings
Section titled “Load user Settings”{ "type": "settings_load", "id": "<message_id>",
"data": { "setting_name": "<name of category>" }}{ "type": "settings_load", "id": "<message_id>", "receiver": "<user_id>",
"data": { "setting_name": "<name of category>", "payload": { "this": "will", "be": "saved", "on": "the", "iota": "!" } }}