Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-56045

New Web Service message_airnotifier_enable_device

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.2
    • Component/s: Messages
    • Labels:
    • Testing Instructions:
      Hide
      1. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      2. Create a Token in the mobile app service for one user:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      3. Then configure the message output plugin "Mobile notifications": you just need to enter a valid API key (please, use the one in the comment bellow), and then you must enable it in the list of message output plugins available
      4. Once is configured, with your mobile device, open the Moodle Mobile app and log in to the site.
      5. Now, go to your messaging preferences in Moodle web (/message/edit.php?id=USER_ID) and check that your device is listed in the Mobile notifications section
      6. Next, you can do a CURL REST call simulating a WS client with the user.
        • You need to replace the wstoken, the deviceid (from the message_airnotifier_devices table) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'deviceid=1&enable=0&wsfunction=message_airnotifier_enable_device&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' | python -m "json.tool"

      7. Check that your device is now disabled in the Mobile notifications section in the messaging preferences
      8. Execute the curl request again replacing enable to 1 and check that the device is now enabled in the Mobile notifications section in the messaging preferences
      Show
      As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token in the mobile app service for one user: Click on Site administration ► Plugins ► Web services ► Manage tokens Then configure the message output plugin "Mobile notifications": you just need to enter a valid API key (please, use the one in the comment bellow), and then you must enable it in the list of message output plugins available Once is configured, with your mobile device, open the Moodle Mobile app and log in to the site. Now, go to your messaging preferences in Moodle web (/message/edit.php?id=USER_ID) and check that your device is listed in the Mobile notifications section Next, you can do a CURL REST call simulating a WS client with the user. You need to replace the wstoken, the deviceid (from the message_airnotifier_devices table) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'deviceid=1&enable=0&wsfunction=message_airnotifier_enable_device&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' | python -m "json.tool" Check that your device is now disabled in the Mobile notifications section in the messaging preferences Execute the curl request again replacing enable to 1 and check that the device is now enabled in the Mobile notifications section in the messaging preferences
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-56045-master

      Description

      Enable or disable a mobile device registered in Moodle for the user

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jleyva Juan Leyva
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              Dani Palou
              Integrator:
              Dan Poltawski
              Tester:
              Rajesh Taneja
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                5/Dec/16