XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.9
    • 2.8.5
    • Web Services
    • MOODLE_28_STABLE
    • MOODLE_29_STABLE
    • MDL-49501-master
    • Hide

      Note: Version number is bumped because a new web service is added into the Mobile app service.

      1. Enable messaging in the site
      2. Create a couple of users accounts, user1 and user2
      3. Log in as user2, send a message from user2 to user1
      4. Retrieve the id value of that message from the database (table message)
      5. Enable "Mobile services": Plugins ► Web Services ►Mobile
      6. Create a Token for the Mobile app service (for user1):
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      7. Next, you can do a CURL REST call simulating a WS client:
        • You need to replace the messageid value with the message id .
        • You also need to replace the wstoken and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'messageid=1&timeread=1422449096&wsfunction=core_message_mark_message_read&wstoken=ffbe3a3002f235bf9d01fd9369e10b66'

      8. Confirm that:
        • The command returns a message id, this message is the id of the message in the message_read table. The original mesage in the message table was deleted.
        • If you use an incorrect message id, you got an error (record not found)
        • If you use am existing message id (but a message that was send to a different user) you will see an invalid parameter error (you don't have permissions to see the message)
      Show
      Note: Version number is bumped because a new web service is added into the Mobile app service. Enable messaging in the site Create a couple of users accounts, user1 and user2 Log in as user2, send a message from user2 to user1 Retrieve the id value of that message from the database (table message) Enable "Mobile services": Plugins ► Web Services ►Mobile Create a Token for the Mobile app service (for user1): Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client: You need to replace the messageid value with the message id . You also need to replace the wstoken and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'messageid=1&timeread=1422449096&wsfunction=core_message_mark_message_read&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' Confirm that: The command returns a message id, this message is the id of the message in the message_read table. The original mesage in the message table was deleted. If you use an incorrect message id, you got an error (record not found) If you use am existing message id (but a message that was send to a different user) you will see an invalid parameter error (you don't have permissions to see the message)

      Note that this function is already in the core, and it triggers the message read event

            jleyva Juan Leyva
            jleyva Juan Leyva
            Dani Palou Dani Palou
            Dan Poltawski Dan Poltawski
            John Okely John Okely
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.