Title: register route 404
Last modified: August 30, 2016

---

# register route 404

 *  Resolved [crea8xion](https://wordpress.org/support/users/eyouthace/)
 * (@eyouthace)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/register-route-404/)
 * hi,
 * I had a problem with registering a custom route from the docs
 * [http://example.com/wp-json/myplugin/v2/author/id=1](http://example.com/wp-json/myplugin/v2/author/id=1)
   
   register_rest_route(‘myplugin/v2′,’/author/(?P<id>[\d]+)’, array( ‘methods’ =
   > ‘GET’, ‘callback’ => array($this, ‘my_awesome_func’), ‘args’ => array( ‘id’
   => array( ‘validate_callback’ => ‘is_numeric’ ), ), ) );
 * it returns
 * {
    “code”: “rest_no_route”, “message”: “No route was found matching the URL and
   request method”, “data”: { “status”: 404 } }
 * while doing so
 * [http://example.com/wp-json/myplugin/v2/author/](http://example.com/wp-json/myplugin/v2/author/)
   
   register_rest_route(‘myplugin/v2′,’/author’, ….)
 * returns
 * “Testing from post type post”
 * May i know whats causing it?
 * WP 4.3.1
    wp-rest-api Version 2.0-beta7
 * [https://wordpress.org/plugins/rest-api/](https://wordpress.org/plugins/rest-api/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/register-route-404/#post-6778529)
 * Your request needs to be:
 * `http://example.com/wp-json/myplugin/v2/author/1`
 * Note: I’ve dropped `id=` from the path.
 *  Thread Starter [crea8xion](https://wordpress.org/support/users/eyouthace/)
 * (@eyouthace)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/register-route-404/#post-6778531)
 * ok
 * Can I make a custom route that accepts arguments for inserting values to a custom
   table?
 * e.g.
 * register_rest_route( $this->namespace . $this->version, ‘/’ . $this->base . ‘/(?
   P<gcmid>[\d]+)’, array(
    array( ‘methods’ => WP_REST_Server::READABLE, ‘callback’
   => array($this, ‘my_awesome_func’), ‘permission_callback’ => null, ‘args’ => 
   array( ‘id’ => array( ), ), ), array( ‘methods’ => WP_REST_Server::CREATABLE,‘
   callback’ => array( $this, ‘create_item’ ), ‘permission_callback’ => null, ‘args’
   => array( ‘gcmid’ => array( ), ), ), ) );
 * and the full route would be
 * [http://example.com/wp-json/myplugin/v2/gcm/gcmid=12345](http://example.com/wp-json/myplugin/v2/gcm/gcmid=12345)
 * I still got 404…
 * Thanks..
 *  Plugin Author [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/register-route-404/#post-6778532)
 * > Can I make a custom route that accepts arguments for inserting values to a 
   > custom table?
 * Yes, it’s possible.
 * > and the full route would be
 * Again, the route you’re specifying with your regex is different than the route
   you’re trying. With the regex pattern you’ve specified, the URL would be:
 * `http://example.com/wp-json/cigapi/v2/gcm/12345`
 * Note: I’ve removed `gcmid=` from the path.
 *  Thread Starter [crea8xion](https://wordpress.org/support/users/eyouthace/)
 * (@eyouthace)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/register-route-404/#post-6778533)
 * Sorry,
 * This is not 404, its working..
 * This works
    [http://example.com/wp-json/myplugin/v2/gcm/12345](http://example.com/wp-json/myplugin/v2/gcm/12345)
 * But returns me on [POST]
 * “No response received”

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘register route 404’ is closed to new replies.

 * ![](https://ps.w.org/rest-api/assets/icon-256x256.png?rev=1346297)
 * [WordPress REST API (Version 2)](https://wordpress.org/plugins/rest-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rest-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rest-api/)
 * [Active Topics](https://wordpress.org/support/plugin/rest-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rest-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rest-api/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [crea8xion](https://wordpress.org/support/users/eyouthace/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/register-route-404/#post-6778533)
 * Status: resolved