• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

[MMM-Remote-Control] Cannot GET /api

Scheduled Pinned Locked Moved Unsolved Troubleshooting
12 Posts 10 Posters 6.9k Views 8 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    teemuoksanen
    last edited by Mar 7, 2019, 7:53 PM

    I have exactly the same problem - all API calls result in error “Cannot GET /api/whatevermoduleitrytocall”. However, remote.html loads just fine.

    M 1 Reply Last reply Apr 14, 2019, 7:51 PM Reply Quote 0
    • M Offline
      mohace @teemuoksanen
      last edited by mohace Apr 14, 2019, 8:33 PM Apr 14, 2019, 7:51 PM

      @teemuoksanen said in [MMM-Remote-Control] Cannot GET /api:

      I have exactly the same problem - all API calls result in error “Cannot GET /api/whatevermoduleitrytocall”. However, remote.html loads just fine.

      As I have.

      Edited: It was a mistake, sorry. I have same problem.

      1 Reply Last reply Reply Quote 1
      • M Offline
        mlcampbe
        last edited by May 2, 2019, 8:28 PM

        Same here too. I thought that perhaps we needed to have MMM-Api module installed but when I install that my MM won’t even start due to errors.

        1 Reply Last reply Reply Quote 0
        • S Away
          sdetweil
          last edited by sdetweil May 5, 2019, 11:40 AM May 4, 2019, 9:09 PM

          @AxLed said in [MMM-Remote-Control] Cannot GET /api:

          api/module/alert/showalert?message=Hello&timer=2000

          it looks like the api was changed, but not documented…

          looking thru node_helper.js you can see all the commands

          ip:port/remote?action=xxxxx&parms=???&parms2=???

          the code lists these actions

                      if (query.action === "SHUTDOWN") {
                      if (query.action === "REBOOT") {
                      if (query.action === "RESTART" || query.action === "STOP") {
                      if (query.action === "USER_PRESENCE") {
                      if (["MONITORON", "MONITOROFF", "MONITORTOGGLE", "MONITORSTATUS"].indexOf(query.action) !== -1) {
                          this.monitorControl(query.action, opts, res);
                      if (query.action === "HIDE" || query.action === "SHOW" || query.action === "TOGGLE") {
                          self.sendSocketNotification(query.action, query);
                      if (query.action === "BRIGHTNESS") {
                          self.sendSocketNotification(query.action, query.value);
                      if (query.action === "SAVE") {
                      if (query.action === "MODULE_DATA") {
                      if (query.action === "INSTALL") {
                      if (query.action === "REFRESH") {
                          self.sendSocketNotification(query.action);
                      if (query.action === "HIDE_ALERT") {
                          self.sendSocketNotification(query.action);
                      if (query.action === "SHOW_ALERT") {
                          self.sendSocketNotification(query.action, {
                      if (query.action === "UPDATE") {
                      if (query.action === 'NOTIFICATION') {
                              this.sendSocketNotification(query.action, { 'notification': query.notification, 'payload': payload });
                      if (["MINIMIZE", "TOGGLEFULLSCREEN", "DEVTOOLS"].indexOf(query.action) !== -1) {
                              switch (query.action) {
                      if (query.action === "DELAYED") {
          

          to send an alert thru the api

          http://mirror_ip:mirror_port/remote?action=SHOW_ALERT&message=foo&title=help&timer=10&type=alert
          

          the remote.html does NOT use the api, but uses the socketNotifications pipe under the covers.
          which is why it works, but the older /api/modulename… approach doesn’t

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          J A 2 Replies Last reply Aug 9, 2019, 2:37 PM Reply Quote 3
          • J Offline
            jvanoost @sdetweil
            last edited by Aug 9, 2019, 2:37 PM

            @sdetweil oh thank you so much !! I couldn’t find the way to use it :)

            1 Reply Last reply Reply Quote 0
            • P Offline
              PolaricBear
              last edited by Sep 27, 2019, 3:44 PM

              I think I solved the problem. At least it worked for me.
              Just delete file ./modules/package-lock.json. And restart the system.

              S S 2 Replies Last reply Sep 27, 2019, 5:11 PM Reply Quote 1
              • S Away
                sdetweil @PolaricBear
                last edited by Sep 27, 2019, 5:11 PM

                @PolaricBear did u post this to the wrong topic?

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • S Offline
                  Smolo @PolaricBear
                  last edited by Nov 17, 2019, 11:23 PM

                  @PolaricBear

                  Thx i had the same problem and your tip solved it :-)

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    AmazingUpHotel @sdetweil
                    last edited by Jul 2, 2020, 11:59 AM

                    @sdetweil THANKS YOU! That’s the problem, we dont need to use API!

                    1 Reply Last reply Reply Quote 0
                    • 1
                    • 2
                    • 1 / 2
                    • First post
                      Last post
                    Enjoying MagicMirror? Please consider a donation!
                    MagicMirror created by Michael Teeuw.
                    Forum managed by Sam, technical setup by Karsten.
                    This forum is using NodeBB as its core | Contributors
                    Contact | Privacy Policy