We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38970
    • 59 Posts
    Hey Guy's,

    Was wondering if there is any talk around the water cooler about integrating an actual remote API system. I have a few sites I would like to kick off wordpress but they are all updated via wordpress's remote API.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Yes, it has come up from time to time. Years ago Scotty Delicious was working on a very nice Mac application for a complete remote Manager, but life intervened and he's no longer working with MODx. I have a demo of using email to create a new resource on Evo. I think others have done more than just demo applications.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 38970
        • 59 Posts
        It would be nice to have full api with SOAP or REST of some sort. We do a lot of management for clients and logging into their sites do do everything and post articles manage etc would be a huge pain in the ass.
          • 33976 ☆ A M B ☆
          • 571 Posts
          For the record, a RESTful API is shaping up (currently working pretty fine) for Revolution 2.3.

          If you want to play with it, you might want to dig this gist.

          Hope that will help
            • 38970
            • 59 Posts
            Hey Romain,

            Perfect will be a great addition to making our sites mobile apps as well.
              • 28218
              • 48 Posts
              Any documentation on this??
              Trying to implement this, but can't get it to work..

              For instance, what would be the right path for this?

              $modx->addPackage('myboxes','/path/to/myboxes/model');


              Thanks
                • 40045
                • 534 Posts
                Quote from: spoetnik at Mar 14, 2013, 03:16 PM
                Any documentation on this??
                Trying to implement this, but can't get it to work..

                For instance, what would be the right path for this?

                $modx->addPackage('myboxes','/path/to/myboxes/model');


                Thanks

                Documentation here: http://rtfm.modx.com/display/revolution20/modX.getService

                I usually do it somehow like this:

                $packagename = 'myboxes';
                $packagepath = $modx->getOption('core_path') . 'components/' . $packagename . '/';
                $modelpath   = $packagepath . 'model/';
                
                $service = $modx->getService($packagename, 'ServiceClass (holds the methods)', $modelpath . $packagename . '/');
                
                // then you can access the service with
                $service->method();
                
                // or without sabing with
                $modx->servicename->method();
                
                [ed. note: exside last edited this post 13 years, 7 months ago.]
                  • 40045
                  • 534 Posts
                  Quote from: exside at Mar 15, 2013, 01:26 PM
                  Quote from: spoetnik at Mar 14, 2013, 03:16 PM
                  Any documentation on this??
                  Trying to implement this, but can't get it to work..

                  For instance, what would be the right path for this?

                  $modx->addPackage('myboxes','/path/to/myboxes/model');


                  Thanks

                  Documentation here: http://rtfm.modx.com/display/revolution20/modX.getService

                  I usually do it somehow like this:

                  $packagename = 'myboxes';
                  $packagepath = $modx->getOption('core_path') . 'components/' . $packagename . '/';
                  $modelpath   = $packagepath . 'model/';
                  
                  $service = $modx->getService($packagename, 'ServiceClass (holds the methods)', $modelpath . $packagename . '/');
                  
                  // then you can access the service with
                  $service->method();
                  
                  // or with
                  $modx->servicename->method();
                  
                    • 28218
                    • 48 Posts
                    I think I mist the part that the above Gist only works for Revolution 2.3.....

                    (banging head to a wall....)