Skip to content

GET Messages

Developer From Jokela edited this page Aug 11, 2020 · 1 revision

This page will guide you thru how to get message list from Wilma


BasePath for getting messages: https://<your_wilma_server>/messages/index_json

BasePath for getting messages from different folders: https://<your_wilma_server>/messages/index_json/<folder_name>

BasePath for getting message content: https://<your_wilma_server>/messages/index_json/<message_id>


You can get the list from inbox of Wilma by using URL:

BasePath for getting messages

You can get the list of your desired folder:

  • all: From all folders
  • outbox Outbox folder
  • archive Archive folder
  • drafts Drafts folder and with this URL:

BasePath for getting messages from different folders

Response:

{
   "Messages":[
      {
         "Id":1622757,
         "Subject":"Testi",
         "TimeStamp":"2020-08-11 10:24",
         "Folder":"inbox",
         "SenderId":5678,
         "SenderType":4,
         "Sender":"Adapteri Aatu (Developer From Jokela, 4A)",
         "SenderStudentName":"Developer From Jokela",
         "SenderPasswdID":9123,
         "SenderGuardianName":"Adapteri Aatu",
         "Status":1
      },
      {
         "Id":1622205,
         "Subject":"Wilmaan tulossa muutoksia",
         "TimeStamp":"2020-08-10 12:19",
         "Folder":"inbox",
         "SenderId":519,
         "SenderType":3,
         "Sender":"Titta Tapola (TAP)"
      },
      {
         "Id":1621664,
         "Subject":"Miksei tää toimi?",
         "TimeStamp":"2020-08-10 09:26",
         "Folder":"archive",
         "SenderId":41002,
         "SenderType":2,
         "Sender":"Developer From Jokela, 9E",
         "Replies":3
      }
   ]
}

Let's go more deeply:

      {
         "Id":1622757,
         "Subject":"Testi",
         "TimeStamp":"2020-08-11 10:24",
         "Folder":"inbox",
         "SenderId":5678,
         "SenderType":4,
         "Sender":"Adapteri Aatu (Developer From Jokela, 4A)",
         "SenderStudentName":"Developer From Jokela",
         "SenderPasswdID":9123,
         "SenderGuardianName":"Adapteri Aatu",
         "IsEvent": true
         "Status":1
      }

That's all possible parameters that Wilma can give

  • Id: Message ID
  • Subject: Subject of the message
  • TimeStamp: When message was sent
  • Folder: Where's the message located
  • SenderPasswdID: If guardian sent this message from role user, role user's ID is in SenderPasswdID
  • IsEvent: If this message is an event, this will be true. If not, this boolean IsEvent will be missing
  • Status: If status is 1, it means that message is not read. If status doesn't exist (or isn't 1), it means that it has been already read.

Get message content using URL:

BasePath for getting message content

Response:

{
   "messages":[
      {
         "Id":694,
         "Subject":"Noniin toimiiko tapahtumat",
         "TimeStamp":"2020-01-11 15:11",
         "Folder":"archive",
         "Recipient":"Tapola Titta, 9C",
         "RecipientCount":1,
         "Recipients":[
            "Tapola Titta, 9C"
         ],
         "SenderId":118,
         "SenderType":1,
         "Sender":"Hypoteesi Heikki (HYP)",
         "Replies":5,
         "AllowCollatedReply":true,
         "IsEvent":true,
         "ContentHtml":"<p>Ilmoittaudu niin testataan<img height=\"23\" src=\"\/shared\/scripts\/ckeditor\/plugins\/smiley\/images\/regular_smile.png\" width=\"23\"><img height=\"23\" src=\"\/shared\/scripts\/ckeditor\/plugins\/smiley\/images\/regular_smile.png\" width=\"23\"><img height=\"23\" src=\"\/shared\/scripts\/ckeditor\/plugins\/smiley\/images\/regular_smile.png\" width=\"23\"><img height=\"23\" src=\"\/shared\/scripts\/ckeditor\/plugins\/smiley\/images\/regular_smile.png\" width=\"23\"><img height=\"23\" src=\"\/shared\/scripts\/ckeditor\/plugins\/smiley\/images\/regular_smile.png\" width=\"23\"><img height=\"23\" src=\"\/shared\/scripts\/ckeditor\/plugins\/smiley\/images\/regular_smile.png\" width=\"23\"><img height=\"23\" src=\"\/shared\/scripts\/ckeditor\/plugins\/smiley\/images\/regular_smile.png\" width=\"23\"><\/p>",
         "EventData":{
            "MustApply":true,
            "Events":[
               {
                  "MsgID":694,
                  "EventID":1,
                  "Subject":"",
                  "Start":"2020-01-30 14:00",
                  "StartDayName":"To",
                  "End":"2020-01-30 19:00",
                  "EndDayName":"To",
                  "EnrollStart":"2020-01-10 00:00",
                  "EnrollEnd":"2020-01-23 14:00",
                  "CancelDate":"2020-01-22 00:00",
                  "Info":"Joking about something ss",
                  "SameDay":true,
                  "MaxPeople":88,
                  "Sender":"Hypoteesi Heikki (HYP)",
                  "State":"selected",
                  "PeopleCount":1
               }
            ]
         },
         "ReplyList":[
            {
               "Id":"1s15:57",
               "ContentHtml":"<p>sd<\/p>",
               "TimeStamp":"2020-01-11 15:57",
               "SenderId":118,
               "SenderType":1,
               "Sender":"Hypoteesi Heikki (HYP)"
            },
            {
               "Id":"2s15:57",
               "ContentHtml":"No hei",
               "TimeStamp":"2020-01-11 15:57",
               "SenderId":4291,
               "SenderType":2,
               "Sender":"Tapola Titta, 9C"
            },
            {
               "Id":"3s15:59",
               "ContentHtml":"Moro moro",
               "TimeStamp":"2020-01-11 15:59",
               "SenderId":4291,
               "SenderType":2,
               "Sender":"Tapola Titta, 9C"
            },
            {
               "Id":"4s20:33",
               "ContentHtml":"Ilmoittaudu mukaan",
               "TimeStamp":"2020-01-11 20:33",
               "SenderId":118,
               "SenderType":1,
               "Sender":"Hypoteesi Heikki (HYP)"
            },
            {
               "Id":"5s20:47",
               "ContentHtml":"Tulee olee ihan mahtavaa",
               "TimeStamp":"2020-01-11 20:47",
               "SenderId":118,
               "SenderType":1,
               "Sender":"Hypoteesi Heikki (HYP)"
            }
         ],
         "AllowForward":true,
         "AllowReply":true
      }
   ]
}

NOTE: AllowCollatedReply boolean, if it's true and exists, means that you can reply to this message