WordPress.org

Ready to get started?Download WordPress

Forums

JSON REST API (WP API)
[resolved] Magento Fishpig WordPress Integration problem (3 posts)

  1. cgspicer
    Member
    Posted 3 months ago #

    I am using the Fishpig integration of wordpress for Magento ( http://go.developer.ebay.com/devzone/articles/magento-part-4-integrating-magento-and-wordpress-using-fishpig-extension ) and I am having difficulty using the JSON REST API plugin-- domainname.com/wp/wp-json/ is 404. I have a feeling it is due to pathing issues, but I can not seem not resolve it. Has anyone else encountered this?

    When setting up the integration, you have to point Magento to the WordPress installation, and vice versa, so Magento is probably handling the routing and is probably 'protecting' wp's installation directory itself. Anyone have an idea of how I might override this?

    The site in question is http://www.iamalpham.com/
    Wordpress installation is http://www.iamalpham.com/wp which redirects to https://www.iamalpham.com/index.php/topics
    You can see that https://www.iamalpham.com/index.php/topics/wp-json/ returns a 404

    https://wordpress.org/plugins/json-rest-api/

  2. Ryan McCue
    Member
    Plugin Author

    Posted 3 months ago #

    I am using the Fishpig integration of wordpress for Magento

    I'm not sure on how this is integrated, however you basically want to hit the /wp-json/ rewrite in WordPress.

    According to your site's RSD, the API should be available at http://www.iamalpham.com/index.php/topics/wp-json

    However, it doesn't appear to be. :( I'd ask the developer of the integration how to access it.

  3. cgspicer
    Member
    Posted 3 months ago #

    I was able to resolve it by placing the plugin per the 'As part of Core' instructions ( https://github.com/WP-API/WP-API#as-part-of-core ) and integrating some of the initialization from plugin.php. Here's the final wp-json.php I placed in the root wordpress directroy: https://gist.github.com/cgspicer/06da7c5bdc7fdd4bc514. The plugin functionality is now accessible at http://www.iamalpham.com/wp/wp-json.php along with GET params http://www.iamalpham.com/wp/wp-json.php/posts?page=4; I have yet to check the POST,UPDATE,DELETE, but I suspect they work the same. I did do a quick ajax request with DELETE type, just to make sure it was secure and I received a 401.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.