Messages

Client-Server

For every Client-Server interaction the client shall send a message with only "object" and "type" as keys, "object" must point to a dict and "type" must point to a string. For Example:

{"object": {"some": "object"},
 "type": "some type"}

The server will always reply with with a message that "object", "type" and "status" as keys, "object" must point to a dict, "type" must point to a string and "status" must point to a string that will be either "OK" or "ERROR".

{"object": {"some": "object"},
 "type": "some type"
 "status": "some status"}

Get

{"object": {"id": 1},
 "type": "Get"}

Reply - OK

{"status": "OK",
 "object": {"note": "some note",
            "ID": 1,
            "tags": ["tag1"],
            "timestamps": [1417326762.795402]},
 "type": "Get"}

Reply - ERROR

{"status": "ERROR",
 "type": "Get",
 "object": {"msg": "Item does not exist",
            "ID": 1}}

New Note

Message to add a new note

{
 "type": "Note"
 "object": {"note": "some note",
            "tags": ["tag1", "tag2"],
            "ID": 1
           }
}

NOTE The ID is optional

Reply - OK

{"status": "OK",
 "type": "Note",
 "object": {
           "received note": "some note text",
           "received tags": ["tag1", "tag2"],
           "ID": 1}
}

Reply - Error

Delete

Message to delete a note

{
 "type": "Delete"
 "object": {"ID": 1},
}

Reply - OK

{
 "status": "OK",
 "type": "Delete",
 "object": 1
}

Reply - Error

{
 "status": "ERROR",
 "type": "Delete",
 "object": {"msg": "Note Does not exist"}
}

Server-Server

Table Of Contents

Previous topic

note

Next topic

Installation

This Page